From bdf915ca6f27f59df1af5a17af07e357d75a8b47 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Mon, 6 Feb 2023 02:57:00 +0000 Subject: [PATCH] Update pre-commit config - update from gitlab mirror for flake8 to latest - pre-commit autoupdate & updadup - remove dependency on importlib-metadata from flake8 hook - apply changes from fixers (black modified whitespace) After the above, flake8-bugbear was failing with B907. This is one of the opinionated warnings, and it's not fully accurate to the context of f-strings which are part of an external interface. As such, rather than make changes which could impact library consumers, suppress B907. --- .pre-commit-config.yaml | 14 +++++++------- setup.cfg | 2 +- tests/conftest.py | 1 - 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 103c30d..90c147c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,21 +1,21 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.31.0 + rev: v3.3.1 hooks: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/python/black - rev: 22.3.0 + rev: 23.1.0 hooks: - id: black language_version: python3 -- repo: https://gitlab.com/pycqa/flake8 - rev: 3.9.2 +- repo: https://github.com/pycqa/flake8 + rev: 6.0.0 hooks: - id: flake8 - additional_dependencies: [flake8-bugbear==22.1.11, importlib-metadata==4.12.0] + additional_dependencies: [flake8-bugbear==23.1.20] - repo: https://github.com/asottile/blacken-docs - rev: v1.12.1 + rev: 1.13.0 hooks: - id: blacken-docs - additional_dependencies: [black==22.3.0] + additional_dependencies: [black==23.1.0] diff --git a/setup.cfg b/setup.cfg index a313bf1..07f1427 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,7 @@ universal = 1 [flake8] -ignore = E203, E266, E501, W503 +ignore = E203, E266, E501, W503, B907 max-line-length = 110 max-complexity = 18 select = B,C,E,F,W,T4,B9 diff --git a/tests/conftest.py b/tests/conftest.py index da59458..1aa6d72 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -66,7 +66,6 @@ def book(id): @pytest.yield_fixture(scope="function") def app(): - ctx = _app.test_request_context() ctx.push()