From 66405c7b894cd0836ec2fab9b722311dd37a34de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 06:54:53 +0000 Subject: [PATCH 1/4] chore(deps): bump pyright from 1.1.347 to 1.1.348 in /language-server Bumps [pyright](https://github.com/Microsoft/pyright/tree/HEAD/packages/pyright) from 1.1.347 to 1.1.348. - [Release notes](https://github.com/Microsoft/pyright/releases) - [Commits](https://github.com/Microsoft/pyright/commits/1.1.348/packages/pyright) --- updated-dependencies: - dependency-name: pyright dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- language-server/package-lock.json | 14 +++++++------- language-server/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/language-server/package-lock.json b/language-server/package-lock.json index 12547ea..b922c6f 100644 --- a/language-server/package-lock.json +++ b/language-server/package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "pyright": "^1.1.347" + "pyright": "^1.1.348" } }, "node_modules/fsevents": { @@ -22,9 +22,9 @@ } }, "node_modules/pyright": { - "version": "1.1.347", - "resolved": "https://registry.npmjs.org/pyright/-/pyright-1.1.347.tgz", - "integrity": "sha512-n5sGnhT53daesmKNXcg/Bb/CdNO81O8pI+5YkEga++uJizX22rEiQMt1V5LGKTXm/92qTyJopxvhLnZpk/Ryqg==", + "version": "1.1.348", + "resolved": "https://registry.npmjs.org/pyright/-/pyright-1.1.348.tgz", + "integrity": "sha512-Dezu8jwZLwh9c2JCrXbmOb5BSeuQRM6NdOqN0jpuYpSWH9T8uIyhchkLHdvZ9BjDuUG5QN/4LVtLNbyLQHZ5LQ==", "bin": { "pyright": "index.js", "pyright-langserver": "langserver.index.js" @@ -45,9 +45,9 @@ "optional": true }, "pyright": { - "version": "1.1.347", - "resolved": "https://registry.npmjs.org/pyright/-/pyright-1.1.347.tgz", - "integrity": "sha512-n5sGnhT53daesmKNXcg/Bb/CdNO81O8pI+5YkEga++uJizX22rEiQMt1V5LGKTXm/92qTyJopxvhLnZpk/Ryqg==", + "version": "1.1.348", + "resolved": "https://registry.npmjs.org/pyright/-/pyright-1.1.348.tgz", + "integrity": "sha512-Dezu8jwZLwh9c2JCrXbmOb5BSeuQRM6NdOqN0jpuYpSWH9T8uIyhchkLHdvZ9BjDuUG5QN/4LVtLNbyLQHZ5LQ==", "requires": { "fsevents": "~2.3.2" } diff --git a/language-server/package.json b/language-server/package.json index 46443f3..9df8b16 100644 --- a/language-server/package.json +++ b/language-server/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "pyright": "^1.1.347" + "pyright": "^1.1.348" } } From 4d4ac67d7c1e91137bd1229146a8aeebc542d2f5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 22 Jan 2024 06:55:08 +0000 Subject: [PATCH 2/4] [automated commit] update schema --- sublime-package.json | 102 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 99 insertions(+), 3 deletions(-) diff --git a/sublime-package.json b/sublime-package.json index 12937c5..3c44432 100644 --- a/sublime-package.json +++ b/sublime-package.json @@ -531,18 +531,54 @@ "title": "Python version to assume during type analysis", "type": "string" }, + "reportAbstractUsage": { + "$id": "#/properties/reportAbstractUsage", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of attempted instantiation of abstract class" + }, + "reportArgumentType": { + "$id": "#/properties/reportArgumentType", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of incompatible argument type" + }, "reportAssertAlwaysTrue": { "$id": "#/properties/reportAssertAlwaysTrue", "$ref": "#/definitions/diagnostic", "default": "warning", "title": "Controls reporting assert expressions that will always evaluate to true" }, + "reportAssertTypeFailure": { + "$id": "#/properties/reportAssertTypeFailure", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of type mismatch detected by typing.assert_type call" + }, + "reportAssignmentType": { + "$id": "#/properties/reportAssignmentType", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of type incompatibilities for assignments" + }, + "reportAttributeAccessIssue": { + "$id": "#/properties/reportAttributeAccessIssue", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of issues related to attribute accesses" + }, "reportCallInDefaultInitializer": { "$id": "#/properties/reportCallInDefaultInitializer", "$ref": "#/definitions/diagnostic", "default": "none", "title": "Controls reporting usage of function calls within a default value initializer expression" }, + "reportCallIssue": { + "$id": "#/properties/reportCallIssue", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of issues related to call expressions and arguments" + }, "reportConstantRedefinition": { "$id": "#/properties/reportConstantRedefinition", "$ref": "#/definitions/diagnostic", @@ -615,6 +651,18 @@ "default": "none", "title": "Controls reporting of __init__ and __new__ methods whose signatures are inconsistent" }, + "reportInconsistentOverload": { + "$id": "#/properties/reportInconsistentOverload", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of inconsistencies between function overload signatures" + }, + "reportIndexIssue": { + "$id": "#/properties/reportIndexIssue", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of issues related to index operations and expressions" + }, "reportInvalidStringEscapeSequence": { "$id": "#/properties/reportInvalidStringEscapeSequence", "$ref": "#/definitions/diagnostic", @@ -627,6 +675,18 @@ "default": "none", "title": "Controls reporting of type stub statements that do not conform to PEP 484" }, + "reportInvalidTypeArguments": { + "$id": "#/properties/reportInvalidTypeArguments", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of invalid type argument usage" + }, + "reportInvalidTypeForm": { + "$id": "#/properties/reportInvalidTypeForm", + "$ref": "#/definitions/diagnostic", + "default": "warning", + "title": "Controls reporting of type expressions that use an invalid form" + }, "reportInvalidTypeVarUse": { "$id": "#/properties/reportInvalidTypeVarUse", "$ref": "#/definitions/diagnostic", @@ -675,6 +735,18 @@ "default": "warning", "title": "Controls reporting of imports that cannot be resolved to type stub files" }, + "reportNoOverloadImplementation": { + "$id": "#/properties/reportNoOverloadImplementation", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of an overloaded function or method with a missing implementation" + }, + "reportOperatorIssue": { + "$id": "#/properties/reportOperatorIssue", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of diagnostics related to unary and binary operators" + }, "reportOptionalCall": { "$id": "#/properties/reportOptionalCall", "$ref": "#/definitions/diagnostic", @@ -717,6 +789,12 @@ "default": "error", "title": "Controls reporting of function overloads that overlap in signature and obscure each other or do not agree on return type" }, + "reportPossiblyUnboundVariable": { + "$id": "#/properties/reportPossiblyUnboundVariable", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of attempts to use variable that is possibly unbound on some code paths" + }, "reportPrivateImportUsage": { "$id": "#/properties/reportPrivateImportUsage", "$ref": "#/definitions/diagnostic", @@ -735,11 +813,23 @@ "default": "none", "title": "Controls reporting of property getter/setter type mismatches" }, + "reportRedeclaration": { + "$id": "#/properties/reportRedeclaration", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of attempts to declare the type of a symbol multiple times" + }, + "reportReturnType": { + "$id": "#/properties/reportReturnType", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of function return type incompatibility" + }, "reportSelfClsParameterName": { "$id": "#/properties/reportSelfClsParameterName", "$ref": "#/definitions/diagnostic", "default": "warning", - "title": "Controls reporting assert expressions that will always evaluate to true" + "title": "Controls reporting missing or misnamed self parameters" }, "reportShadowedImports": { "$id": "#/properties/reportShadowedImports", @@ -763,7 +853,7 @@ "$id": "#/properties/reportUnboundVariable", "$ref": "#/definitions/diagnostic", "default": "error", - "title": "Controls reporting of attempts to use an unbound or possibly unbound variable" + "title": "Controls reporting of attempts to use an unbound variable" }, "reportUndefinedVariable": { "$id": "#/properties/reportUndefinedVariable", @@ -885,6 +975,12 @@ "default": "error", "title": "Controls reporting of call expressions that returns Coroutine whose results are not consumed" }, + "reportUnusedExcept": { + "$id": "#/properties/reportUnusedExcept", + "$ref": "#/definitions/diagnostic", + "default": "error", + "title": "Controls reporting of unreachable except clauses" + }, "reportUnusedExpression": { "$id": "#/properties/reportUnusedExpression", "$ref": "#/definitions/diagnostic", @@ -913,7 +1009,7 @@ "$id": "#/properties/reportWildcardImportFromLibrary", "$ref": "#/definitions/diagnostic", "default": "warning", - "title": "Controls reporting of wlidcard import from external library" + "title": "Controls reporting of wildcard import from external library" }, "strict": { "$id": "#/properties/strict", From eeae8ad7a9596eb084118459f068f3dd6ec9434e Mon Sep 17 00:00:00 2001 From: Rafal Chlodnicki Date: Mon, 22 Jan 2024 21:21:33 +0100 Subject: [PATCH 3/4] update settings schema --- LSP-pyright.sublime-settings | 2 -- scripts/update_schema.py | 20 ++++++--------- sublime-package.json | 48 ++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 14 deletions(-) diff --git a/LSP-pyright.sublime-settings b/LSP-pyright.sublime-settings index 97aa536..db3eb43 100644 --- a/LSP-pyright.sublime-settings +++ b/LSP-pyright.sublime-settings @@ -32,9 +32,7 @@ "python.analysis.diagnosticSeverityOverrides": { "reportDuplicateImport": "warning", "reportImplicitStringConcatenation": "warning", - "reportMissingParameterType": "none", "reportUnboundVariable": "warning", - "reportUninitializedInstanceVariable": "none", "reportUnusedClass": "information", "reportUnusedFunction": "information", "reportUnusedImport": "information", diff --git a/scripts/update_schema.py b/scripts/update_schema.py index dcf970e..3632f01 100755 --- a/scripts/update_schema.py +++ b/scripts/update_schema.py @@ -3,7 +3,6 @@ from __future__ import annotations import json -from collections.abc import Generator from pathlib import Path from typing import Any from urllib.request import urlopen @@ -56,7 +55,7 @@ def read_sublime_package_json() -> tuple[JsonDict, JsonDict]: return (pyrightconfig_schema_json, sublime_package_schema_json) -def update_schema(sublime_package_json: JsonDict, pyrightconfig_schema_json: JsonDict) -> Generator[str, None, None]: +def update_schema(sublime_package_json: JsonDict, pyrightconfig_schema_json: JsonDict) -> list[str]: pyrightconfig_contribution: JsonDict | None = None lsp_pyright_contribution: JsonDict | None = None for contribution in sublime_package_json["contributions"]["settings"]: @@ -92,16 +91,13 @@ def update_schema(sublime_package_json: JsonDict, pyrightconfig_schema_json: Jso # then it might have to be added manually. all_settings_keys = [key.rpartition(".")[2] for key in settings_properties.keys()] all_overrides_keys = settings_properties["python.analysis.diagnosticSeverityOverrides"]["properties"].keys() - - yield from ( - pyrightconfig_key - for pyrightconfig_key in pyrightconfig_properties.keys() - if not ( - pyrightconfig_key in all_settings_keys - or pyrightconfig_key in all_overrides_keys - or pyrightconfig_key in IGNORED_PYRIGHTCONFIG_KEYS - ) - ) + new_schema_keys = [] + for pyrightconfig_key in pyrightconfig_properties.keys(): + if pyrightconfig_key not in all_settings_keys \ + and pyrightconfig_key not in all_overrides_keys \ + and pyrightconfig_key not in IGNORED_PYRIGHTCONFIG_KEYS: + new_schema_keys.append(pyrightconfig_key) + return new_schema_keys def update_property_ref(property_key: str, property_schema: JsonDict, pyrightconfig_properties: JsonDict) -> None: diff --git a/sublime-package.json b/sublime-package.json index 3c44432..2db245c 100644 --- a/sublime-package.json +++ b/sublime-package.json @@ -87,12 +87,30 @@ "enableTypeIgnoreComments": { "$ref": "sublime://pyrightconfig#/properties/enableTypeIgnoreComments" }, + "reportAbstractUsage": { + "$ref": "sublime://pyrightconfig#/properties/reportAbstractUsage" + }, + "reportArgumentType": { + "$ref": "sublime://pyrightconfig#/properties/reportArgumentType" + }, "reportAssertAlwaysTrue": { "$ref": "sublime://pyrightconfig#/properties/reportAssertAlwaysTrue" }, + "reportAssertTypeFailure": { + "$ref": "sublime://pyrightconfig#/properties/reportAssertTypeFailure" + }, + "reportAssignmentType": { + "$ref": "sublime://pyrightconfig#/properties/reportAssignmentType" + }, + "reportAttributeAccessIssue": { + "$ref": "sublime://pyrightconfig#/properties/reportAttributeAccessIssue" + }, "reportCallInDefaultInitializer": { "$ref": "sublime://pyrightconfig#/properties/reportCallInDefaultInitializer" }, + "reportCallIssue": { + "$ref": "sublime://pyrightconfig#/properties/reportCallIssue" + }, "reportConstantRedefinition": { "$ref": "sublime://pyrightconfig#/properties/reportConstantRedefinition" }, @@ -129,12 +147,24 @@ "reportInconsistentConstructor": { "$ref": "sublime://pyrightconfig#/properties/reportInconsistentConstructor" }, + "reportInconsistentOverload": { + "$ref": "sublime://pyrightconfig#/properties/reportInconsistentOverload" + }, + "reportIndexIssue": { + "$ref": "sublime://pyrightconfig#/properties/reportIndexIssue" + }, "reportInvalidStringEscapeSequence": { "$ref": "sublime://pyrightconfig#/properties/reportInvalidStringEscapeSequence" }, "reportInvalidStubStatement": { "$ref": "sublime://pyrightconfig#/properties/reportInvalidStubStatement" }, + "reportInvalidTypeArguments": { + "$ref": "sublime://pyrightconfig#/properties/reportInvalidTypeArguments" + }, + "reportInvalidTypeForm": { + "$ref": "sublime://pyrightconfig#/properties/reportInvalidTypeForm" + }, "reportInvalidTypeVarUse": { "$ref": "sublime://pyrightconfig#/properties/reportInvalidTypeVarUse" }, @@ -159,6 +189,12 @@ "reportMissingTypeStubs": { "$ref": "sublime://pyrightconfig#/properties/reportMissingTypeStubs" }, + "reportNoOverloadImplementation": { + "$ref": "sublime://pyrightconfig#/properties/reportNoOverloadImplementation" + }, + "reportOperatorIssue": { + "$ref": "sublime://pyrightconfig#/properties/reportOperatorIssue" + }, "reportOptionalCall": { "$ref": "sublime://pyrightconfig#/properties/reportOptionalCall" }, @@ -180,6 +216,9 @@ "reportOverlappingOverload": { "$ref": "sublime://pyrightconfig#/properties/reportOverlappingOverload" }, + "reportPossiblyUnboundVariable": { + "$ref": "sublime://pyrightconfig#/properties/reportPossiblyUnboundVariable" + }, "reportPrivateImportUsage": { "$ref": "sublime://pyrightconfig#/properties/reportPrivateImportUsage" }, @@ -189,6 +228,12 @@ "reportPropertyTypeMismatch": { "$ref": "sublime://pyrightconfig#/properties/reportPropertyTypeMismatch" }, + "reportRedeclaration": { + "$ref": "sublime://pyrightconfig#/properties/reportRedeclaration" + }, + "reportReturnType": { + "$ref": "sublime://pyrightconfig#/properties/reportReturnType" + }, "reportSelfClsParameterName": { "$ref": "sublime://pyrightconfig#/properties/reportSelfClsParameterName" }, @@ -264,6 +309,9 @@ "reportUnusedCoroutine": { "$ref": "sublime://pyrightconfig#/properties/reportUnusedCoroutine" }, + "reportUnusedExcept": { + "$ref": "sublime://pyrightconfig#/properties/reportUnusedExcept" + }, "reportUnusedExpression": { "$ref": "sublime://pyrightconfig#/properties/reportUnusedExpression" }, From 7ce2e0c88450fb464a62e1dd02277a6e4251a64b Mon Sep 17 00:00:00 2001 From: Rafal Chlodnicki Date: Mon, 22 Jan 2024 21:26:04 +0100 Subject: [PATCH 4/4] formatting --- scripts/update_schema.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/update_schema.py b/scripts/update_schema.py index 3632f01..a780525 100755 --- a/scripts/update_schema.py +++ b/scripts/update_schema.py @@ -93,9 +93,11 @@ def update_schema(sublime_package_json: JsonDict, pyrightconfig_schema_json: Jso all_overrides_keys = settings_properties["python.analysis.diagnosticSeverityOverrides"]["properties"].keys() new_schema_keys = [] for pyrightconfig_key in pyrightconfig_properties.keys(): - if pyrightconfig_key not in all_settings_keys \ - and pyrightconfig_key not in all_overrides_keys \ - and pyrightconfig_key not in IGNORED_PYRIGHTCONFIG_KEYS: + if ( + pyrightconfig_key not in all_settings_keys + and pyrightconfig_key not in all_overrides_keys + and pyrightconfig_key not in IGNORED_PYRIGHTCONFIG_KEYS + ): new_schema_keys.append(pyrightconfig_key) return new_schema_keys