From b947337bd1b1263d53f4cb37aa965f65098b51d5 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Wed, 2 Dec 2026 21:39:00 +0100 Subject: [PATCH] Remove `flake8-return` It crashes on Python 3.14 (`ast.NameConstant` is gone) and is unmaintained. `ruff` covers its rules. --- noxfile.py | 1 - pyproject.toml | 13 ++++--------- uv.lock | 14 -------------- 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/noxfile.py b/noxfile.py index 405d27c..fcc6f6c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -245,7 +245,6 @@ def lint_code(session: nox.Session) -> None: "flake8-pytest-style", "flake8-quotes", "flake8-raise", - "flake8-return", "flake8-sfs", "flake8-simplify", "flake8-tidy-imports", diff --git a/pyproject.toml b/pyproject.toml index 7a690fc..dc245dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,7 +113,6 @@ dev = [ "flake8-pytest-style (>=2.2.0,<3.0.0)", "flake8-quotes (>=3.4.0,<4.0.0)", "flake8-raise (>=0.0.5,<0.1.0)", - "flake8-return (>=1.2.0,<2.0.0)", "flake8-sfs (>=1.0.1,<2.0.0)", "flake8-simplify (>=0.31.1,<0.32.0)", "flake8-tidy-imports (>=4.12.0,<5.0.0)", @@ -258,8 +257,6 @@ select = [ "Q0", # flake8-raise => No parentheses for exceptions without arguments "R1", - # flake8-return => Consistent return statements - "R5", # flake8-sfs => Use f-strings as the only type of string formatting "SFS", # flake8-simplify => Simpler code @@ -309,6 +306,8 @@ select = [ # "PTH", # flake8-pyi (only two codes) => `t.Self` instead of the class name # "PYI019", "PYI034", + # flake8-return => Consistent return statements + # "RET", # Ruff-specific rules => Fewer bugs and cleaner code # "RUF", # flake8-self => No access to private members from outside @@ -341,10 +340,6 @@ extend-ignore = [ "PD005", # Let's not do `@pytest.mark.no_cover()` instead of `@pytest.mark.no_cover`. "PT023", - # `ruff`'s RET504 does this better, as it allows statements in between. - "R504", - # An `elif` after a `return` keeps a case distinction together. - "R505", # Allow f-strings as the only type of string formatting. "SFS301", # `bool()` around a comparison can be deliberate (`ruff` omits this rule). @@ -637,8 +632,6 @@ select = [ "PT", # flake8-quotes => Use double quotes everywhere "Q", - # flake8-return ("R5") => Consistent return statements - "RET", # flake8-raise ("R1") => No parentheses for exceptions without arguments "RSE", # flake8-bandit => Common security issues @@ -684,6 +677,8 @@ select = [ "PTH", # flake8-pyi (only two codes) => `t.Self` instead of the class name "PYI019", "PYI034", + # flake8-return => Consistent return statements + "RET", # Ruff-specific rules => Fewer bugs and cleaner code "RUF", # flake8-self => No access to private members from outside diff --git a/uv.lock b/uv.lock index 26143f1..a018d94 100644 --- a/uv.lock +++ b/uv.lock @@ -1129,18 +1129,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/da/b7/b8edb1ae5c517b8d3cd693129daab16282c5a4b4fc6ad4522cedc29eba61/flake8_raise-0.0.5-py3-none-any.whl", hash = "sha256:df26e5c542a58c8f8786d978e18ad7e54126a0ef5c6241c35dafaca7e2bbb808", size = 3694, upload-time = "2020-01-26T13:53:13.431Z" }, ] -[[package]] -name = "flake8-return" -version = "1.2.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "flake8-plugin-utils" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/83/49/43ee60c21b61fbec8e86858b2dac7d11a9bdd9958fd7f59077387b6a7197/flake8-return-1.2.0.tar.gz", hash = "sha256:68dfa56582cd704febd02ad86dcf5df67e38e0836d62f1ceae7930d76d3dd955", size = 10033, upload-time = "2022-10-28T09:37:12.507Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/f0/8c/6aece77ad2d0d68d8f6e8d5471fd06638de11df656db7d76de810815c437/flake8_return-1.2.0-py3-none-any.whl", hash = "sha256:1f07af12954ed03ebe2c2aac2418f78b55374e9929d4956109664588f31582a1", size = 10121, upload-time = "2022-10-28T09:37:14.468Z" }, -] - [[package]] name = "flake8-sfs" version = "1.0.1" @@ -4020,7 +4008,6 @@ dev = [ { name = "flake8-pytest-style" }, { name = "flake8-quotes" }, { name = "flake8-raise" }, - { name = "flake8-return" }, { name = "flake8-sfs" }, { name = "flake8-simplify" }, { name = "flake8-tidy-imports" }, @@ -4105,7 +4092,6 @@ dev = [ { name = "flake8-pytest-style", specifier = ">=2.2.0,<3.0.0" }, { name = "flake8-quotes", specifier = ">=3.4.0,<4.0.0" }, { name = "flake8-raise", specifier = ">=0.0.5,<0.1.0" }, - { name = "flake8-return", specifier = ">=1.2.0,<2.0.0" }, { name = "flake8-sfs", specifier = ">=1.0.1,<2.0.0" }, { name = "flake8-simplify", specifier = ">=0.31.1,<0.32.0" }, { name = "flake8-tidy-imports", specifier = ">=4.12.0,<5.0.0" },