mirror of https://github.com/astral-sh/ruff
Do not take `explicit-preview-rules` into account when selecting `fixable` rules
This commit is contained in:
parent
29513398d2
commit
4f6e03ced8
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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"]`
|
||||
|
|
|
|||
Loading…
Reference in New Issue