Max Line Length in style guide ignored with python 3.14 when checking multiple files
まだ誰も着手していません。
評価
調査の方向性
style_guide.check_files が使用する legacy API パスから始め、Python 3.14 で 1 つのファイルをチェックする場合と複数のファイルをチェックする場合の違いを再現してください。複数ファイルのチェック中に max_line_length がどのように適用されるかを追跡し、報告された例の両方のファイルで設定値が適用されることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
how did you install flake8?
Installed on demand from TOML requirements as part of uv run command launch
unmodified output of flake8 --bug-report
{
"platform": {
"python_implementation": "CPython",
"python_version": "3.14.2",
"system": "Linux"
},
"plugins": [
{
"plugin": "mccabe",
"version": "0.7.0"
},
{
"plugin": "pep8-naming",
"version": "0.15.1"
},
{
"plugin": "pycodestyle",
"version": "2.14.0"
},
{
"plugin": "pyflakes",
"version": "3.4.0"
}
],
"version": "7.3.0"
}
describe the problem
what I expected to happen
when using flake8 programmatically it should be possible to check multiple files with the configured style guide. This works correctly with python3.12 but seems to be ignored when using python 3.14
set up style guide
Python 3.14.2 (main, Jan 9 2026, 09:06:43) [GCC 8.5.0 20210514 (Red Hat 8.5.0-28.0.1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
Ctrl click to launch VS Code Native REPL
>>> from flake8.api import legacy as flake8
>>> ignore_list = []
>>> line_length = 88
>>> style_guide = flake8.get_style_guide(extend_ignore=ignore_list, max_line_length=line_length, color="never")
>>> style_guide.options
Namespace(verbose=0, output_file=None, append_config=[], config=None, isolated=False, enable_extensions=None, require_plugins=None, filenames=[], quiet=0, color='never', count=False, exclude=['.svn', 'CVS', '.bzr', '.hg', '.git', '__pycache__', '.tox', '.nox', '.eggs', '*.egg'], extend_exclude=[], filename=['*.py'], stdin_display_name='stdin', format='default', hang_closing=False, ignore=None, extend_ignore=[], per_file_ignores='', max_line_length=88, max_doc_length=None, indent_size=4, select=None, extend_select=None, disable_noqa=False, show_source=False, statistics=False, exit_zero=False, jobs=JobsArgument('auto'), tee=False, benchmark=False, bug_report=False, max_complexity=-1, ignore_names=['setUp', 'tearDown', 'setUpClass', 'tearDownClass', 'setUpModule', 'tearDownModule', 'asyncSetUp', 'asyncTearDown', 'setUpTestData', 'failureException', 'longMessage', 'maxDiff'], classmethod_decorators=['classmethod'], staticmethod_decorators=['staticmethod'], builtins=None, doctests=False, extended_default_ignore=['N818'], extended_default_select=['C90', 'N8', 'F', 'E', 'W'])
Check files ignores the set max_line_length when running with multiple files
>>> style_guide.check_files(['file1.py', 'file2.py'])
file1.py:65:80: E501 line too long (88 > 79 characters)
file1.py:66:80: E501 line too long (85 > 79 characters)
file2.py:17:80: E501 line too long (81 > 79 characters)
file2.py:18:80: E501 line too long (87 > 79 characters)
file2.py:19:80: E501 line too long (88 > 79 characters)
<flake8.api.legacy.Report object at 0x7f070003b4d0>
However running the files individually works ok, and then it is possible to run the two files in the same check correctly
>>> style_guide.check_files(['file1.py'])
<flake8.api.legacy.Report object at 0x7f06ffc50690>
>>> style_guide.check_files(['file2.py'])
<flake8.api.legacy.Report object at 0x7f06ffc507d0>
>>>
>>>
>>> style_guide.check_files(['file1.py', 'file2.py'])
<flake8.api.legacy.Report object at 0x7f07001223f0>
- 主要言語
- Python
- スター
- 3.8k
- フォーク
- 356
- 平均マージ
- 3時間 25分
- マージ済み PR(30日)
- 5
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PyCQA/flake8 のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
letsencrypt/cp-cps#353 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
PedestrianDynamics/pyFDS-Evac#394 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
DOI-USGS/pywatershed#421 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
python-pillow/Pillow#10087 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信