diff --git a/crates/ruff/tests/cli/lint.rs b/crates/ruff/tests/cli/lint.rs index fcef87d7b0..02d1dbeebc 100644 --- a/crates/ruff/tests/cli/lint.rs +++ b/crates/ruff/tests/cli/lint.rs @@ -5084,16 +5084,9 @@ fn default_rules() -> Result<()> { unnecessary-map (C417), unnecessary-literal-within-dict-call (C418), unnecessary-comprehension-in-call (C419), - call-datetime-without-tzinfo (DTZ001), call-datetime-today (DTZ002), call-datetime-utcnow (DTZ003), call-datetime-utcfromtimestamp (DTZ004), - call-datetime-now-without-tzinfo (DTZ005), - call-datetime-fromtimestamp (DTZ006), - call-datetime-strptime-without-zone (DTZ007), - call-date-today (DTZ011), - call-date-fromtimestamp (DTZ012), - datetime-min-max (DTZ901), debugger (T100), shebang-not-executable (EXE001), shebang-missing-executable-file (EXE002), @@ -5216,6 +5209,7 @@ fn default_rules() -> Result<()> { unused-import (F401), import-shadowed-by-loop-var (F402), late-future-import (F404), + undefined-local-with-nested-import-star-usage (F406), future-feature-not-defined (F407), percent-format-invalid-format (F501), percent-format-expected-mapping (F502), diff --git a/crates/ruff/tests/cli/snapshots/cli__show_settings__display_default_settings.snap b/crates/ruff/tests/cli/snapshots/cli__show_settings__display_default_settings.snap index bfb3d62d8e..cfd7fb4daa 100644 --- a/crates/ruff/tests/cli/snapshots/cli__show_settings__display_default_settings.snap +++ b/crates/ruff/tests/cli/snapshots/cli__show_settings__display_default_settings.snap @@ -139,16 +139,9 @@ linter.rules.enabled = [ unnecessary-map (C417), unnecessary-literal-within-dict-call (C418), unnecessary-comprehension-in-call (C419), - call-datetime-without-tzinfo (DTZ001), call-datetime-today (DTZ002), call-datetime-utcnow (DTZ003), call-datetime-utcfromtimestamp (DTZ004), - call-datetime-now-without-tzinfo (DTZ005), - call-datetime-fromtimestamp (DTZ006), - call-datetime-strptime-without-zone (DTZ007), - call-date-today (DTZ011), - call-date-fromtimestamp (DTZ012), - datetime-min-max (DTZ901), debugger (T100), shebang-not-executable (EXE001), shebang-missing-executable-file (EXE002), @@ -271,6 +264,7 @@ linter.rules.enabled = [ unused-import (F401), import-shadowed-by-loop-var (F402), late-future-import (F404), + undefined-local-with-nested-import-star-usage (F406), future-feature-not-defined (F407), percent-format-invalid-format (F501), percent-format-expected-mapping (F502), @@ -554,16 +548,9 @@ linter.rules.should_fix = [ unnecessary-map (C417), unnecessary-literal-within-dict-call (C418), unnecessary-comprehension-in-call (C419), - call-datetime-without-tzinfo (DTZ001), call-datetime-today (DTZ002), call-datetime-utcnow (DTZ003), call-datetime-utcfromtimestamp (DTZ004), - call-datetime-now-without-tzinfo (DTZ005), - call-datetime-fromtimestamp (DTZ006), - call-datetime-strptime-without-zone (DTZ007), - call-date-today (DTZ011), - call-date-fromtimestamp (DTZ012), - datetime-min-max (DTZ901), debugger (T100), shebang-not-executable (EXE001), shebang-missing-executable-file (EXE002), @@ -686,6 +673,7 @@ linter.rules.should_fix = [ unused-import (F401), import-shadowed-by-loop-var (F402), late-future-import (F404), + undefined-local-with-nested-import-star-usage (F406), future-feature-not-defined (F407), percent-format-invalid-format (F501), percent-format-expected-mapping (F502), diff --git a/crates/ruff_linter/src/settings/mod.rs b/crates/ruff_linter/src/settings/mod.rs index 40fe030a57..c18627e241 100644 --- a/crates/ruff_linter/src/settings/mod.rs +++ b/crates/ruff_linter/src/settings/mod.rs @@ -413,16 +413,9 @@ pub const DEFAULT_SELECTORS: &[RuleSelector] = &[ RuleSelector::rule(Rule::UnnecessaryLiteralWithinDictCall), // C418 RuleSelector::rule(Rule::UnnecessaryComprehensionInCall), // C419 RuleSelector::rule(Rule::EmptyDocstring), // D419 - RuleSelector::rule(Rule::CallDatetimeWithoutTzinfo), // DTZ001 RuleSelector::rule(Rule::CallDatetimeToday), // DTZ002 RuleSelector::rule(Rule::CallDatetimeUtcnow), // DTZ003 RuleSelector::rule(Rule::CallDatetimeUtcfromtimestamp), // DTZ004 - RuleSelector::rule(Rule::CallDatetimeNowWithoutTzinfo), // DTZ005 - RuleSelector::rule(Rule::CallDatetimeFromtimestamp), // DTZ006 - RuleSelector::rule(Rule::CallDatetimeStrptimeWithoutZone), // DTZ007 - RuleSelector::rule(Rule::CallDateToday), // DTZ011 - RuleSelector::rule(Rule::CallDateFromtimestamp), // DTZ012 - RuleSelector::rule(Rule::DatetimeMinMax), // DTZ901 RuleSelector::rule(Rule::BareExcept), // E722 RuleSelector::rule(Rule::IOError), // E902 RuleSelector::rule(Rule::ShebangNotExecutable), // EXE001 @@ -432,6 +425,7 @@ pub const DEFAULT_SELECTORS: &[RuleSelector] = &[ RuleSelector::rule(Rule::UnusedImport), // F401 RuleSelector::rule(Rule::ImportShadowedByLoopVar), // F402 RuleSelector::rule(Rule::LateFutureImport), // F404 + RuleSelector::rule(Rule::UndefinedLocalWithNestedImportStarUsage), // F406 RuleSelector::rule(Rule::FutureFeatureNotDefined), // F407 RuleSelector::rule(Rule::PercentFormatInvalidFormat), // F501 RuleSelector::rule(Rule::PercentFormatExpectedMapping), // F502 @@ -1013,7 +1007,6 @@ mod tests { pandas-use-of-dot-read-table (PD012), pandas-use-of-pd-merge (PD015), escape-sequence-in-docstring (D301), - undefined-local-with-nested-import-star-usage (F406), missing-maxsplit-arg (PLC0207), unnecessary-dunder-call (PLC2801), duplicate-bases (PLE0241), @@ -1071,13 +1064,6 @@ mod tests { Removed in preview: [ exec-builtin (S102), - call-datetime-without-tzinfo (DTZ001), - call-datetime-now-without-tzinfo (DTZ005), - call-datetime-fromtimestamp (DTZ006), - call-datetime-strptime-without-zone (DTZ007), - call-date-today (DTZ011), - call-date-fromtimestamp (DTZ012), - datetime-min-max (DTZ901), ] "); }