nvim+mypy
This commit is contained in:
+5
-17
@@ -1,18 +1,6 @@
|
|||||||
[mypy]
|
[mypy]
|
||||||
show_error_context = True
|
strict = true
|
||||||
show_error_codes = True
|
local_partial_types = true
|
||||||
show_column_numbers = True
|
warn_return_any = false
|
||||||
pretty = True
|
disallow_subclassing_any = false
|
||||||
color_output = True
|
pretty = true
|
||||||
|
|
||||||
disallow_untyped_calls = False
|
|
||||||
disallow_untyped_defs = True
|
|
||||||
disallow_incomplete_defs = True
|
|
||||||
disallow_untyped_decorators = True
|
|
||||||
|
|
||||||
# warn_redundant_casts = True
|
|
||||||
# warn_unused_ignores = True
|
|
||||||
# warn_unreachable = True
|
|
||||||
warn_return_any = False
|
|
||||||
no_implicit_optional = True
|
|
||||||
strict_optional = True
|
|
||||||
|
|||||||
+32
-7
@@ -439,8 +439,36 @@ local function makespec_lspconfig()
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
lspconfig.pyright.setup({
|
lspconfig.pylsp.setup({
|
||||||
cmd = { "pyright-langserver", "--stdio", "--threads", "20" },
|
filetypes = { "python" },
|
||||||
|
root_dir = function(fname)
|
||||||
|
local root_files = {
|
||||||
|
".git",
|
||||||
|
"pyproject.toml",
|
||||||
|
"setup.py",
|
||||||
|
"setup.cfg",
|
||||||
|
"requirements.txt",
|
||||||
|
"Pipfile",
|
||||||
|
"pyrightconfig.json",
|
||||||
|
}
|
||||||
|
return lspconfig.util.root_pattern(unpack(root_files))(fname)
|
||||||
|
end,
|
||||||
|
settings = {
|
||||||
|
pylsp = {
|
||||||
|
plugins = {
|
||||||
|
pylsp_mypy = {
|
||||||
|
enabled = true,
|
||||||
|
dmypy = true,
|
||||||
|
},
|
||||||
|
pycodestyle = { enabled = false },
|
||||||
|
mccabe = { enabled = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Other lspconfig options like on_attach, capabilities can be set here
|
||||||
|
})
|
||||||
|
lspconfig.basedpyright.setup({
|
||||||
|
cmd = { "basedpyright-langserver", "--stdio", "--threads", "20" },
|
||||||
filetypes = { "python" },
|
filetypes = { "python" },
|
||||||
root_dir = function(fname)
|
root_dir = function(fname)
|
||||||
local root_files = {
|
local root_files = {
|
||||||
@@ -460,7 +488,6 @@ local function makespec_lspconfig()
|
|||||||
-- logLevel = "Trace",
|
-- logLevel = "Trace",
|
||||||
autoImportCompletions = false,
|
autoImportCompletions = false,
|
||||||
diagnosticMode = "workspace",
|
diagnosticMode = "workspace",
|
||||||
useLibraryCodeForTypes = true,
|
|
||||||
logTypeEvaluationTime = true,
|
logTypeEvaluationTime = true,
|
||||||
typeEvaluationTimeThreshold = 2000,
|
typeEvaluationTimeThreshold = 2000,
|
||||||
},
|
},
|
||||||
@@ -1061,9 +1088,8 @@ local function makespec_snacks()
|
|||||||
{ "<leader>ll", function() Snacks.picker.notifications() end, desc = "Notification History" },
|
{ "<leader>ll", function() Snacks.picker.notifications() end, desc = "Notification History" },
|
||||||
-- code
|
-- code
|
||||||
{ "<leader>cS", function() Snacks.picker.lsp_symbols() end, desc = "LSP Symbols" },
|
{ "<leader>cS", function() Snacks.picker.lsp_symbols() end, desc = "LSP Symbols" },
|
||||||
-- replaced by Trouble
|
{ "<leader>cW", function() Snacks.picker.lsp_workspace_symbols() end, desc = "LSP Workspace Symbols" },
|
||||||
-- { "<leader>cW", function() Snacks.picker.lsp_workspace_symbols() end, desc = "LSP Workspace Symbols" },
|
{ "<leader>cd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" },
|
||||||
-- { "<leader>cd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" },
|
|
||||||
-- terminal
|
-- terminal
|
||||||
{ "<C-/>", function() Snacks.terminal.toggle() end, desc = "Snacks Terminal", mode={"n", "t"} },
|
{ "<C-/>", function() Snacks.terminal.toggle() end, desc = "Snacks Terminal", mode={"n", "t"} },
|
||||||
{ "<C-_>", function() Snacks.terminal.toggle() end, desc = "which_key_ignore", mode={'n', "t"} },
|
{ "<C-_>", function() Snacks.terminal.toggle() end, desc = "which_key_ignore", mode={'n', "t"} },
|
||||||
@@ -1153,7 +1179,6 @@ local function makespec_trouble()
|
|||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>cc", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer Diagnostics" },
|
{ "<leader>cc", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer Diagnostics" },
|
||||||
{ "<leader>cd", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics" },
|
|
||||||
{ "<leader>cr", "<cmd>Trouble lsp_references toggle<cr>", desc = "References" },
|
{ "<leader>cr", "<cmd>Trouble lsp_references toggle<cr>", desc = "References" },
|
||||||
{ "<leader>cs", "<cmd>Trouble symbols toggle<cr>", desc = "Document Symbols" },
|
{ "<leader>cs", "<cmd>Trouble symbols toggle<cr>", desc = "Document Symbols" },
|
||||||
{ "<leader>ca", "<cmd>Trouble lsp toggle<cr>", desc = "LSP references/definitions/..." },
|
{ "<leader>ca", "<cmd>Trouble lsp toggle<cr>", desc = "LSP references/definitions/..." },
|
||||||
|
|||||||
Reference in New Issue
Block a user