-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
This looks like a fun one.
❯ cat foo.py
x = '123' # noqa: O103❯ cat ruff.toml
[lint]
select = ["E4", "E5", "E7", "E9", "F", "G", "RUF", "S", "UP"]
ignore = ["RUF102"]
❯ ruff check --fix foo.py
warning: Invalid rule code provided to `# noqa` at foo.py:1: O103
Found 1 error (1 fixed, 0 remaining).
I thought I might have the wrong code so I tried RUF100 through RUF104. Curiously it seems I can only disable this warning by specifying all 5 codes or using a more generic ignore like RUF10.
❯ cat ruff.toml
[lint]
select = ["E4", "E5", "E7", "E9", "F", "G", "RUF", "S", "UP"]
ignore = ["RUF100", "RUF101", "RUF102", "RUF103", "RUF104"]
❯ ruff check --fix foo.py
warning: Invalid rule code provided to `# noqa` at foo/__init__.py:1: O103
All checks passed!
You'll note that I still get a warning on the first run though (but not subsequent runs unless I remove .ruff_cache). I'd have expected silencing this error to also silence that warning. I'm guessing that warning comes from a different code path that predates RUF102 and should possibly be removed (?).
Note that I worked around this by using the lint.external setting to whitelist the non-ruff linter codes.
Version
ruff 0.15.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working