astral-sh / ruff

An extremely fast Python linter and code formatter, written in Rust.

Home Page:https://docs.astral.sh/ruff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PGH004 (blanket-noqa) doesn't checks file-level pragmas

ashrub-holvi opened this issue · comments

Hi,

If blanket noqa is used on a file level, cat test.py:

# ruff: noqa

print("Hello Astral!")

ruff will not complain about it:

ruff check --select=PGH004 test.py
All checks passed!

but probably it should, because in any case better to disable exact rules, not everything.
Same for # flake8: noqa which is also supported by ruff.

ruff --version
ruff 0.4.4

Seems reasonable to me? May need to be added in preview since it's an increase in the scope of the rule.