From 14641d063fc3b5ddf5b0fd3ef94095d227d7118e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Wed, 27 Aug 2025 13:20:29 +0200 Subject: [PATCH] feat(nvim): move basedpyright options to config file instead of lsp definition --- .../plugins/extras/lang/python-extended.lua | 56 ------------------- .config/nvim/rules/pyrightconfig.json | 23 ++++++++ 2 files changed, 23 insertions(+), 56 deletions(-) create mode 100644 .config/nvim/rules/pyrightconfig.json diff --git a/.config/nvim/lua/plugins/extras/lang/python-extended.lua b/.config/nvim/lua/plugins/extras/lang/python-extended.lua index cb152fe2..fa4fb39d 100644 --- a/.config/nvim/lua/plugins/extras/lang/python-extended.lua +++ b/.config/nvim/lua/plugins/extras/lang/python-extended.lua @@ -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 = { diff --git a/.config/nvim/rules/pyrightconfig.json b/.config/nvim/rules/pyrightconfig.json new file mode 100644 index 00000000..382925d7 --- /dev/null +++ b/.config/nvim/rules/pyrightconfig.json @@ -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" +}