We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RUF100 removes noqa comments if the lines doesn't have the underlying issue.
RUF100
noqa
This doesn't work if the certain errors aren't part of the --select. I wouldn't have expect this:
--select
$ cat foo.py from foo import bar # noqa: F401 foo = lambda x: None # noqa: E731 import os # noqa: E403 reload(os) # noqa: F821 $ ruff --isolated --select RUF100 foo.py foo.py:1:22: RUF100 Unused `noqa` directive (non-enabled: `F401`) foo.py:3:23: RUF100 Unused `noqa` directive (non-enabled: `E731`) foo.py:5:12: RUF100 Unused `noqa` directive (unknown: `E403`) foo.py:7:13: RUF100 Unused `noqa` directive (non-enabled: `F821`) Found 4 errors. 4 potentially fixable with the --fix option. $ ruff --isolated --select RUF100 --fix foo.py Found 4 errors (4 fixed, 0 remaining). $ cat foo.py from foo import bar foo = lambda x: None import os reload(os)
I can also only select codes which ruff is aware of:
$ ruff --isolated --select RUF100,F401,E731,F821 foo.py foo.py:5:12: RUF100 Unused `noqa` directive (unknown: `E403`) Found 1 error. 1 potentially fixable with the --fix option. $ ruff --isolated --select RUF100,F401,E731,F821,E403 foo.py error: Invalid value 'E403' for '--select <RULE_CODE>': Unknown rule selector `E403` For more information try '--help'
E403 is not yet supported therefore this is always removed and one cannot prevent this.
E403
The text was updated successfully, but these errors were encountered:
You can add E403 to "external" to prevent this, I think?
[tool.ruff] external = ["E403"]
Sorry, something went wrong.
I'd recommend running ruff --extend-select RUF100. That way, it'll enforce your standard configuration.
ruff --extend-select RUF100
I somehow need a way to exclusively select RUF100 so that I can get a list of issues (and fixes) only for that one.
fixing only is possible via: ruff --select ALL --extend-select RUF100 --fix-only --unfixable ALL --fixable RUF100 $(python_files)
ruff --select ALL --extend-select RUF100 --fix-only --unfixable ALL --fixable RUF100 $(python_files)
selecting only is possible via: ruff --select ALL --extend-select RUF100 $(python_files) | grep RUF100
ruff --select ALL --extend-select RUF100 $(python_files) | grep RUF100
(with optional --select ALL)
--select ALL
import
No branches or pull requests
RUF100
removesnoqa
comments if the lines doesn't have the underlying issue.This doesn't work if the certain errors aren't part of the
--select
. I wouldn't have expect this:I can also only select codes which ruff is aware of:
E403
is not yet supported therefore this is always removed and one cannot prevent this.The text was updated successfully, but these errors were encountered: