mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 10:22:24 +00:00
Mark sometimes-fixable rules as Availability::Sometimes
(#2552)
This commit is contained in:
parent
da0374f360
commit
64c79bde83
8 changed files with 9 additions and 9 deletions
|
@ -51,7 +51,7 @@ define_violation!(
|
|||
}
|
||||
);
|
||||
impl Violation for UnusedLoopControlVariable {
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Always));
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Sometimes));
|
||||
|
||||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
|
|
|
@ -19,7 +19,7 @@ define_violation!(
|
|||
}
|
||||
);
|
||||
impl Violation for YodaConditions {
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Always));
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Sometimes));
|
||||
|
||||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
|
|
|
@ -18,7 +18,7 @@ fn fmt_blank_line_after_summary_autofix_msg(_: &BlankLineAfterSummary) -> String
|
|||
"Insert single blank line".to_string()
|
||||
}
|
||||
impl Violation for BlankLineAfterSummary {
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Always));
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Sometimes));
|
||||
|
||||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
|
|
|
@ -24,7 +24,7 @@ fn fmt_unused_import_autofix_msg(unused_import: &UnusedImport) -> String {
|
|||
}
|
||||
}
|
||||
impl Violation for UnusedImport {
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Always));
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Sometimes));
|
||||
|
||||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
|
|
|
@ -21,7 +21,7 @@ define_violation!(
|
|||
}
|
||||
);
|
||||
impl Violation for MultiValueRepeatedKeyLiteral {
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Always));
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Sometimes));
|
||||
|
||||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
|
@ -47,7 +47,7 @@ define_violation!(
|
|||
}
|
||||
);
|
||||
impl Violation for MultiValueRepeatedKeyVariable {
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Always));
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Sometimes));
|
||||
|
||||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
|
|
|
@ -18,7 +18,7 @@ define_violation!(
|
|||
}
|
||||
);
|
||||
impl Violation for ConsiderUsingFromImport {
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Always));
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Sometimes));
|
||||
|
||||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
|
|
|
@ -15,7 +15,7 @@ define_violation!(
|
|||
}
|
||||
);
|
||||
impl Violation for DatetimeTimezoneUTC {
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Always));
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Sometimes));
|
||||
|
||||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
|
|
|
@ -21,7 +21,7 @@ define_violation!(
|
|||
}
|
||||
);
|
||||
impl Violation for ImportReplacements {
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Always));
|
||||
const AUTOFIX: Option<AutofixKind> = Some(AutofixKind::new(Availability::Sometimes));
|
||||
|
||||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue