Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-flake8 for openSUSE:Factory checked in at 2026-10-27 18:20:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-flake8 (Old) and /work/SRC/openSUSE:Factory/.python-flake8.new.2252680 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-flake8" Tue Oct 27 18:20:42 2026 rev:51 rq:1392675 version:7.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-flake8/python-flake8.changes 2025-08-20 13:24:53.703312954 +0200 +++ /work/SRC/openSUSE:Factory/.python-flake8.new.2252680/python-flake8.changes 2026-10-27 18:21:08.015051205 +0100 @@ -1,0 +2,10 @@ +Mon Oct 26 09:23:39 UTC 2026 - Dirk Müller <[email protected]> + +- update to 7.4.1: + * Fix ``--builtins`` (regressed in 7.4.0) + * Drop support for python 3.10 + * pycodestyle has been updated to >= 2.15.0, < 2.16.0 + * Pyflakes has been updated to >= 4.0.0, < 4.1.0 + * Added support for python 3.15 + +------------------------------------------------------------------- Old: ---- flake8-7.3.0.tar.gz New: ---- flake8-7.4.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-flake8.spec ++++++ --- /var/tmp/diff_new_pack.eY7upt/_old 2026-10-27 18:21:10.561157845 +0100 +++ /var/tmp/diff_new_pack.eY7upt/_new 2026-10-27 18:21:10.563157928 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-flake8 # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -23,7 +23,7 @@ %endif %{?sle15_python_module_pythons} Name: python-flake8 -Version: 7.3.0 +Version: 7.4.1 Release: 0 Summary: Modular source code checker: pep8, pyflakes and co License: MIT @@ -39,8 +39,8 @@ BuildRequires: python-rpm-macros # https://flake8.pycqa.org/en/latest/faq.html#why-does-flake8-use-ranges-for-its-dependencies Requires: (python-mccabe >= 0.7.0 with python-mccabe < 0.8.0) -Requires: (python-pycodestyle >= 2.14.0 with python-pycodestyle < 2.15.0) -Requires: (python-pyflakes >= 3.4.0 with python-pyflakes < 3.5.0) +Requires: (python-pycodestyle >= 2.15.0 with python-pycodestyle < 2.16.0) +Requires: (python-pyflakes >= 4.0.0 with python-pyflakes < 4.1.0) %if %{with libalternatives} BuildRequires: alts Requires: alts @@ -51,8 +51,8 @@ BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module mccabe >= 0.7.0 with %python-mccabe < 0.8.0} -BuildRequires: %{python_module pycodestyle >= 2.14.0 with %python-pycodestyle < 2.15.0} -BuildRequires: %{python_module pyflakes >= 3.4.0 with %python-pyflakes < 3.5.0} +BuildRequires: %{python_module pycodestyle >= 2.15.0 with %python-pycodestyle < 2.16.0} +BuildRequires: %{python_module pyflakes >= 4.0.0 with %python-pyflakes < 4.1.0} BuildRequires: %{python_module pytest} # /SECTION %python_subpackages ++++++ flake8-7.3.0.tar.gz -> flake8-7.4.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/.github/workflows/main.yml new/flake8-7.4.1/.github/workflows/main.yml --- old/flake8-7.3.0/.github/workflows/main.yml 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/.github/workflows/main.yml 2026-09-23 14:21:04.000000000 +0200 @@ -13,10 +13,7 @@ include: # linux - os: ubuntu-latest - python: pypy-3.9 - toxenv: py - - os: ubuntu-latest - python: 3.9 + python: pypy-3.11 toxenv: py - os: ubuntu-latest python: '3.10' @@ -30,9 +27,15 @@ - os: ubuntu-latest python: '3.13' toxenv: py + - os: ubuntu-latest + python: '3.14' + toxenv: py + - os: ubuntu-latest + python: '3.15-dev' + toxenv: py # windows - os: windows-latest - python: 3.9 + python: '3.10' toxenv: py # misc - os: ubuntu-latest @@ -46,8 +49,8 @@ toxenv: dogfood runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - run: python -mpip install --upgrade setuptools pip tox virtualenv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/.pre-commit-config.yaml new/flake8-7.4.1/.pre-commit-config.yaml --- old/flake8-7.3.0/.pre-commit-config.yaml 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/.pre-commit-config.yaml 2026-09-23 14:21:04.000000000 +0200 @@ -1,6 +1,10 @@ repos: +- repo: https://github.com/asottile/add-trailing-comma + rev: v4.0.0 + hooks: + - id: add-trailing-comma - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v6.0.0 hooks: - id: check-yaml - id: debug-statements @@ -8,34 +12,33 @@ - id: trailing-whitespace exclude: ^tests/fixtures/ - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.5.0 + rev: v3.2.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder-python-imports - rev: v3.14.0 + rev: v3.17.0 hooks: - id: reorder-python-imports args: [ --application-directories, '.:src', - --py39-plus, + --py310-plus, --add-import, 'from __future__ import annotations', ] - repo: https://github.com/asottile/pyupgrade - rev: v3.19.1 + rev: v3.21.2 hooks: - id: pyupgrade - args: [--py39-plus] -- repo: https://github.com/psf/black - rev: 23.12.1 + args: [--py310-plus] +- repo: https://github.com/hhatto/autopep8 + rev: v2.3.2 hooks: - - id: black - args: [--line-length=79] + - id: autopep8 - repo: https://github.com/PyCQA/flake8 - rev: 7.0.0 + rev: 7.3.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.15.0 + rev: v2.3.1 hooks: - id: mypy exclude: ^(docs/|example-plugin/) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/bin/gen-pycodestyle-plugin new/flake8-7.4.1/bin/gen-pycodestyle-plugin --- old/flake8-7.3.0/bin/gen-pycodestyle-plugin 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/bin/gen-pycodestyle-plugin 2026-09-23 14:21:04.000000000 +0200 @@ -3,9 +3,9 @@ import inspect import os.path +from collections.abc import Callable from collections.abc import Generator from typing import Any -from typing import Callable from typing import NamedTuple import pycodestyle diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/docs/source/release-notes/7.4.0.rst new/flake8-7.4.1/docs/source/release-notes/7.4.0.rst --- old/flake8-7.3.0/docs/source/release-notes/7.4.0.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/flake8-7.4.1/docs/source/release-notes/7.4.0.rst 2026-09-23 14:21:04.000000000 +0200 @@ -0,0 +1,16 @@ +7.4.0 -- 2026-09-22 +------------------- + +You can view the `7.4.0 milestone`_ on GitHub for more details. + +New Dependency Information +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- Drop support for python 3.10 (See also :pull:`2001`). +- pycodestyle has been updated to >= 2.15.0, < 2.16.0 (See also :pull:`2053`). +- Pyflakes has been updated to >= 4.0.0, < 4.1.0 (See also :pull:`2054`). +- Added support for python 3.15 (See also :pull:`2055`). + +.. all links +.. _7.4.0 milestone: + https://github.com/PyCQA/flake8/milestone/55 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/docs/source/release-notes/7.4.1.rst new/flake8-7.4.1/docs/source/release-notes/7.4.1.rst --- old/flake8-7.3.0/docs/source/release-notes/7.4.1.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/flake8-7.4.1/docs/source/release-notes/7.4.1.rst 2026-09-23 14:21:04.000000000 +0200 @@ -0,0 +1,14 @@ +7.4.1 -- 2026-09-23 +------------------- + +You can view the `7.4.1 milestone`_ on GitHub for more details. + +New Dependency Information +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- Fix ``--builtins`` (regressed in 7.4.0) (See also :pull:`2057`, + :issue:`2056`). + +.. all links +.. _7.4.1 milestone: + https://github.com/PyCQA/flake8/milestone/56 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/docs/source/release-notes/index.rst new/flake8-7.4.1/docs/source/release-notes/index.rst --- old/flake8-7.3.0/docs/source/release-notes/index.rst 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/docs/source/release-notes/index.rst 2026-09-23 14:21:04.000000000 +0200 @@ -9,6 +9,8 @@ ================== .. toctree:: + 7.4.1 + 7.4.0 7.3.0 7.2.0 7.1.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/docs/source/user/error-codes.rst new/flake8-7.4.1/docs/source/user/error-codes.rst --- old/flake8-7.3.0/docs/source/user/error-codes.rst 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/docs/source/user/error-codes.rst 2026-09-23 14:21:04.000000000 +0200 @@ -89,12 +89,14 @@ +------+---------------------------------------------------------------------+ | F707 | an ``except:`` block as not the last exception handler | +------+---------------------------------------------------------------------+ +| F708 | ``lazy`` import must be at module scope | ++------+---------------------------------------------------------------------+ +| F709 | ``lazy from ... import *`` is not allowed | ++------+---------------------------------------------------------------------+ | F721 | syntax error in doctest | +------+---------------------------------------------------------------------+ | F722 | syntax error in forward annotation | +------+---------------------------------------------------------------------+ -| F723 | syntax error in type comment | -+------+---------------------------------------------------------------------+ +------+---------------------------------------------------------------------+ | F811 | redefinition of unused ``name`` from line ``N`` | +------+---------------------------------------------------------------------+ @@ -111,6 +113,10 @@ +------+---------------------------------------------------------------------+ | F841 | local variable ``name`` is assigned to but never used | +------+---------------------------------------------------------------------+ +| F842 | local variable ``name`` is annotated but never used | ++------+---------------------------------------------------------------------+ +| F851 | eager use of lazily imported ``name`` from line ``N`` | ++------+---------------------------------------------------------------------+ +------+---------------------------------------------------------------------+ | F901 | ``raise NotImplemented`` should be ``raise NotImplementedError`` | +------+---------------------------------------------------------------------+ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/setup.cfg new/flake8-7.4.1/setup.cfg --- old/flake8-7.3.0/setup.cfg 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/setup.cfg 2026-09-23 14:21:04.000000000 +0200 @@ -16,7 +16,6 @@ Environment :: Console Framework :: Flake8 Intended Audience :: Developers - License :: OSI Approved :: MIT License Programming Language :: Python Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only @@ -29,9 +28,9 @@ packages = find: install_requires = mccabe>=0.7.0,<0.8.0 - pycodestyle>=2.14.0,<2.15.0 - pyflakes>=3.4.0,<3.5.0 -python_requires = >=3.9 + pycodestyle>=2.15.0,<2.16.0 + pyflakes>=4.0.0,<4.1.0 +python_requires = >=3.10 package_dir = =src diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/__init__.py new/flake8-7.4.1/src/flake8/__init__.py --- old/flake8-7.3.0/src/flake8/__init__.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/__init__.py 2026-09-23 14:21:04.000000000 +0200 @@ -17,7 +17,7 @@ LOG = logging.getLogger(__name__) LOG.addHandler(logging.NullHandler()) -__version__ = "7.3.0" +__version__ = "7.4.1" __version_info__ = tuple(int(i) for i in __version__.split(".") if i.isdigit()) _VERBOSITY_TO_LOG_LEVEL = { @@ -66,5 +66,5 @@ LOG.addHandler(handler) LOG.setLevel(log_level) LOG.debug( - "Added a %s logging handler to logger root at %s", filename, __name__ + "Added a %s logging handler to logger root at %s", filename, __name__, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/api/legacy.py new/flake8-7.4.1/src/flake8/api/legacy.py --- old/flake8-7.3.0/src/flake8/api/legacy.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/api/legacy.py 2026-09-23 14:21:04.000000000 +0200 @@ -135,7 +135,7 @@ stdin_display_name=self.options.stdin_display_name, filename_patterns=self.options.filename, exclude=self.options.exclude, - ) + ), ) return not paths @@ -153,7 +153,7 @@ if not issubclass(reporter, formatter.BaseFormatter): raise ValueError( "Report should be subclass of " - "flake8.formatter.BaseFormatter." + "flake8.formatter.BaseFormatter.", ) self._application.formatter = reporter(self.options) self._application.guide = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/checker.py new/flake8-7.4.1/src/flake8/checker.py --- old/flake8-7.3.0/src/flake8/checker.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/checker.py 2026-09-23 14:21:04.000000000 +0200 @@ -45,40 +45,39 @@ # noise in diffs. } -_mp_plugins: Checkers -_mp_options: argparse.Namespace +_mp: tuple[Checkers, argparse.Namespace] | None = None @contextlib.contextmanager def _mp_prefork( - plugins: Checkers, options: argparse.Namespace + plugins: Checkers, options: argparse.Namespace, ) -> Generator[None]: # we can save significant startup work w/ `fork` multiprocessing - global _mp_plugins, _mp_options - _mp_plugins, _mp_options = plugins, options + global _mp + _mp = plugins, options try: yield finally: - del _mp_plugins, _mp_options + _mp = None def _mp_init(argv: Sequence[str]) -> None: - global _mp_plugins, _mp_options + global _mp # Ensure correct signaling of ^C using multiprocessing.Pool. signal.signal(signal.SIGINT, signal.SIG_IGN) - try: - # for `fork` this'll already be set - _mp_plugins, _mp_options # noqa: B018 - except NameError: + # for `fork` this'll already be set + if _mp is None: plugins, options = parse_args(argv) - _mp_plugins, _mp_options = plugins.checkers, options + _mp = plugins.checkers, options def _mp_run(filename: str) -> tuple[str, Results, dict[str, int]]: + assert _mp is not None, _mp + plugins, options = _mp return FileChecker( - filename=filename, plugins=_mp_plugins, options=_mp_options + filename=filename, plugins=plugins, options=options, ).run_checks() @@ -138,7 +137,7 @@ if utils.is_using_stdin(self.options.filenames): LOG.warning( "The --jobs option is not compatible with supplying " - "input using - . Ignoring --jobs arguments." + "input using - . Ignoring --jobs arguments.", ) return 0 @@ -253,7 +252,7 @@ stdin_display_name=self.options.stdin_display_name, filename_patterns=self.options.filename, exclude=self.exclude, - ) + ), ) self.jobs = min(len(self.filenames), self.jobs) @@ -333,11 +332,11 @@ assert self.processor is not None, self.filename try: params = self.processor.keyword_arguments_for( - plugin.parameters, arguments + plugin.parameters, arguments, ) except AttributeError as ae: raise exceptions.PluginRequestedUnknownParameters( - plugin_name=plugin.display_name, exception=ae + plugin_name=plugin.display_name, exception=ae, ) try: return plugin.obj(**arguments, **params) @@ -373,43 +372,6 @@ token = () row, column = (1, 0) - if ( - column > 0 - and token - and isinstance(exception, SyntaxError) - and len(token) == 4 # Python 3.9 or earlier - ): - # NOTE(sigmavirus24): SyntaxErrors report 1-indexed column - # numbers. We need to decrement the column number by 1 at - # least. - column_offset = 1 - row_offset = 0 - # See also: https://github.com/pycqa/flake8/issues/169, - # https://github.com/PyCQA/flake8/issues/1372 - # On Python 3.9 and earlier, token will be a 4-item tuple with the - # last item being the string. Starting with 3.10, they added to - # the tuple so now instead of it ending with the code that failed - # to parse, it ends with the end of the section of code that - # failed to parse. Luckily the absolute position in the tuple is - # stable across versions so we can use that here - physical_line = token[3] - - # NOTE(sigmavirus24): Not all "tokens" have a string as the last - # argument. In this event, let's skip trying to find the correct - # column and row values. - if physical_line is not None: - # NOTE(sigmavirus24): SyntaxErrors also don't exactly have a - # "physical" line so much as what was accumulated by the point - # tokenizing failed. - # See also: https://github.com/pycqa/flake8/issues/169 - lines = physical_line.rstrip("\n").split("\n") - row_offset = len(lines) - 1 - logical_line = lines[0] - logical_line_length = len(logical_line) - if column > logical_line_length: - column = logical_line_length - row -= row_offset - column -= column_offset return row, column def run_ast_checks(self) -> None: @@ -549,7 +511,7 @@ self.run_logical_checks() def check_physical_eol( - self, token: tokenize.TokenInfo, prev_physical: str + self, token: tokenize.TokenInfo, prev_physical: str, ) -> None: """Run physical checks if and only if it is at the end of the line.""" assert self.processor is not None @@ -599,7 +561,7 @@ def find_offset( - offset: int, mapping: processor._LogicalMapping + offset: int, mapping: processor._LogicalMapping, ) -> tuple[int, int]: """Find the offset tuple for a single offset.""" if isinstance(offset, tuple): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/discover_files.py new/flake8-7.4.1/src/flake8/discover_files.py --- old/flake8-7.3.0/src/flake8/discover_files.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/discover_files.py 2026-09-23 14:21:04.000000000 +0200 @@ -3,9 +3,9 @@ import logging import os.path +from collections.abc import Callable from collections.abc import Generator from collections.abc import Sequence -from typing import Callable from flake8 import utils diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/formatting/base.py new/flake8-7.4.1/src/flake8/formatting/base.py --- old/flake8-7.3.0/src/flake8/formatting/base.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/formatting/base.py 2026-09-23 14:21:04.000000000 +0200 @@ -110,7 +110,7 @@ The formatted error string. """ raise NotImplementedError( - "Subclass of BaseFormatter did not implement" " format." + "Subclass of BaseFormatter did not implement" " format.", ) def show_statistics(self, statistics: Statistics) -> None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/main/application.py new/flake8-7.4.1/src/flake8/main/application.py --- old/flake8-7.3.0/src/flake8/main/application.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/main/application.py 2026-09-23 14:21:04.000000000 +0200 @@ -76,7 +76,7 @@ assert self.formatter is not None assert self.options is not None self.guide = style_guide.StyleGuideManager( - self.options, self.formatter + self.options, self.formatter, ) def make_file_checker_manager(self, argv: Sequence[str]) -> None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/main/debug.py new/flake8-7.4.1/src/flake8/main/debug.py --- old/flake8-7.3.0/src/flake8/main/debug.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/main/debug.py 2026-09-23 14:21:04.000000000 +0200 @@ -14,7 +14,7 @@ (loaded.plugin.package, loaded.plugin.version) for loaded in plugins.all_plugins() if loaded.plugin.package not in {"flake8", "local"} - } + }, ) return { "version": version, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/main/options.py new/flake8-7.4.1/src/flake8/main/options.py --- old/flake8-7.3.0/src/flake8/main/options.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/main/options.py 2026-09-23 14:21:04.000000000 +0200 @@ -32,7 +32,7 @@ ) parser.add_argument( - "--output-file", default=None, help="Redirect report to a file." + "--output-file", default=None, help="Redirect report to a file.", ) # Config file options diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/options/config.py new/flake8-7.4.1/src/flake8/options/config.py --- old/flake8-7.3.0/src/flake8/options/config.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/options/config.py 2026-09-23 14:21:04.000000000 +0200 @@ -78,7 +78,7 @@ if config is not None: if not cfg.read(config, encoding="UTF-8"): raise exceptions.ExecutionError( - f"The specified config file does not exist: {config}" + f"The specified config file does not exist: {config}", ) cfg_dir = os.path.dirname(config) else: @@ -89,7 +89,7 @@ for filename in extra: if not cfg.read(filename, encoding="UTF-8"): raise exceptions.ExecutionError( - f"The specified config file does not exist: {filename}" + f"The specified config file does not exist: {filename}", ) return cfg, cfg_dir @@ -131,7 +131,7 @@ raise ValueError( f"Error code {error_code!r} " f"supplied to {option_name!r} option " - f"does not match {VALID_CODE_PREFIX.pattern!r}" + f"does not match {VALID_CODE_PREFIX.pattern!r}", ) assert option.config_name is not None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/options/manager.py new/flake8-7.4.1/src/flake8/options/manager.py --- old/flake8-7.3.0/src/flake8/options/manager.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/options/manager.py 2026-09-23 14:21:04.000000000 +0200 @@ -5,9 +5,9 @@ import enum import functools import logging +from collections.abc import Callable from collections.abc import Sequence from typing import Any -from typing import Callable from flake8 import utils from flake8.plugins.finder import Plugins @@ -165,7 +165,7 @@ if long_option_name is _ARG.NO: raise ValueError( "When specifying parse_from_config=True, " - "a long_option_name must also be specified." + "a long_option_name must also be specified.", ) self.config_name = long_option_name[2:].replace("-", "_") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/plugins/finder.py new/flake8-7.4.1/src/flake8/plugins/finder.py --- old/flake8-7.3.0/src/flake8/plugins/finder.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/plugins/finder.py 2026-09-23 14:21:04.000000000 +0200 @@ -83,8 +83,8 @@ f"{loaded.plugin.package}: {loaded.plugin.version}" for loaded in self.all_plugins() if loaded.plugin.package not in {"flake8", "local"} - } - ) + }, + ), ) @@ -167,7 +167,7 @@ # ideally pycodestyle's plugin entrypoints would exactly represent # the codes they produce... yield Plugin( - pycodestyle_meta["name"], pycodestyle_meta["version"], ep + pycodestyle_meta["name"], pycodestyle_meta["version"], ep, ) else: yield Plugin(name, version, ep) @@ -240,7 +240,7 @@ f"required plugins were not installed!\n" f"- installed: {', '.join(sorted(plugin_names))}\n" f"- expected: {', '.join(sorted(expected_names))}\n" - f"- missing: {', '.join(sorted(missing_plugins))}" + f"- missing: {', '.join(sorted(missing_plugins))}", ) @@ -338,7 +338,7 @@ if not VALID_CODE_PREFIX.match(loaded.entry_name): raise ExecutionError( f"plugin code for `{loaded.display_name}` does not match " - f"{VALID_CODE_PREFIX.pattern}" + f"{VALID_CODE_PREFIX.pattern}", ) return Plugins( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/plugins/pyflakes.py new/flake8-7.4.1/src/flake8/plugins/pyflakes.py --- old/flake8-7.3.0/src/flake8/plugins/pyflakes.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/plugins/pyflakes.py 2026-09-23 14:21:04.000000000 +0200 @@ -50,6 +50,8 @@ "YieldOutsideFunction": "F704", "ReturnOutsideFunction": "F706", "DefaultExceptNotLast": "F707", + "LazyImportNotAtModuleScope": "F708", + "LazyImportStarNotPermitted": "F709", "DoctestSyntaxError": "F721", "ForwardAnnotationSyntaxError": "F722", "RedefinedWhileUnused": "F811", @@ -60,21 +62,40 @@ "DuplicateArgument": "F831", "UnusedVariable": "F841", "UnusedAnnotation": "F842", + "EagerUseOfLazyImport": "F851", "RaiseNotImplemented": "F901", } -class FlakesChecker(pyflakes.checker.Checker): +class FlakesChecker: """Subclass the Pyflakes checker to conform with the flake8 API.""" - with_doctest = False + _with_doctest = False + _builtins = None def __init__(self, tree: ast.AST, filename: str) -> None: """Initialize the PyFlakes plugin with an AST tree and filename.""" - super().__init__( - tree, filename=filename, withDoctest=self.with_doctest + self._checker = pyflakes.checker.Checker( + tree, + filename=filename, + builtins=self._builtins, + withDoctest=self._with_doctest, ) + def run(self) -> Generator[tuple[int, int, str, type[Any]]]: + """Run the plugin.""" + for message in self._checker.messages: + col = getattr(message, "col", 0) + yield ( + message.lineno, + col, + "{} {}".format( + FLAKE8_PYFLAKES_CODES.get(type(message).__name__, "F999"), + message.message % message.message_args, + ), + message.__class__, + ) + @classmethod def add_options(cls, parser: OptionManager) -> None: """Register options for PyFlakes on the Flake8 OptionManager.""" @@ -95,20 +116,5 @@ @classmethod def parse_options(cls, options: argparse.Namespace) -> None: """Parse option values from Flake8's OptionManager.""" - if options.builtins: - cls.builtIns = cls.builtIns.union(options.builtins) - cls.with_doctest = options.doctests - - def run(self) -> Generator[tuple[int, int, str, type[Any]]]: - """Run the plugin.""" - for message in self.messages: - col = getattr(message, "col", 0) - yield ( - message.lineno, - col, - "{} {}".format( - FLAKE8_PYFLAKES_CODES.get(type(message).__name__, "F999"), - message.message % message.message_args, - ), - message.__class__, - ) + cls._builtins = options.builtins + cls._with_doctest = options.doctests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/processor.py new/flake8-7.4.1/src/flake8/processor.py --- old/flake8-7.3.0/src/flake8/processor.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/processor.py 2026-09-23 14:21:04.000000000 +0200 @@ -21,7 +21,7 @@ NEWLINE = frozenset([tokenize.NL, tokenize.NEWLINE]) SKIP_TOKENS = frozenset( - [tokenize.NL, tokenize.NEWLINE, tokenize.INDENT, tokenize.DEDENT] + [tokenize.NL, tokenize.NEWLINE, tokenize.INDENT, tokenize.DEDENT], ) _LogicalMapping = list[tuple[int, tuple[int, int]]] @@ -173,7 +173,7 @@ """Update the checker_state attribute for the plugin.""" if "checker_state" in plugin.parameters: self.checker_state = self._checker_states.setdefault( - plugin.entry_name, {} + plugin.entry_name, {}, ) def next_logical_line(self) -> None: @@ -280,7 +280,7 @@ def _noqa_line_range(self, min_line: int, max_line: int) -> dict[int, str]: line_range = range(min_line, max_line + 1) - joined = "".join(self.lines[min_line - 1 : max_line]) + joined = "".join(self.lines[min_line - 1: max_line]) return dict.fromkeys(line_range, joined) @functools.cached_property @@ -367,7 +367,7 @@ elif any(defaults.NOQA_FILE.search(line) for line in self.lines): LOG.warning( "Detected `flake8: noqa` on line with code. To ignore an " - "error on a line use `noqa` instead." + "error on a line use `noqa` instead.", ) return False else: @@ -388,7 +388,7 @@ def is_eol_token(token: tokenize.TokenInfo) -> bool: """Check if the token is an end-of-line token.""" - return token[0] in NEWLINE or token[4][token[3][1] :].lstrip() == "\\\n" + return token[0] in NEWLINE or token[4][token[3][1]:].lstrip() == "\\\n" def is_multiline_string(token: tokenize.TokenInfo) -> bool: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/statistics.py new/flake8-7.4.1/src/flake8/statistics.py --- old/flake8-7.3.0/src/flake8/statistics.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/statistics.py 2026-09-23 14:21:04.000000000 +0200 @@ -35,7 +35,7 @@ self._store[key].increment() def statistics_for( - self, prefix: str, filename: str | None = None + self, prefix: str, filename: str | None = None, ) -> Generator[Statistic]: """Generate statistics for the prefix and filename. @@ -108,7 +108,7 @@ """ def __init__( - self, error_code: str, filename: str, message: str, count: int + self, error_code: str, filename: str, message: str, count: int, ) -> None: """Initialize our Statistic.""" self.error_code = error_code diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/style_guide.py new/flake8-7.4.1/src/flake8/style_guide.py --- old/flake8-7.3.0/src/flake8/style_guide.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/style_guide.py 2026-09-23 14:21:04.000000000 +0200 @@ -218,7 +218,7 @@ self.decider = decider or DecisionEngine(options) self.style_guides: list[StyleGuide] = [] self.default_style_guide = StyleGuide( - options, formatter, self.stats, decider=decider + options, formatter, self.stats, decider=decider, ) self.style_guides = [ self.default_style_guide, @@ -228,7 +228,7 @@ self.style_guide_for = functools.cache(self._style_guide_for) def populate_style_guides_with( - self, options: argparse.Namespace + self, options: argparse.Namespace, ) -> Generator[StyleGuide]: """Generate style guides from the per-file-ignores option. @@ -240,7 +240,7 @@ per_file = utils.parse_files_to_codes_mapping(options.per_file_ignores) for filename, violations in per_file: yield self.default_style_guide.copy( - filename=filename, extend_ignore_with=violations + filename=filename, extend_ignore_with=violations, ) def _style_guide_for(self, filename: str) -> StyleGuide: @@ -288,7 +288,7 @@ """ guide = self.style_guide_for(filename) return guide.handle_error( - code, filename, line_number, column_number, text, physical_line + code, filename, line_number, column_number, text, physical_line, ) @@ -330,7 +330,7 @@ options.extend_ignore = options.extend_ignore or [] options.extend_ignore.extend(extend_ignore_with or []) return StyleGuide( - options, self.formatter, self.stats, filename=filename + options, self.formatter, self.stats, filename=filename, ) @contextlib.contextmanager diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/utils.py new/flake8-7.4.1/src/flake8/utils.py --- old/flake8-7.3.0/src/flake8/utils.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/utils.py 2026-09-23 14:21:04.000000000 +0200 @@ -23,7 +23,7 @@ def parse_comma_separated_list( - value: str, regexp: Pattern[str] = COMMA_SEPARATED_LIST_RE + value: str, regexp: Pattern[str] = COMMA_SEPARATED_LIST_RE, ) -> list[str]: """Parse a comma-separated list. @@ -115,7 +115,7 @@ f"Expected `per-file-ignores` to be a mapping from file exclude " f"patterns to ignore codes.\n\n" f"Configured `per-file-ignores` setting:\n\n" - f"{textwrap.indent(value.strip(), ' ')}" + f"{textwrap.indent(value.strip(), ' ')}", ) for token in _tokenize_files_to_codes_mapping(value): @@ -150,7 +150,7 @@ def normalize_paths( - paths: Sequence[str], parent: str = os.curdir + paths: Sequence[str], parent: str = os.curdir, ) -> list[str]: """Normalize a list of paths relative to a parent directory. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/src/flake8/violation.py new/flake8-7.4.1/src/flake8/violation.py --- old/flake8-7.3.0/src/flake8/violation.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/src/flake8/violation.py 2026-09-23 14:21:04.000000000 +0200 @@ -64,6 +64,6 @@ return True LOG.debug( - "%r is not ignored inline with ``# noqa: %s``", self, codes_str + "%r is not ignored inline with ``# noqa: %s``", self, codes_str, ) return False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/integration/plugins/test_pyflakes.py new/flake8-7.4.1/tests/integration/plugins/test_pyflakes.py --- old/flake8-7.3.0/tests/integration/plugins/test_pyflakes.py 1970-01-01 01:00:00.000000000 +0100 +++ new/flake8-7.4.1/tests/integration/plugins/test_pyflakes.py 2026-09-23 14:21:04.000000000 +0200 @@ -0,0 +1,19 @@ +from __future__ import annotations + +from flake8.main.cli import main + + +def test_pyflakes_builtins(tmpdir, capsys): + t_py = tmpdir.join('t.py') + t_py.write('print(b)\n') + + expected = "t.py:1:7: F821 undefined name 'b'\n" + with tmpdir.as_cwd(): + ret = main(('t.py',)) + out, err = capsys.readouterr() + assert (ret, out, err) == (1, expected, '') + + with tmpdir.as_cwd(): + ret = main(('t.py', '--builtins', 'b')) + out, err = capsys.readouterr() + assert (ret, out, err) == (0, '', '') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/integration/test_checker.py new/flake8-7.4.1/tests/integration/test_checker.py --- old/flake8-7.3.0/tests/integration/test_checker.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/integration/test_checker.py 2026-09-23 14:21:04.000000000 +0200 @@ -2,7 +2,6 @@ from __future__ import annotations import importlib.metadata -import sys from unittest import mock import pytest @@ -97,7 +96,7 @@ # Prevent it from reading lines from stdin or somewhere else with mock.patch( - "flake8.processor.FileProcessor.read_lines", return_value=["Line 1"] + "flake8.processor.FileProcessor.read_lines", return_value=["Line 1"], ): file_checker = checker.FileChecker( filename="-", @@ -322,17 +321,10 @@ We need to handle that correctly to avoid crashing. https://github.com/PyCQA/flake8/issues/1372 """ - if sys.version_info < (3, 10): # pragma: no cover (<3.10) - # Python 3.9 or older - err = SyntaxError( - "invalid syntax", ("<unknown>", 2, 5, "bad python:\n") - ) - expected = (2, 4) - else: # pragma: no cover (3.10+) - err = SyntaxError( - "invalid syntax", ("<unknown>", 2, 1, "bad python:\n", 2, 11) - ) - expected = (2, 1) + err = SyntaxError( + "invalid syntax", ("<unknown>", 2, 1, "bad python:\n", 2, 11), + ) + expected = (2, 1) file_checker = checker.FileChecker( filename="-", plugins=finder.Checkers([], [], []), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/integration/test_main.py new/flake8-7.4.1/tests/integration/test_main.py --- old/flake8-7.3.0/tests/integration/test_main.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/integration/test_main.py 2026-09-23 14:21:04.000000000 +0200 @@ -168,10 +168,8 @@ tmpdir.join("t.py").write("b'foo' \\\n") assert cli.main(["t.py"]) == 1 - if hasattr(sys, "pypy_version_info"): # pragma: no cover (pypy) - expected = "t.py:2:1: E999 SyntaxError: end of file (EOF) in multi-line statement\n" # noqa: E501 - elif sys.version_info < (3, 10): # pragma: no cover (cp38+) - expected = "t.py:1:8: E999 SyntaxError: unexpected EOF while parsing\n" + if sys.implementation.name == "pypy": # pragma: no cover (pypy) + expected = "t.py:1:9: E999 SyntaxError: unexpected end of file (EOF) in multi-line statement\n" # noqa: E501 else: # pragma: no cover (cp310+) expected = "t.py:1:10: E999 SyntaxError: unexpected EOF while parsing\n" # noqa: E501 @@ -186,10 +184,8 @@ tmpdir.join("t.py").write("if True:\n pass\n pass\n") assert cli.main(["t.py"]) == 1 - if hasattr(sys, "pypy_version_info"): # pragma: no cover (pypy) - expected = "t.py:3:2: E999 IndentationError: unindent does not match any outer indentation level\n" # noqa: E501 - elif sys.version_info < (3, 10): # pragma: no cover (<cp310) - expected = "t.py:3:5: E999 IndentationError: unindent does not match any outer indentation level\n" # noqa: E501 + if sys.implementation.name == "pypy": # pragma: no cover (pypy) + expected = "t.py:3:3: E999 IndentationError: unindent does not match any outer indentation level\n" # noqa: E501 else: # pragma: no cover (cp310+) expected = "t.py:3:7: E999 IndentationError: unindent does not match any outer indentation level\n" # noqa: E501 @@ -314,7 +310,7 @@ """\ [flake8] ignore = F401 -""" +""", ) py_file = tmp_path / "t.py" @@ -330,7 +326,7 @@ """\ [flake8] ignore = F401 -""" +""", ) py_file = tmp_path / "t.py" @@ -364,7 +360,7 @@ def test_early_keyboard_interrupt_does_not_crash(capsys): with mock.patch.object( - config, "load_config", side_effect=KeyboardInterrupt + config, "load_config", side_effect=KeyboardInterrupt, ): assert cli.main(["does-not-exist"]) == 1 out, err = capsys.readouterr() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/integration/test_plugins.py new/flake8-7.4.1/tests/integration/test_plugins.py --- old/flake8-7.3.0/tests/integration/test_plugins.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/integration/test_plugins.py 2026-09-23 14:21:04.000000000 +0200 @@ -86,7 +86,7 @@ stage1_args, rest = stage1_parser.parse_known_args(argv) cfg, cfg_dir = config.load_config( - config=stage1_args.config, extra=[], isolated=False + config=stage1_args.config, extra=[], isolated=False, ) opts = finder.parse_plugin_options( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/unit/plugins/finder_test.py new/flake8-7.4.1/tests/unit/plugins/finder_test.py --- old/flake8-7.3.0/tests/unit/plugins/finder_test.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/unit/plugins/finder_test.py 2026-09-23 14:21:04.000000000 +0200 @@ -42,7 +42,7 @@ logical_line_plugin = _loaded(parameters={"logical_line": True}) physical_line_plugin = _loaded(parameters={"physical_line": True}) report_plugin = _loaded( - plugin=_plugin(ep=_ep(name="R", group="flake8.report")) + plugin=_plugin(ep=_ep(name="R", group="flake8.report")), ) plugins = finder.Plugins( @@ -200,14 +200,16 @@ "flake8", "9001", importlib.metadata.EntryPoint( - "default", "flake8.formatting.default:Default", "flake8.report" + "default", + "flake8.formatting.default:Default", + "flake8.report", ), ), finder.Plugin( "flake8", "9001", importlib.metadata.EntryPoint( - "pylint", "flake8.formatting.default:Pylint", "flake8.report" + "pylint", "flake8.formatting.default:Pylint", "flake8.report", ), ), } @@ -270,7 +272,7 @@ "flake8-foo", "1.2.3", importlib.metadata.EntryPoint( - "Q", "flake8_foo:Plugin", "flake8.extension" + "Q", "flake8_foo:Plugin", "flake8.extension", ), ), finder.Plugin( @@ -304,21 +306,23 @@ "flake8", "9001", importlib.metadata.EntryPoint( - "default", "flake8.formatting.default:Default", "flake8.report" + "default", + "flake8.formatting.default:Default", + "flake8.report", ), ), finder.Plugin( "flake8", "9001", importlib.metadata.EntryPoint( - "pylint", "flake8.formatting.default:Pylint", "flake8.report" + "pylint", "flake8.formatting.default:Pylint", "flake8.report", ), ), finder.Plugin( "flake8-foo", "1.2.3", importlib.metadata.EntryPoint( - "foo", "flake8_foo:Formatter", "flake8.report" + "foo", "flake8_foo:Formatter", "flake8.report", ), ), } @@ -485,28 +489,30 @@ "flake8", "9001", importlib.metadata.EntryPoint( - "default", "flake8.formatting.default:Default", "flake8.report" + "default", + "flake8.formatting.default:Default", + "flake8.report", ), ), finder.Plugin( "flake8", "9001", importlib.metadata.EntryPoint( - "pylint", "flake8.formatting.default:Pylint", "flake8.report" + "pylint", "flake8.formatting.default:Pylint", "flake8.report", ), ), finder.Plugin( "flake8-foo", "1.2.3", importlib.metadata.EntryPoint( - "Q", "flake8_foo:Plugin", "flake8.extension" + "Q", "flake8_foo:Plugin", "flake8.extension", ), ), finder.Plugin( "flake8-foo", "1.2.3", importlib.metadata.EntryPoint( - "foo", "flake8_foo:Formatter", "flake8.report" + "foo", "flake8_foo:Formatter", "flake8.report", ), ), finder.Plugin( @@ -518,7 +524,7 @@ "local", "local", importlib.metadata.EntryPoint( - "Y", "mod2:attr", "flake8.extension" + "Y", "mod2:attr", "flake8.extension", ), ), finder.Plugin( @@ -723,7 +729,7 @@ def test_classify_plugins(): report_plugin = _loaded( - plugin=_plugin(ep=_ep(name="R", group="flake8.report")) + plugin=_plugin(ep=_ep(name="R", group="flake8.report")), ) tree_plugin = _loaded(parameters={"tree": True}) logical_line_plugin = _loaded(parameters={"logical_line": True}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/unit/plugins/reporter_test.py new/flake8-7.4.1/tests/unit/plugins/reporter_test.py --- old/flake8-7.3.0/tests/unit/plugins/reporter_test.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/unit/plugins/reporter_test.py 2026-09-23 14:21:04.000000000 +0200 @@ -25,7 +25,7 @@ "flake8", "123", importlib.metadata.EntryPoint( - name, f"{cls.__module__}:{cls.__name__}", "flake8.report" + name, f"{cls.__module__}:{cls.__name__}", "flake8.report", ), ), cls, @@ -72,5 +72,5 @@ "flake8.plugins.reporter", 30, "'hi %(code)s' is an unknown formatter. Falling back to default.", - ) + ), ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/unit/test_application.py new/flake8-7.4.1/tests/unit/test_application.py --- old/flake8-7.3.0/tests/unit/test_application.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/unit/test_application.py 2026-09-23 14:21:04.000000000 +0200 @@ -36,7 +36,7 @@ ], ) def test_application_exit_code( - result_count, catastrophic, exit_zero, value, application + result_count, catastrophic, exit_zero, value, application, ): """Verify Application.exit_code returns the correct value.""" application.result_count = result_count diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/unit/test_base_formatter.py new/flake8-7.4.1/tests/unit/test_base_formatter.py --- old/flake8-7.3.0/tests/unit/test_base_formatter.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/unit/test_base_formatter.py 2026-09-23 14:21:04.000000000 +0200 @@ -50,7 +50,7 @@ formatter = base.BaseFormatter(options()) with pytest.raises(NotImplementedError): formatter.format( - Violation("A000", "file.py", 1, 1, "error text", None) + Violation("A000", "file.py", 1, 1, "error text", None), ) @@ -59,7 +59,7 @@ formatter = base.BaseFormatter(options(show_source=False)) assert ( formatter.show_source( - Violation("A000", "file.py", 1, 1, "error text", "line") + Violation("A000", "file.py", 1, 1, "error text", "line"), ) == "" ) @@ -70,7 +70,7 @@ formatter = base.BaseFormatter(options(show_source=True)) assert ( formatter.show_source( - Violation("A000", "file.py", 1, 1, "error text", None) + Violation("A000", "file.py", 1, 1, "error text", None), ) == "" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/unit/test_debug.py new/flake8-7.4.1/tests/unit/test_debug.py --- old/flake8-7.3.0/tests/unit/test_debug.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/unit/test_debug.py 2026-09-23 14:21:04.000000000 +0200 @@ -14,7 +14,7 @@ pkg, version, importlib.metadata.EntryPoint( - ep_name, "dne:dne", "flake8.extension" + ep_name, "dne:dne", "flake8.extension", ), ), None, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/unit/test_decision_engine.py new/flake8-7.4.1/tests/unit/test_decision_engine.py --- old/flake8-7.3.0/tests/unit/test_decision_engine.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/unit/test_decision_engine.py 2026-09-23 14:21:04.000000000 +0200 @@ -35,7 +35,7 @@ def test_was_ignored_ignores_errors(ignore_list, extend_ignore, error_code): """Verify we detect users explicitly ignoring an error.""" decider = style_guide.DecisionEngine( - create_options(ignore=ignore_list, extend_ignore=extend_ignore) + create_options(ignore=ignore_list, extend_ignore=extend_ignore), ) assert decider.was_ignored(error_code) is style_guide.Ignored.Explicitly @@ -53,11 +53,11 @@ ], ) def test_was_ignored_implicitly_selects_errors( - ignore_list, extend_ignore, error_code + ignore_list, extend_ignore, error_code, ): """Verify we detect users does not explicitly ignore an error.""" decider = style_guide.DecisionEngine( - create_options(ignore=ignore_list, extend_ignore=extend_ignore) + create_options(ignore=ignore_list, extend_ignore=extend_ignore), ) assert decider.was_ignored(error_code) is style_guide.Selected.Implicitly @@ -179,7 +179,7 @@ ], ) def test_decision_for( - select_list, ignore_list, extend_ignore, error_code, expected + select_list, ignore_list, extend_ignore, error_code, expected, ): """Verify we decide when to report an error.""" decider = style_guide.DecisionEngine( @@ -187,7 +187,7 @@ select=select_list, ignore=ignore_list, extend_ignore=extend_ignore, - ) + ), ) assert decider.decision_for(error_code) is expected diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/unit/test_discover_files.py new/flake8-7.4.1/tests/unit/test_discover_files.py --- old/flake8-7.3.0/tests/unit/test_discover_files.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/unit/test_discover_files.py 2026-09-23 14:21:04.000000000 +0200 @@ -47,7 +47,7 @@ _filenames_from( arg=_normpath("a/b/"), predicate=lambda path: path.endswith(_normpath("b/c.py")), - ) + ), ) # should not include c.py expected = _normpaths(("a/b/d.py", "a/b/e/f.py")) @@ -61,7 +61,7 @@ _filenames_from( arg=_normpath("./a/b"), predicate=lambda path: path == "c.py", - ) + ), ) # none should have matched the predicate so all returned expected = _normpaths(("./a/b/c.py", "./a/b/d.py", "./a/b/e/f.py")) @@ -132,7 +132,7 @@ stdin_display_name=stdin_display_name, filename_patterns=filename_patterns, exclude=exclude, - ) + ), ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/unit/test_file_processor.py new/flake8-7.4.1/tests/unit/test_file_processor.py --- old/flake8-7.3.0/tests/unit/test_file_processor.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/unit/test_file_processor.py 2026-09-23 14:21:04.000000000 +0200 @@ -28,7 +28,7 @@ def test_read_lines_universal_newlines(tmpdir, default_options): r"""Verify that line endings are translated to \n.""" lines = _lines_from_file( - tmpdir, b"# coding: utf-8\r\nx = 1\r\n", default_options + tmpdir, b"# coding: utf-8\r\nx = 1\r\n", default_options, ) assert lines == ["# coding: utf-8\n", "x = 1\n"] @@ -36,7 +36,7 @@ def test_read_lines_incorrect_utf_16(tmpdir, default_options): """Verify that an incorrectly encoded file is read as latin-1.""" lines = _lines_from_file( - tmpdir, b"# coding: utf16\nx = 1\n", default_options + tmpdir, b"# coding: utf16\nx = 1\n", default_options, ) assert lines == ["# coding: utf16\n", "x = 1\n"] @@ -44,7 +44,7 @@ def test_read_lines_unknown_encoding(tmpdir, default_options): """Verify that an unknown encoding is still read as latin-1.""" lines = _lines_from_file( - tmpdir, b"# coding: fake-encoding\nx = 1\n", default_options + tmpdir, b"# coding: fake-encoding\nx = 1\n", default_options, ) assert lines == ["# coding: fake-encoding\n", "x = 1\n"] @@ -289,7 +289,7 @@ def test_build_ast(default_options): """Verify the logic for how we build an AST for plugins.""" file_processor = processor.FileProcessor( - "-", default_options, lines=["a = 1\n"] + "-", default_options, lines=["a = 1\n"], ) module = file_processor.build_ast() @@ -299,7 +299,7 @@ def test_next_logical_line_updates_the_previous_logical_line(default_options): """Verify that we update our tracking of the previous logical line.""" file_processor = processor.FileProcessor( - "-", default_options, lines=["a = 1\n"] + "-", default_options, lines=["a = 1\n"], ) file_processor.indent_level = 1 @@ -315,7 +315,7 @@ def test_visited_new_blank_line(default_options): """Verify we update the number of blank lines seen.""" file_processor = processor.FileProcessor( - "-", default_options, lines=["a = 1\n"] + "-", default_options, lines=["a = 1\n"], ) assert file_processor.blank_lines == 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/unit/test_main_options.py new/flake8-7.4.1/tests/unit/test_main_options.py --- old/flake8-7.3.0/tests/unit/test_main_options.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/unit/test_main_options.py 2026-09-23 14:21:04.000000000 +0200 @@ -6,7 +6,7 @@ def test_stage1_arg_parser(): stage1_parser = options.stage1_arg_parser() opts, args = stage1_parser.parse_known_args( - ["--foo", "--verbose", "src", "setup.py", "--statistics", "--version"] + ["--foo", "--verbose", "src", "setup.py", "--statistics", "--version"], ) assert opts.verbose diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/unit/test_option_manager.py new/flake8-7.4.1/tests/unit/test_option_manager.py --- old/flake8-7.3.0/tests/unit/test_option_manager.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/unit/test_option_manager.py 2026-09-23 14:21:04.000000000 +0200 @@ -122,7 +122,7 @@ assert optmanager.config_options_dict == {} optmanager.add_option( - "--exclude", default="E123,W234", comma_separated_list=True + "--exclude", default="E123,W234", comma_separated_list=True, ) options = optmanager.parse_args([]) @@ -135,7 +135,7 @@ assert optmanager.config_options_dict == {} optmanager.add_option( - "--exclude", default="E123,W234", comma_separated_list=True + "--exclude", default="E123,W234", comma_separated_list=True, ) options = optmanager.parse_args(["--exclude", "E201,W111,F280"]) @@ -148,11 +148,11 @@ assert optmanager.config_options_dict == {} optmanager.add_option( - "--extra-config", normalize_paths=True, comma_separated_list=True + "--extra-config", normalize_paths=True, comma_separated_list=True, ) options = optmanager.parse_args( - ["--extra-config", "../config.ini,tox.ini,flake8/some-other.cfg"] + ["--extra-config", "../config.ini,tox.ini,flake8/some-other.cfg"], ) assert options.extra_config == [ os.path.abspath("../config.ini"), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/unit/test_options_config.py new/flake8-7.4.1/tests/unit/test_options_config.py --- old/flake8-7.3.0/tests/unit/test_options_config.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/unit/test_options_config.py 2026-09-23 14:21:04.000000000 +0200 @@ -169,7 +169,7 @@ @pytest.fixture def opt_manager(): ret = OptionManager( - version="123", plugin_versions="", parents=[], formatter_names=[] + version="123", plugin_versions="", parents=[], formatter_names=[], ) register_default_options(ret) return ret @@ -213,7 +213,7 @@ "flake8.options.config", 10, 'Option "wat" is not registered. Ignoring.', - ) + ), ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/unit/test_pyflakes_codes.py new/flake8-7.4.1/tests/unit/test_pyflakes_codes.py --- old/flake8-7.3.0/tests/unit/test_pyflakes_codes.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/unit/test_pyflakes_codes.py 2026-09-23 14:21:04.000000000 +0200 @@ -2,6 +2,8 @@ from __future__ import annotations import ast +import os.path +import re import pyflakes @@ -18,6 +20,14 @@ assert messages == set(pyflakes_shim.FLAKE8_PYFLAKES_CODES) +def test_all_codes_documented(): + here = os.path.dirname(__file__) + fname = os.path.join(here, '../../docs/source/user/error-codes.rst') + with open(fname) as f: + codes = set(re.findall(r'\bF\d{3}\b', f.read())) + assert set(pyflakes_shim.FLAKE8_PYFLAKES_CODES.values()) == codes + + def test_undefined_local_code(): """In pyflakes 2.1.0 this code's string formatting was changed.""" src = """\ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.3.0/tests/unit/test_style_guide.py new/flake8-7.4.1/tests/unit/test_style_guide.py --- old/flake8-7.3.0/tests/unit/test_style_guide.py 2025-06-20 21:30:26.000000000 +0200 +++ new/flake8-7.4.1/tests/unit/test_style_guide.py 2026-09-23 14:21:04.000000000 +0200 @@ -36,7 +36,7 @@ ) assert 1 == guide.handle_error( - "T111", "file.py", 1, 1, "error found", "a = 1" + "T111", "file.py", 1, 1, "error found", "a = 1", ) @@ -110,7 +110,7 @@ ], ) def test_style_guide_manager_pre_file_ignores( - ignores, violation, filename, handle_error_return + ignores, violation, filename, handle_error_return, ): """Verify how the StyleGuideManager creates a default style guide.""" formatter = mock.create_autospec(base.BaseFormatter, instance=True) ++++++ gen-pycodestyle-plugin ++++++ --- /var/tmp/diff_new_pack.eY7upt/_old 2026-10-27 18:21:10.775166808 +0100 +++ /var/tmp/diff_new_pack.eY7upt/_new 2026-10-27 18:21:10.781167059 +0100 @@ -3,9 +3,9 @@ import inspect import os.path +from collections.abc import Callable from collections.abc import Generator from typing import Any -from typing import Callable from typing import NamedTuple import pycodestyle
