-
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
Only show warnings for empty preview selectors when enabling rules #7842
Conversation
if preview.mode.is_disabled() { | ||
// Only warn for the following selectors if used to enable rules | ||
// e.g. use with `--ignore` or `--fixable` is okay | ||
if preview.mode.is_disabled() && kind.is_enable() { | ||
if let RuleSelector::Rule { prefix, .. } = selector { | ||
if prefix.rules().any(|rule| rule.is_nursery()) { | ||
deprecated_nursery_selectors.insert(selector); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also push kind
to these warning lists to facilitate different warnings by kind.
/// Modifies the behavior of selected rules | ||
Modify, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be made more specific in the future if needed 🤷♀️
PR Check ResultsEcosystem✅ ecosystem check detected no changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This is the right choice IMHO. Thank you! |
…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`.
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
.