From: Mike Bayer Date: Sun, 10 May 2026 15:30:00 +0000 (-0400) Subject: collect pep8 errors X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63b18fd13e73ee177b2179f946c07ecb13e51a45;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git collect pep8 errors run each command in a try/except (they print out error messages regardless) and report at the end on all individual runs. Change-Id: I347c04f5c49c69daadf9f5f9e7c6c488cdf27f35 (cherry picked from commit 3c650cede44e74b0a1939652034debc9fa74759c) --- diff --git a/noxfile.py b/noxfile.py index ccda69e37a..8dba5596a9 100644 --- a/noxfile.py +++ b/noxfile.py @@ -10,6 +10,7 @@ from typing import List from typing import Set import nox +from nox.command import CommandFailed if sys.version_info > (3, 12): nox.needs_version = ">=2025.10.16" @@ -373,6 +374,8 @@ def test_pep8(session: nox.Session) -> None: session.install(*nox.project.dependency_groups(pyproject, "lint")) + failed = [] + for cmd in [ "flake8p ./lib/ ./test/ ./examples/ noxfile.py " "setup.py doc/build/conf.py", @@ -391,5 +394,10 @@ def test_pep8(session: nox.Session) -> None: "python ./tools/normalize_file_headers.py --check", "python ./tools/walk_packages.py", ]: + try: + session.run(*cmd.split()) + except CommandFailed as err: + failed.append((cmd, err)) - session.run(*cmd.split()) + if failed: + session.error(f"failed with {len(failed)} errors")