-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Improve warnings when ignoring preview rules without preview flag #7491
Comments
Also noticed this strange warning. I had |
That rule moved to the nursery, probably because its unsafe... We had the same.. |
Does nursery mean it's disabled by default now when I |
@silverwind - Yeah, if you do |
Thanks, I'll remove it then from |
"Nursery" was changed to "Preview" -- we should probably update the docs to reflect that it used to be called "Nursery". |
I see. Maybe just reword the warning to something like this?
|
\cc @zanieb - when you're back :) |
"select" is kind of a broad term in this warning, we're referring to the use of a rule selector which can be used with any of the command line options e.g. |
Ref #7491 (comment) --------- Co-authored-by: Micha Reiser <[email protected]>
Just ran into this on the Home Assistant project. Honestly, I don't think this is a messaging problem. A rule was ignored explicitly and still gives us this warning. Meaning if you run it with It is a bit odd as we don't want it in preview but also want to ignore it if it gets out of preview/nursery. I'm not sure why an ignore flag has to trigger this warning. What is the goal for triggering the warning in that case? What is the risk if it would still be set to be ignored while only available in preview? I'm just confused about what problem is solved here and why this warning is added for this specific case reported in this issue. ../Frenck |
Hey @frenck The implementation is just naively collecting all of the selector options e.g. ruff/crates/ruff_workspace/src/configuration.rs Lines 703 to 712 in 316f759
This warning is not explicitly targetting use of I'll be working on this soon. |
…7842) Closes #7491 Users found it confusing that warnings were displayed when ignoring a preview rule (which has no effect without `--preview`). While we could retain the warning with different messaging, I've opted to remove it for now. With this pull request, we will only warn on `--select` and `--extend-select` but not `--fixable`, `--unfixable`, `--ignore`, or `--extend-fixable`.
…7842) Closes #7491 Users found it confusing that warnings were displayed when ignoring a preview rule (which has no effect without `--preview`). While we could retain the warning with different messaging, I've opted to remove it for now. With this pull request, we will only warn on `--select` and `--extend-select` but not `--fixable`, `--unfixable`, `--ignore`, or `--extend-fixable`.
ruff check --isolated --ignore PLC1901,PLR0904 # version 0.0.290
outputs
I think these warnings are rather irrelevant - they basically confirm what the users wants to do anyway, which is not select these rules.
The text was updated successfully, but these errors were encountered: