summaryrefslogtreecommitdiff
path: root/lua/lang/python.lua
diff options
context:
space:
mode:
authorChristian Chiarulli <[email protected]>2021-07-24 21:17:11 -0400
committerGitHub <[email protected]>2021-07-24 21:17:11 -0400
commit98f8a77819670ce6012216e01885c135a6d3a289 (patch)
treeb655da889c33e0eb89251878783700a8cd014a27 /lua/lang/python.lua
parent0884dcd84670bc097c34253e983d2cde9c209dfa (diff)
New contract (#1080)
Changes to the global config object O is now lvim user_plugins is now plugins user_autocommands is now autocommands No more lang specific plugins Null-ls has replaced both formatter.nvim and nvim-lint
Diffstat (limited to 'lua/lang/python.lua')
-rw-r--r--lua/lang/python.lua95
1 files changed, 0 insertions, 95 deletions
diff --git a/lua/lang/python.lua b/lua/lang/python.lua
deleted file mode 100644
index b51ea1c4..00000000
--- a/lua/lang/python.lua
+++ /dev/null
@@ -1,95 +0,0 @@
-local M = {}
-
-M.config = function()
- O.lang.python = {
- -- @usage can be flake8 or yapf
- linter = "",
- isort = false,
- diagnostics = {
- virtual_text = { spacing = 0, prefix = "ï„‘" },
- signs = true,
- underline = true,
- },
- analysis = {
- type_checking = "basic",
- auto_search_paths = true,
- use_library_code_types = true,
- },
- formatter = {
- exe = "yapf",
- args = {},
- stdin = true,
- },
- linters = {
- "flake8",
- "pylint",
- "mypy",
- },
- lsp = {
- path = DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver",
- },
- }
-end
-
-M.format = function()
- O.formatters.filetype["python"] = {
- function()
- return {
- exe = O.lang.python.formatter.exe,
- args = O.lang.python.formatter.args,
- stdin = O.lang.python.formatter.stdin,
- }
- end,
- }
-
- require("formatter.config").set_defaults {
- logging = false,
- filetype = O.formatters.filetype,
- }
-end
-
-M.lint = function()
- require("lint").linters_by_ft = {
- python = O.lang.python.linters,
- }
-end
-
-M.lsp = function()
- if require("lv-utils").check_lsp_client_active "pyright" then
- return
- end
- -- npm i -g pyright
- require("lspconfig").pyright.setup {
- cmd = {
- O.lang.python.lsp.path,
- "--stdio",
- },
- on_attach = require("lsp").common_on_attach,
- handlers = {
- ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
- virtual_text = O.lang.python.diagnostics.virtual_text,
- signs = O.lang.python.diagnostics.signs,
- underline = O.lang.python.diagnostics.underline,
- update_in_insert = true,
- }),
- },
- settings = {
- python = {
- analysis = {
- typeCheckingMode = O.lang.python.analysis.type_checking,
- autoSearchPaths = O.lang.python.analysis.auto_search_paths,
- useLibraryCodeForTypes = O.lang.python.analysis.use_library_code_types,
- },
- },
- },
- }
-end
-
-M.dap = function()
- if O.plugin.dap.active then
- local dap_install = require "dap-install"
- dap_install.config("python_dbg", {})
- end
-end
-
-return M