From 3c9a3251f98cb9ee289e81ebb909d7af4b7375f1 Mon Sep 17 00:00:00 2001 From: Gamercrow Date: Wed, 8 Oct 2025 17:38:31 +0200 Subject: [PATCH 1/3] Made diagnosticSeverityOverrides use clearer + added links to and fro --- docs/configuration/config-files.md | 2 +- .../configuration/language-server-settings.md | 20 +++++++++++++++++-- pyproject.toml | 1 + 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/configuration/config-files.md b/docs/configuration/config-files.md index e7291dd4d4..54269c8feb 100644 --- a/docs/configuration/config-files.md +++ b/docs/configuration/config-files.md @@ -115,7 +115,7 @@ The following settings control pyright’s diagnostic output (warnings or errors ### Type Check Rule Overrides -The following settings allow more fine grained control over the **typeCheckingMode**. Unless otherwise specified, each diagnostic setting can specify a boolean value (`false` indicating that no error is generated and `true` indicating that an error is generated). Alternatively, a string value of `"none"`, `"hint"`, `"warning"`, `"information"`, or `"error"` can be used to specify the diagnostic level. [see above for more information](#diagnostic-categories) +The following settings allow more fine grained control over the **typeCheckingMode**. Unless otherwise specified, each diagnostic setting can specify a boolean value (`false` indicating that no error is generated and `true` indicating that an error is generated). Alternatively, a string value of `"none"`, `"hint"`, `"warning"`, `"information"`, or `"error"` can be used to specify the diagnostic level. [see above for more information](#diagnostic-categories), and check the [language server discouraged settings](./language-server-settings.md#discouraged-settings) to learn how to use them in your config (note that as the name implies, you should avoid doing that : use preferably the modes available for **typeCheckingMode**). - **reportGeneralTypeIssues** [boolean or string, optional]: Generate or suppress diagnostics for general type inconsistencies, unsupported operations, argument/parameter mismatches, etc. This covers all of the basic type-checking rules not covered by other rules. It does not include syntax errors. diff --git a/docs/configuration/language-server-settings.md b/docs/configuration/language-server-settings.md index a82cbbcf0a..70905f1cce 100644 --- a/docs/configuration/language-server-settings.md +++ b/docs/configuration/language-server-settings.md @@ -106,7 +106,10 @@ the basedpyright language server settings can be configured using a workspace or ```json title="./.vscode/settings.json" { - "basedpyright.analysis.diagnosticMode": "openFilesOnly" + "basedpyright.analysis.diagnosticMode": "openFilesOnly", + "basedpyright.analysis.typeCheckingMode": "standard", + "basedpyright.analysis.diagnosticSeverityOverrides.reportCallIssue": "warning", + "basedpyright.analysis.diagnosticSeverityOverrides.reportArgumentType": "warning" } ``` @@ -120,6 +123,11 @@ require("lspconfig").basedpyright.setup { basedpyright = { analysis = { diagnosticMode = "openFilesOnly", + typeCheckingMode = "standard", + diagnosticSeverityOverrides = { + reportCallIssue = "warning", + reportArgumentType = false + }, inlayHints = { callArgumentNames = true } @@ -138,6 +146,9 @@ args = ["--stdio"] [language-server.basedpyright.config] basedpyright.analysis.diagnosticMode = "openFilesOnly" +basedpyright.analysis.typeCheckingMode = "standard" +basedpyright.analysis.diagnosticSeverityOverrides.reportCallIssue = "warning" +basedpyright.analysis.diagnosticSeverityOverrides.reportArgumentType = false ``` ### zed @@ -156,7 +167,12 @@ basedpyright.analysis.diagnosticMode = "openFilesOnly" "pythonPath": ".venv/bin/python" }, "basedpyright.analysis": { - "diagnosticMode": "openFilesOnly" + "diagnosticMode": "openFilesOnly", + "typeCheckingMode": "standard", + "diagnosticSeverityOverrides": { + "reportCallIssue": "warning", + "reportArgumentType": false + } } } } diff --git a/pyproject.toml b/pyproject.toml index 61f9cfaa35..8bb18844aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -124,6 +124,7 @@ load-plugins = [ disable = ["R", "C", "E", "F", "W", "I"] enable = [ "useless-suppression", + "fatal", # rules that have not yet been implemented in ruff. once all of these are implemented in ruff, we should remove pylint # (see https://github.com/astral-sh/ruff/issues/970): "access-member-before-definition", From aac849da9f11b54d6a73bd6182c1914bfe9418bc Mon Sep 17 00:00:00 2001 From: Gamercrow Date: Thu, 9 Oct 2025 13:41:51 +0200 Subject: [PATCH 2/3] Corrected the reason why the use of diagnosticSeverityOverrides in the editor's main config is discouraged --- docs/configuration/config-files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration/config-files.md b/docs/configuration/config-files.md index 54269c8feb..26e5730e4a 100644 --- a/docs/configuration/config-files.md +++ b/docs/configuration/config-files.md @@ -115,7 +115,7 @@ The following settings control pyright’s diagnostic output (warnings or errors ### Type Check Rule Overrides -The following settings allow more fine grained control over the **typeCheckingMode**. Unless otherwise specified, each diagnostic setting can specify a boolean value (`false` indicating that no error is generated and `true` indicating that an error is generated). Alternatively, a string value of `"none"`, `"hint"`, `"warning"`, `"information"`, or `"error"` can be used to specify the diagnostic level. [see above for more information](#diagnostic-categories), and check the [language server discouraged settings](./language-server-settings.md#discouraged-settings) to learn how to use them in your config (note that as the name implies, you should avoid doing that : use preferably the modes available for **typeCheckingMode**). +The following settings allow more fine grained control over the **typeCheckingMode**. Unless otherwise specified, each diagnostic setting can specify a boolean value (`false` indicating that no error is generated and `true` indicating that an error is generated). Alternatively, a string value of `"none"`, `"hint"`, `"warning"`, `"information"`, or `"error"` can be used to specify the diagnostic level. [see above for more information](#diagnostic-categories), and check the [language server discouraged settings](./language-server-settings.md#discouraged-settings) to learn how to use them in your config (note that as the name implies and as explained in this aforementioned section, you should avoid doing that in your editor's main config). - **reportGeneralTypeIssues** [boolean or string, optional]: Generate or suppress diagnostics for general type inconsistencies, unsupported operations, argument/parameter mismatches, etc. This covers all of the basic type-checking rules not covered by other rules. It does not include syntax errors. From 06234fb0cc239bd45692dca2251fb90dcaf9fd25 Mon Sep 17 00:00:00 2001 From: Gamercrow Date: Thu, 9 Oct 2025 13:42:22 +0200 Subject: [PATCH 3/3] Fixed example for vscode config --- docs/configuration/language-server-settings.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/configuration/language-server-settings.md b/docs/configuration/language-server-settings.md index 70905f1cce..6722029a54 100644 --- a/docs/configuration/language-server-settings.md +++ b/docs/configuration/language-server-settings.md @@ -108,8 +108,10 @@ the basedpyright language server settings can be configured using a workspace or { "basedpyright.analysis.diagnosticMode": "openFilesOnly", "basedpyright.analysis.typeCheckingMode": "standard", - "basedpyright.analysis.diagnosticSeverityOverrides.reportCallIssue": "warning", - "basedpyright.analysis.diagnosticSeverityOverrides.reportArgumentType": "warning" + "basedpyright.analysis.diagnosticSeverityOverrides": { + "reportCallIssue": "warning", + "reportArgumentType": false + } } ```