Do not take `explicit-preview-rules` into account when selecting `fixable` rules

This commit is contained in:
Zanie 2023-12-26 12:43:35 -06:00
parent 29513398d2
commit 4f6e03ced8
2 changed files with 13 additions and 1 deletions

View File

@ -243,6 +243,16 @@ pub struct PreviewOptions {
pub require_explicit: bool,
}
impl PreviewOptions {
/// Return a copy with the same preview mode setting but require explicit disabled.
pub fn without_require_explicit(&self) -> Self {
Self {
mode: self.mode,
require_explicit: false,
}
}
}
#[cfg(feature = "schemars")]
mod schema {
use itertools::Itertools;

View File

@ -714,7 +714,9 @@ impl LintConfiguration {
.collect();
// The fixable set keeps track of which rules are fixable.
let mut fixable_set: RuleSet = RuleSelector::All.rules(&preview).collect();
let mut fixable_set: RuleSet = RuleSelector::All
.rules(&preview.without_require_explicit())
.collect();
// Ignores normally only subtract from the current set of selected
// rules. By that logic the ignore in `select = [], ignore = ["E501"]`