file-level noqa should raise an error if specific errors are provided (to avoid confusion)
まだ誰も着手していません。
評価
調査の方向性
まず、Flake8 がファイルレベルの # flake8: noqa コメントを解析している箇所と、関連する設定エラーがテストされている箇所を特定します。flake8 を使ってサンプルを再現し、その後、特定のエラーコードを指定したファイルレベルの noqa に対するカバレッジを追加します。この誤用によって、すべてのエラーが黙って無視されるのではなく、明確なエラーが発生すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
how did you install flake8?
pip install flake8
unmodified output of flake8 --bug-report
{
"platform": {
"python_implementation": "CPython",
"python_version": "3.10.7",
"system": "Linux"
},
"plugins": [
{
"plugin": "mccabe",
"version": "0.7.0"
},
{
"plugin": "pycodestyle",
"version": "2.10.0"
},
{
"plugin": "pyflakes",
"version": "3.0.1"
}
],
"version": "6.0.0"
}
describe the problem
what I expected to happen
I'm seeing developers using the file-level-noqa ignore wrongly from time to time, providing specific errors like # flake8: noqa: E712. What's confusing is that it gives the impression that it works as it doesn't throw that error anymore but the developers' understanding is incorrect (all errors are ignore). I understood that you don't want to support the file-level-specific-ignores but I think flake8 should do something to prevent this confusion.
See for instance https://til.codeinthehole.com/posts/filelevel-flake8-comments-ignore-all-errors/
My suggestion would be to detect that and throw an error? Somehow it is like providing a flake8 config with a wrong format
sample code
# flake8: noqa: E712
from os import * # F401
assert True == True # E712
Let me know what you think, happy to work on this if you would welcome a PR
- 主要言語
- Python
- スター
- 3.8k
- フォーク
- 362
- 平均マージ
- 6時間 14分
- マージ済み PR(30日)
- 7
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PyCQA/flake8 のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
Max Line Length in style guide ignored with python 3.14 when checking multiple files再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
-
option_manager.add_option ignores action when reading from config再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
似ている issue
-
ci enhancement testing
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
area/config comp/tools P2 platform/telegram type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NousResearch/hermes-agent#145412 ·
メンテナーはふだん 1 日以内に返信
-
[oblt-aw][autodoc] Update docs for security org scaffolding and Docs AI menu permission changes対応中かも @github-actions が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
curriculum documentation quality
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
githubnext/gh-aw-workshop#5039 ·
メンテナーはふだん 1 日以内に返信
-
Community project: hosted MOSS-Image studio with a visual JSON layout builder (no ComfyUI needed)オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
OpenMOSS/MOSS-Image#27 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信