From e95156259e1b3d6e96b483fbe871c901042a09d8 Mon Sep 17 00:00:00 2001 From: Sebastian Weigand Date: Sat, 11 Sep 2021 13:04:28 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Added=20more=20tools=20from=20th?= =?UTF-8?q?e=20'pygrep-hooks'=20pre-commit=20hook=20(#805)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 7 +++++++ glotaran/deprecation/deprecation_utils.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d2ce60384..7f1d4d407 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -134,6 +134,13 @@ repos: rev: v1.9.0 hooks: - id: rst-backticks + - id: python-check-blanket-noqa + exclude: "docs|tests?" + - id: python-check-blanket-type-ignore + exclude: "docs|tests?" + - id: python-use-type-annotations + - id: rst-directive-colons + - id: rst-inline-touching-normal - repo: https://github.com/codespell-project/codespell rev: v2.1.0 diff --git a/glotaran/deprecation/deprecation_utils.py b/glotaran/deprecation/deprecation_utils.py index d6547116b..69db4d88c 100644 --- a/glotaran/deprecation/deprecation_utils.py +++ b/glotaran/deprecation/deprecation_utils.py @@ -98,7 +98,7 @@ def parse_version(version_str: str) -> tuple[int, int, int]: if len(split_version) < 3: raise ValueError(error_message) try: - return tuple(map(int, split_version[:3])) # type:ignore [return-value] + return tuple(map(int, split_version[:3])) # type:ignore[return-value] except ValueError: raise ValueError(error_message) @@ -346,7 +346,7 @@ def outer_wrapper(deprecated_object: DecoratedCallable) -> DecoratedCallable: setattr( deprecated_object, "__new__", - inject_warn_into_call(deprecated_object.__new__), # type: ignore [arg-type] + inject_warn_into_call(deprecated_object.__new__), # type: ignore[arg-type] ) return deprecated_object # type: ignore[return-value]