feat(nvim): move basedpyright options to config file instead of lsp

definition
This commit is contained in:
Sergio Laín 2025-08-27 13:20:29 +02:00
parent 3f3a617ce1
commit 14641d063f
No known key found for this signature in database
GPG key ID: 51BB28D8B42FB438
2 changed files with 23 additions and 56 deletions

View file

@ -7,62 +7,6 @@ vim.g.lazyvim_python_ruff = "ruff"
return {
{ import = "lazyvim.plugins.extras.lang.python" },
{
"neovim/nvim-lspconfig",
opts = {
servers = {
---@type lspconfig.options.basedpyright
basedpyright = {
settings = {
basedpyright = {
analysis = {
diagnosticSeverityOverrides = {
reportMissingTypeStubs = "information", -- import has no type stub file
reportIgnoreCommentWithoutRule = "warning",
reportUnreachable = "error",
reportPrivateLocalImportUsage = "error",
reportImplicitRelativeImport = "error",
reportInvalidCast = "error",
reportMissingSuperCall = false,
reportUnusedCallResult = "information",
reportUnusedExpression = "information",
reportUnknownMemberType = "none",
reportUnknownLambdaType = "none",
reportUnknownParameterType = "none",
reportMissingParameterType = "none",
reportUnknownVariableType = "none",
reportUnknownArgumentType = "none",
reportAny = "none",
},
},
},
},
},
---@type lspconfig.options.pyright
pyright = {
settings = {
verboseOutput = true,
autoImportCompletion = true,
python = {
analysis = {
diagnosticSeverityOverrides = {
reportWildcardImportFromLibrary = "none",
reportUnusedImport = "information",
reportUnusedClass = "information",
reportUnusedFunction = "information",
},
typeCheckingMode = "strict",
autoSearchPaths = true,
useLibraryCodeForTypes = true,
diagnosticMode = "openFilesOnly",
indexing = true,
},
},
},
},
},
},
},
{
"nvim-treesitter/nvim-treesitter",
opts = {

View file

@ -0,0 +1,23 @@
{
"include": ["src"],
"exclude": ["**/node_modules", "**/__pycache__"],
"typeCheckingMode": "basic",
"reportUnusedImport": "none",
"reportMissingTypeStubs": "none",
"reportIgnoreCommentWithoutRule": "warning",
"reportUnreachable": "error",
"reportPrivateLocalImportUsage": "error",
"reportImplicitRelativeImport": "error",
"reportInvalidCast": "error",
"reportMissingSuperCall": false,
"reportUnusedCallResult": "information",
"reportUnusedExpression": "information",
"reportUnknownMemberType": "none",
"reportUnknownLambdaType": "none",
"reportUnknownParameterType": "none",
"reportMissingParameterType": "none",
"reportUnknownVariableType": "none",
"reportUnknownArgumentType": "none",
"reportAny": "none"
}