From 86b3c15056b9e641aca9ce7f874e1bc66284a1cc Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Wed, 28 Feb 2024 21:32:52 +0900 Subject: [PATCH 1/2] pre-commit: enable flake8 plugins in yesqa Prevent yesqa from removing noqa markers needed for plugins. Signed-off-by: Benjamin Gilbert --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2f768d9..22fd8da 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,6 +37,7 @@ repos: rev: v1.5.0 hooks: - id: yesqa + additional_dependencies: [flake8-bugbear, Flake8-pyproject] - repo: https://github.com/PyCQA/flake8 rev: 6.1.0 From 96ea84b2bbbc585b1e836cf120b12c3435d669ed Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Wed, 28 Feb 2024 21:34:32 +0900 Subject: [PATCH 2/2] synctiles: silence spurious warning with current flake8-bugbear We aren't rethrowing the BaseException because we're returning it to a different thread instead. Signed-off-by: Benjamin Gilbert --- demo/_synctiles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/_synctiles.py b/demo/_synctiles.py index 84de885..e72b4f7 100755 --- a/demo/_synctiles.py +++ b/demo/_synctiles.py @@ -309,7 +309,7 @@ def sync(self) -> PurePath | BaseException: ContentType=f'image/{FORMAT}', ) return self.key_name - except BaseException as e: + except BaseException as e: # noqa: B036 return e @classmethod