diff --git a/noxfile.py b/noxfile.py index b1924fc..f003d9c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -191,6 +191,7 @@ def lint_code(session: nox.Session) -> None: # because otherwise it treats missing packages as `Any` ".", "flake8", + "flake8-2020", "flake8-annotations", "flake8-bandit", "flake8-black", diff --git a/pyproject.toml b/pyproject.toml index be75c51..9562345 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,6 +91,7 @@ dev = [ # Code Analyzers "flake8 (>=7.5.0,<8.0.0)", + "flake8-2020 (>=1.8.1,<2.0.0)", "flake8-annotations (>=3.3.1,<4.0.0)", "flake8-bandit (>=4.1.1,<5.0.0)", "flake8-black (>=0.5.0,<0.6.0)", @@ -212,6 +213,8 @@ select = [ # ======= # plugins # ======= + # flake8-2020 => Correct `sys.version` checks + "YTT", # flake8-annotations => Enforce type checking for functions "ANN0", "ANN2", "ANN3", # flake8-bandit => Common security issues @@ -584,6 +587,8 @@ select = [ "TID", # tryceratops => Clean exception handling "TRY", + # flake8-2020 => Correct `sys.version` checks + "YTT", # ======================================= # Violations not covered by `flake8` above # ======================================= diff --git a/uv.lock b/uv.lock index 670d7cd..b02ec76 100644 --- a/uv.lock +++ b/uv.lock @@ -884,6 +884,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/5d/57/a3adc5f380f50ef3d01014cb9d3b8c17b25de9b89def20d559def4fc3c4e/flake8-7.5.0-py2.py3-none-any.whl", hash = "sha256:637ea1a443a78ed6ee461725cdf71ca93bc5cde0abf25436dbebdc3880b4e078", size = 57487, upload-time = "2026-10-28T20:17:21.061Z" }, ] +[[package]] +name = "flake8-2020" +version = "1.8.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "flake8" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/cf/0b/e71a0d9efd854a631e2d51707676886997c73bec70c3c221b84601b976d2/flake8_2020-1.8.1.tar.gz", hash = "sha256:094ea95e8b614c3bd123fd4f007be28ec117ca57a6169903d4baaabe78e3e590", size = 4527, upload-time = "2023-06-10T19:05:11.43Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/36/f0/14c6c25768ddc81999733e7bed89e9285b273920505180155e351ed92dc5/flake8_2020-1.8.1-py2.py3-none-any.whl", hash = "sha256:59b6b8ac01cde10ef11b31a2c9aa15b4509d828ae115ee5be34464b9e4de4ea6", size = 4885, upload-time = "2023-06-10T19:05:09.965Z" }, +] + [[package]] name = "flake8-annotations" version = "3.3.1" @@ -3930,6 +3942,7 @@ dev = [ { name = "autoflake" }, { name = "black" }, { name = "flake8" }, + { name = "flake8-2020" }, { name = "flake8-annotations" }, { name = "flake8-bandit" }, { name = "flake8-black" }, @@ -4009,6 +4022,7 @@ dev = [ { name = "autoflake", specifier = ">=2.4.0,<3.0.0" }, { name = "black", specifier = ">=25.12.0,<26.0.0" }, { name = "flake8", specifier = ">=7.5.0,<8.0.0" }, + { name = "flake8-2020", specifier = ">=1.8.1,<2.0.0" }, { name = "flake8-annotations", specifier = ">=3.3.1,<4.0.0" }, { name = "flake8-bandit", specifier = ">=4.1.1,<5.0.0" }, { name = "flake8-black", specifier = ">=0.5.0,<0.6.0" },