From f266adad4575683c90dcf819894c3a7d6ae28a92 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Mon, 30 Nov 2026 21:40:43 +0100 Subject: [PATCH] Enable A in `flake8` and `ruff` --- docs/conf.py | 2 +- noxfile.py | 1 + pyproject.toml | 7 +++++++ uv.lock | 14 ++++++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 21bdfdb..674350a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -5,7 +5,7 @@ import velofy project = velofy.__pkg_name__ author = velofy.__author__ -copyright = f"2020, {author}" +project_copyright = f"2020, {author}" version = release = velofy.__version__ extensions = [ diff --git a/noxfile.py b/noxfile.py index 9d28d90..9b6fdff 100644 --- a/noxfile.py +++ b/noxfile.py @@ -196,6 +196,7 @@ def lint_code(session: nox.Session) -> None: "flake8-black", "flake8-broken-line", "flake8-bugbear", + "flake8-builtins", "flake8-commas", "flake8-comprehensions", "flake8-debugger", diff --git a/pyproject.toml b/pyproject.toml index 1fb560b..9353a20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,6 +96,7 @@ dev = [ "flake8-black (>=0.5.0,<0.6.0)", "flake8-broken-line (>=1.0.0,<2.0.0)", "flake8-bugbear (>=26.11.22,<27.0.0)", + "flake8-builtins (>=3.2.0,<4.0.0)", "flake8-commas (>=4.0.0,<5.0.0)", "flake8-comprehensions (>=3.17.0,<4.0.0)", "flake8-debugger (>=4.1.2,<5.0.0)", @@ -212,6 +213,8 @@ select = [ "N400", # flake8-bugbear => opinionated bugs and design flaws "B0", "B3", "B9", + # flake8-builtins => No shadowing of builtins + "A0", # flake8-commas => better comma placements "C8", # flake8-comprehensions => better comprehensions @@ -260,6 +263,8 @@ ignore = [] # If --ignore is passed on the command # line, still ignore the following: extend-ignore = [ + # `ruff`'s A003 does this better, as it only flags actual shadowing + "A003", # Too long line => duplicate with E501. "B950", # PEP 257 documents the arguments of `__init__()` in its own docstring. @@ -472,6 +477,8 @@ select = [ # =================================== # Violations also covered by `flake8` # =================================== + # flake8-builtins => No shadowing of builtins + "A", # flake8-annotations => enforce type checking for functions "ANN0", "ANN2", # flake8-unused-arguments ("U100") => declared function arguments must be used diff --git a/uv.lock b/uv.lock index 63e606b..3cd83de 100644 --- a/uv.lock +++ b/uv.lock @@ -947,6 +947,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/46/ba/da7d4108baed185aecfc0c8cc8e64b2964f92a1897d3310b79c168ac94d3/flake8_bugbear-26.11.22-py3-none-any.whl", hash = "sha256:bc10d62be1dc512dc7825ee34c20492425370b209e47fb09a1dedd29eba49aca", size = 65763, upload-time = "2026-11-22T14:25:51.217Z" }, ] +[[package]] +name = "flake8-builtins" +version = "3.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "flake8" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7c/b9/2e42d77e5afe26439eba3df47c9764a4db2d88595531dea587afc3f9b823/flake8_builtins-3.2.0.tar.gz", hash = "sha256:f0c4cee9028711349b7bf18e9a04282a613fd426e56af00bcd0c3bb61ae25481", size = 18444, upload-time = "2026-11-01T10:24:32.991Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b6/02/c7614f54d3fde51b8a20d91e14b012a01c78c2a481d36b5e8e40535a3d0b/flake8_builtins-3.2.0-py3-none-any.whl", hash = "sha256:192a00630f183b8e7b881e98def18aa20124581dde3a3e7be7a01a6effe3504b", size = 18757, upload-time = "2026-11-01T10:24:31.47Z" }, +] + [[package]] name = "flake8-commas" version = "4.0.0" @@ -3816,6 +3828,7 @@ dev = [ { name = "flake8-black" }, { name = "flake8-broken-line" }, { name = "flake8-bugbear" }, + { name = "flake8-builtins" }, { name = "flake8-commas" }, { name = "flake8-comprehensions" }, { name = "flake8-debugger" }, @@ -3885,6 +3898,7 @@ dev = [ { name = "flake8-black", specifier = ">=0.5.0,<0.6.0" }, { name = "flake8-broken-line", specifier = ">=1.0.0,<2.0.0" }, { name = "flake8-bugbear", specifier = ">=26.11.22,<27.0.0" }, + { name = "flake8-builtins", specifier = ">=3.2.0,<4.0.0" }, { name = "flake8-commas", specifier = ">=4.0.0,<5.0.0" }, { name = "flake8-comprehensions", specifier = ">=3.17.0,<4.0.0" }, { name = "flake8-debugger", specifier = ">=4.1.2,<5.0.0" },