-
Notifications
You must be signed in to change notification settings - Fork 899
New issue
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
error despite listed in per-file-ignores
#10906
Comments
I think this is just a bug in Ruff. |
By the way, can you add the code to the |
Changing the noqa to
which is correct since I've put E501 in Ruff's ignore category. I guess that's a policy decision, should Ruff complain about noqa statements that are only used by other linters. Personally, I'm phasing out flake8 and I'm perfectly fine not using the RUF category until the next Ruff release (and then use a blanket noqa which is what is being used currently). |
…h#10908) ## Summary If `RUF100` was included in a per-file-ignore, we respected it on cases like `# noqa: F401`, but not the blanket variant (`# noqa`). Closes astral-sh#10906.
@charliermarsh I just updated to 0.4.1 and still have the same issue, even with
I haven't managed to get rid of flake8 yet, so the directive is still in use by flake8. |
Are you sure that your per-file-ignore patterns are defined correctly? Can you confirm that you’re able to ignore other errors in that file? |
Nevermind, I think I understand the case you're hitting. I assume you have no other diagnostics in that file. |
## Summary The existing test didn't cover the case in which there are _no_ other diagnostics in the file. Closes #10906.
You can set |
Using Ruff 0.3.7, I tried to select the "RUF" category, and got a
RUF100
error. Adding the file toper-file-ignores
in pyproject.toml seems to have no effect. The section works for other files/rules in the project, I'm even using it forRUF005
.I have not had the RUF category enabled with previous versions, so I do not know if it this is a regression in Ruff. I searched a bit in the issues, not sure if #6385 or #9300 are related to my problem.
Minimizing the file to this:
and putting it in ruf100.py preserves the error:
I would be happy to remove the noqa directive, but Flake8 fails on the real code if I remove it.
Here are what I believe the relevant parts of pyproject.toml are, please let me know if you need more:
The text was updated successfully, but these errors were encountered: