From c147a055c9c3f0ccc8f74a946513e8cde5a3bd23 Mon Sep 17 00:00:00 2001 From: Lev Vereshchagin Date: Mon, 20 Oct 2025 15:24:29 +0300 Subject: [PATCH 1/2] Update --- .github/workflows/test.yml | 1 + auto_typing_final/finder.py | 7 ++++--- auto_typing_final/lsp.py | 2 +- auto_typing_final/main.py | 2 +- pyproject.toml | 2 +- tests/conftest.py | 4 ++-- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f83b8e8..4f5bd26 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,6 +42,7 @@ jobs: - "3.11" - "3.12" - "3.13" + - "3.14" steps: - uses: actions/checkout@v5 - uses: extractions/setup-just@v3 diff --git a/auto_typing_final/finder.py b/auto_typing_final/finder.py index 4c4cbc4..817029f 100644 --- a/auto_typing_final/finder.py +++ b/auto_typing_final/finder.py @@ -107,9 +107,10 @@ def _find_identifiers_made_by_node(node: SgNode) -> Iterable[SgNode]: # noqa: C yield from _find_identifiers_in_import_statement(node) case "as_pattern": match tuple((child.kind(), child) for child in node.children()): - case ( - (("identifier", _), ("as", _), ("as_pattern_target", alias)) - | (("case_pattern", _), ("as", _), ("identifier", alias)) + case (("identifier", _), ("as", _), ("as_pattern_target", alias)) | ( + ("case_pattern", _), + ("as", _), + ("identifier", alias), ): yield alias case "keyword_pattern": diff --git a/auto_typing_final/lsp.py b/auto_typing_final/lsp.py index 3e22a0c..35e0e27 100644 --- a/auto_typing_final/lsp.py +++ b/auto_typing_final/lsp.py @@ -297,7 +297,7 @@ def code_action(ls: CustomLanguageServer, params: lsp.CodeActionParams) -> list[ @LSP_SERVER.feature(lsp.CODE_ACTION_RESOLVE) def resolve_code_action(ls: CustomLanguageServer, params: lsp.CodeAction) -> lsp.CodeAction: if ls.service: - text_document: Final = ls.workspace.get_text_document(cast(str, params.data)) + text_document: Final = ls.workspace.get_text_document(cast("str", params.data)) params.edit = lsp.WorkspaceEdit( document_changes=[ lsp.TextDocumentEdit( diff --git a/auto_typing_final/main.py b/auto_typing_final/main.py index b8a0d5a..448bcb1 100644 --- a/auto_typing_final/main.py +++ b/auto_typing_final/main.py @@ -80,7 +80,7 @@ def main() -> int: file.write(transformed_content) file.truncate() - match changed_files_count, cast(bool, args.check): + match changed_files_count, cast("bool", args.check): case 0, _: result_message = "No errors found!" case 1, True: diff --git a/pyproject.toml b/pyproject.toml index 8d841f8..8d95c4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "auto-typing-final" description = "Automagically set typing.Final inside your functions" authors = [{ name = "Lev Vereshchagin", email = "mail@vrslev.com" }] -dependencies = ["ast-grep-py==0.39.5", "pygls==1.3.1"] +dependencies = ["ast-grep-py==0.39.6", "pygls==2.0.0"] requires-python = ">=3.10" readme = "README.md" license = { text = "MIT" } diff --git a/tests/conftest.py b/tests/conftest.py index 71edf75..c142530 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -9,12 +9,12 @@ @pytest.fixture(params=IMPORT_STYLES_TO_IMPORT_CONFIGS.values()) def import_config(request: pytest.FixtureRequest) -> ImportConfig: - return typing.cast(ImportConfig, request.param) + return typing.cast("ImportConfig", request.param) @pytest.fixture(params=[True, False]) def ignore_global_vars(request: pytest.FixtureRequest) -> bool: - return typing.cast(bool, request.param) + return typing.cast("bool", request.param) def parse_md_test_cases(file_name: str) -> list[str]: From cfd1207306ef7c983f50b4e27e2745df29b7ebec Mon Sep 17 00:00:00 2001 From: Lev Vereshchagin Date: Mon, 20 Oct 2025 15:28:31 +0300 Subject: [PATCH 2/2] Update --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8d95c4b..18c8e45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "auto-typing-final" description = "Automagically set typing.Final inside your functions" authors = [{ name = "Lev Vereshchagin", email = "mail@vrslev.com" }] -dependencies = ["ast-grep-py==0.39.6", "pygls==2.0.0"] +dependencies = ["ast-grep-py==0.39.6", "pygls==1.3.1"] requires-python = ">=3.10" readme = "README.md" license = { text = "MIT" }