From 35cf9e242e495cb713c8a06882f8d4650d68c5cd Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 25 Jan 2023 16:26:22 -0500 Subject: [PATCH] Rename TYP rules to TYC (#2175) --- README.md | 14 +++++------ .../{TYP001.py => TYC001.py} | 2 +- .../{TYP002.py => TYC002.py} | 16 ++++++------- .../{TYP003.py => TYC003.py} | 2 +- .../{TYP004_1.py => TYC004_1.py} | 0 .../{TYP004_2.py => TYC004_2.py} | 0 .../{TYP004_3.py => TYC004_3.py} | 0 .../{TYP004_4.py => TYC004_4.py} | 0 .../{TYP004_5.py => TYC004_5.py} | 0 .../{TYP004_6.py => TYC004_6.py} | 0 .../{TYP004_7.py => TYC004_7.py} | 0 .../{TYP004_8.py => TYC004_8.py} | 0 .../{TYP005.py => TYC005.py} | 2 +- ruff.schema.json | 16 ++++++------- src/flake8_to_ruff/plugin.rs | 2 +- src/registry.rs | 12 +++++----- src/rule_redirects.rs | 3 +++ src/rules/flake8_type_checking/mod.rs | 24 +++++++++---------- .../rules/empty_type_checking_block.rs | 2 +- .../runtime_import_in_type_checking_block.rs | 2 +- .../rules/typing_only_runtime_import.rs | 2 +- ..._empty-type-checking-block_TYC005.py.snap} | 0 ...t-in-type-checking-block_TYC004_1.py.snap} | 0 ...t-in-type-checking-block_TYC004_2.py.snap} | 0 ...t-in-type-checking-block_TYC004_3.py.snap} | 0 ...t-in-type-checking-block_TYC004_4.py.snap} | 0 ...t-in-type-checking-block_TYC004_5.py.snap} | 0 ...t-in-type-checking-block_TYC004_6.py.snap} | 0 ...t-in-type-checking-block_TYC004_7.py.snap} | 0 ...t-in-type-checking-block_TYC004_8.py.snap} | 0 ...ng-only-first-party-import_TYC001.py.snap} | 0 ...ly-standard-library-import_TYC003.py.snap} | 0 ...ng-only-third-party-import_TYC002.py.snap} | 0 src/settings/mod.rs | 2 +- 34 files changed, 52 insertions(+), 49 deletions(-) rename resources/test/fixtures/flake8_type_checking/{TYP001.py => TYC001.py} (82%) rename resources/test/fixtures/flake8_type_checking/{TYP002.py => TYC002.py} (83%) rename resources/test/fixtures/flake8_type_checking/{TYP003.py => TYC003.py} (71%) rename resources/test/fixtures/flake8_type_checking/{TYP004_1.py => TYC004_1.py} (100%) rename resources/test/fixtures/flake8_type_checking/{TYP004_2.py => TYC004_2.py} (100%) rename resources/test/fixtures/flake8_type_checking/{TYP004_3.py => TYC004_3.py} (100%) rename resources/test/fixtures/flake8_type_checking/{TYP004_4.py => TYC004_4.py} (100%) rename resources/test/fixtures/flake8_type_checking/{TYP004_5.py => TYC004_5.py} (100%) rename resources/test/fixtures/flake8_type_checking/{TYP004_6.py => TYC004_6.py} (100%) rename resources/test/fixtures/flake8_type_checking/{TYP004_7.py => TYC004_7.py} (100%) rename resources/test/fixtures/flake8_type_checking/{TYP004_8.py => TYC004_8.py} (100%) rename resources/test/fixtures/flake8_type_checking/{TYP005.py => TYC005.py} (93%) rename src/rules/flake8_type_checking/snapshots/{ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TYP005.py.snap => ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TYC005.py.snap} (100%) rename src/rules/flake8_type_checking/snapshots/{ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_1.py.snap => ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_1.py.snap} (100%) rename src/rules/flake8_type_checking/snapshots/{ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_2.py.snap => ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_2.py.snap} (100%) rename src/rules/flake8_type_checking/snapshots/{ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_3.py.snap => ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_3.py.snap} (100%) rename src/rules/flake8_type_checking/snapshots/{ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_4.py.snap => ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_4.py.snap} (100%) rename src/rules/flake8_type_checking/snapshots/{ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_5.py.snap => ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_5.py.snap} (100%) rename src/rules/flake8_type_checking/snapshots/{ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_6.py.snap => ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_6.py.snap} (100%) rename src/rules/flake8_type_checking/snapshots/{ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_7.py.snap => ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_7.py.snap} (100%) rename src/rules/flake8_type_checking/snapshots/{ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_8.py.snap => ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_8.py.snap} (100%) rename src/rules/flake8_type_checking/snapshots/{ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TYP001.py.snap => ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TYC001.py.snap} (100%) rename src/rules/flake8_type_checking/snapshots/{ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TYP003.py.snap => ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TYC003.py.snap} (100%) rename src/rules/flake8_type_checking/snapshots/{ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TYP002.py.snap => ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TYC002.py.snap} (100%) diff --git a/README.md b/README.md index 14cc5b27f1..bbaf3c3820 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ developer of [Zulip](https://github.com/zulip/zulip): 1. [flake8-commas (COM)](#flake8-commas-com) 1. [flake8-no-pep420 (INP)](#flake8-no-pep420-inp) 1. [flake8-executable (EXE)](#flake8-executable-exe) - 1. [flake8-type-checking (TYP)](#flake8-type-checking-typ) + 1. [flake8-type-checking (TYC)](#flake8-type-checking-tyc) 1. [tryceratops (TRY)](#tryceratops-try) 1. [flake8-use-pathlib (PTH)](#flake8-use-pathlib-pth) 1. [Ruff-specific rules (RUF)](#ruff-specific-rules-ruf) @@ -1197,17 +1197,17 @@ For more, see [flake8-executable](https://pypi.org/project/flake8-executable/) o | EXE004 | shebang-whitespace | Avoid whitespace before shebang | 🛠 | | EXE005 | shebang-newline | Shebang should be at the beginning of the file | | -### flake8-type-checking (TYP) +### flake8-type-checking (TYC) For more, see [flake8-type-checking](https://pypi.org/project/flake8-type-checking/) on PyPI. | Code | Name | Message | Fix | | ---- | ---- | ------- | --- | -| TYP001 | typing-only-first-party-import | Move application import `{}` into a type-checking block | | -| TYP002 | typing-only-third-party-import | Move third-party import `{}` into a type-checking block | | -| TYP003 | typing-only-standard-library-import | Move standard library import `{}` into a type-checking block | | -| TYP004 | runtime-import-in-type-checking-block | Move import `{}` out of type-checking block. Import is used for more than type hinting. | | -| TYP005 | empty-type-checking-block | Found empty type-checking block | | +| TYC001 | typing-only-first-party-import | Move application import `{}` into a type-checking block | | +| TYC002 | typing-only-third-party-import | Move third-party import `{}` into a type-checking block | | +| TYC003 | typing-only-standard-library-import | Move standard library import `{}` into a type-checking block | | +| TYC004 | runtime-import-in-type-checking-block | Move import `{}` out of type-checking block. Import is used for more than type hinting. | | +| TYC005 | empty-type-checking-block | Found empty type-checking block | | ### tryceratops (TRY) diff --git a/resources/test/fixtures/flake8_type_checking/TYP001.py b/resources/test/fixtures/flake8_type_checking/TYC001.py similarity index 82% rename from resources/test/fixtures/flake8_type_checking/TYP001.py rename to resources/test/fixtures/flake8_type_checking/TYC001.py index ce1cc042b5..455105c2bc 100644 --- a/resources/test/fixtures/flake8_type_checking/TYP001.py +++ b/resources/test/fixtures/flake8_type_checking/TYC001.py @@ -1,6 +1,6 @@ """Tests to determine first-party import classification. -For typing-only import detection tests, see `TYP002.py`. +For typing-only import detection tests, see `TYC002.py`. """ diff --git a/resources/test/fixtures/flake8_type_checking/TYP002.py b/resources/test/fixtures/flake8_type_checking/TYC002.py similarity index 83% rename from resources/test/fixtures/flake8_type_checking/TYP002.py rename to resources/test/fixtures/flake8_type_checking/TYC002.py index 9ea3aa0cc3..366fc7229d 100644 --- a/resources/test/fixtures/flake8_type_checking/TYP002.py +++ b/resources/test/fixtures/flake8_type_checking/TYC002.py @@ -2,43 +2,43 @@ def f(): - import pandas as pd # TYP002 + import pandas as pd # TYC002 x: pd.DataFrame def f(): - from pandas import DataFrame # TYP002 + from pandas import DataFrame # TYC002 x: DataFrame def f(): - from pandas import DataFrame as df # TYP002 + from pandas import DataFrame as df # TYC002 x: df def f(): - import pandas as pd # TYP002 + import pandas as pd # TYC002 x: pd.DataFrame = 1 def f(): - from pandas import DataFrame # TYP002 + from pandas import DataFrame # TYC002 x: DataFrame = 2 def f(): - from pandas import DataFrame as df # TYP002 + from pandas import DataFrame as df # TYC002 x: df = 3 def f(): - import pandas as pd # TYP002 + import pandas as pd # TYC002 x: "pd.DataFrame" = 1 @@ -46,7 +46,7 @@ def f(): def f(): import pandas as pd - x = dict["pd.DataFrame", "pd.DataFrame"] # TYP002 + x = dict["pd.DataFrame", "pd.DataFrame"] # TYC002 def f(): diff --git a/resources/test/fixtures/flake8_type_checking/TYP003.py b/resources/test/fixtures/flake8_type_checking/TYC003.py similarity index 71% rename from resources/test/fixtures/flake8_type_checking/TYP003.py rename to resources/test/fixtures/flake8_type_checking/TYC003.py index face13f3db..4bcd58d8ee 100644 --- a/resources/test/fixtures/flake8_type_checking/TYP003.py +++ b/resources/test/fixtures/flake8_type_checking/TYC003.py @@ -1,6 +1,6 @@ """Tests to determine standard library import classification. -For typing-only import detection tests, see `TYP002.py`. +For typing-only import detection tests, see `TYC002.py`. """ diff --git a/resources/test/fixtures/flake8_type_checking/TYP004_1.py b/resources/test/fixtures/flake8_type_checking/TYC004_1.py similarity index 100% rename from resources/test/fixtures/flake8_type_checking/TYP004_1.py rename to resources/test/fixtures/flake8_type_checking/TYC004_1.py diff --git a/resources/test/fixtures/flake8_type_checking/TYP004_2.py b/resources/test/fixtures/flake8_type_checking/TYC004_2.py similarity index 100% rename from resources/test/fixtures/flake8_type_checking/TYP004_2.py rename to resources/test/fixtures/flake8_type_checking/TYC004_2.py diff --git a/resources/test/fixtures/flake8_type_checking/TYP004_3.py b/resources/test/fixtures/flake8_type_checking/TYC004_3.py similarity index 100% rename from resources/test/fixtures/flake8_type_checking/TYP004_3.py rename to resources/test/fixtures/flake8_type_checking/TYC004_3.py diff --git a/resources/test/fixtures/flake8_type_checking/TYP004_4.py b/resources/test/fixtures/flake8_type_checking/TYC004_4.py similarity index 100% rename from resources/test/fixtures/flake8_type_checking/TYP004_4.py rename to resources/test/fixtures/flake8_type_checking/TYC004_4.py diff --git a/resources/test/fixtures/flake8_type_checking/TYP004_5.py b/resources/test/fixtures/flake8_type_checking/TYC004_5.py similarity index 100% rename from resources/test/fixtures/flake8_type_checking/TYP004_5.py rename to resources/test/fixtures/flake8_type_checking/TYC004_5.py diff --git a/resources/test/fixtures/flake8_type_checking/TYP004_6.py b/resources/test/fixtures/flake8_type_checking/TYC004_6.py similarity index 100% rename from resources/test/fixtures/flake8_type_checking/TYP004_6.py rename to resources/test/fixtures/flake8_type_checking/TYC004_6.py diff --git a/resources/test/fixtures/flake8_type_checking/TYP004_7.py b/resources/test/fixtures/flake8_type_checking/TYC004_7.py similarity index 100% rename from resources/test/fixtures/flake8_type_checking/TYP004_7.py rename to resources/test/fixtures/flake8_type_checking/TYC004_7.py diff --git a/resources/test/fixtures/flake8_type_checking/TYP004_8.py b/resources/test/fixtures/flake8_type_checking/TYC004_8.py similarity index 100% rename from resources/test/fixtures/flake8_type_checking/TYP004_8.py rename to resources/test/fixtures/flake8_type_checking/TYC004_8.py diff --git a/resources/test/fixtures/flake8_type_checking/TYP005.py b/resources/test/fixtures/flake8_type_checking/TYC005.py similarity index 93% rename from resources/test/fixtures/flake8_type_checking/TYP005.py rename to resources/test/fixtures/flake8_type_checking/TYC005.py index 4dec52843f..c5e80a69ac 100644 --- a/resources/test/fixtures/flake8_type_checking/TYP005.py +++ b/resources/test/fixtures/flake8_type_checking/TYC005.py @@ -1,7 +1,7 @@ from typing import TYPE_CHECKING, List if TYPE_CHECKING: - pass # TYP005 + pass # TYC005 def example(): diff --git a/ruff.schema.json b/ruff.schema.json index 6a469583a8..2887d6ea1f 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -1777,14 +1777,14 @@ "TRY30", "TRY300", "TRY301", - "TYP", - "TYP0", - "TYP00", - "TYP001", - "TYP002", - "TYP003", - "TYP004", - "TYP005", + "TYC", + "TYC0", + "TYC00", + "TYC001", + "TYC002", + "TYC003", + "TYC004", + "TYC005", "UP", "UP0", "UP00", diff --git a/src/flake8_to_ruff/plugin.rs b/src/flake8_to_ruff/plugin.rs index de2196ac06..77542d4fd0 100644 --- a/src/flake8_to_ruff/plugin.rs +++ b/src/flake8_to_ruff/plugin.rs @@ -160,7 +160,7 @@ impl Plugin { Plugin::Flake8Return => RuleCodePrefix::RET.into(), Plugin::Flake8Simplify => RuleCodePrefix::SIM.into(), Plugin::Flake8TidyImports => RuleCodePrefix::TID.into(), - Plugin::Flake8TypeChecking => RuleCodePrefix::TYP.into(), + Plugin::Flake8TypeChecking => RuleCodePrefix::TYC.into(), Plugin::Flake8UnusedArguments => RuleCodePrefix::ARG.into(), Plugin::Flake8UsePathlib => RuleCodePrefix::PTH.into(), Plugin::McCabe => RuleCodePrefix::C9.into(), diff --git a/src/registry.rs b/src/registry.rs index 93843adb78..b9322bb8d0 100644 --- a/src/registry.rs +++ b/src/registry.rs @@ -429,11 +429,11 @@ ruff_macros::define_rule_mapping!( EXE004 => rules::flake8_executable::rules::ShebangWhitespace, EXE005 => rules::flake8_executable::rules::ShebangNewline, // flake8-type-checking - TYP001 => rules::flake8_type_checking::rules::TypingOnlyFirstPartyImport, - TYP002 => rules::flake8_type_checking::rules::TypingOnlyThirdPartyImport, - TYP003 => rules::flake8_type_checking::rules::TypingOnlyStandardLibraryImport, - TYP004 => rules::flake8_type_checking::rules::RuntimeImportInTypeCheckingBlock, - TYP005 => rules::flake8_type_checking::rules::EmptyTypeCheckingBlock, + TYC001 => rules::flake8_type_checking::rules::TypingOnlyFirstPartyImport, + TYC002 => rules::flake8_type_checking::rules::TypingOnlyThirdPartyImport, + TYC003 => rules::flake8_type_checking::rules::TypingOnlyStandardLibraryImport, + TYC004 => rules::flake8_type_checking::rules::RuntimeImportInTypeCheckingBlock, + TYC005 => rules::flake8_type_checking::rules::EmptyTypeCheckingBlock, // tryceratops TRY004 => rules::tryceratops::rules::PreferTypeError, TRY200 => rules::tryceratops::rules::ReraiseNoCause, @@ -584,7 +584,7 @@ pub enum Linter { #[prefix = "EXE"] Flake8Executable, /// [flake8-type-checking](https://pypi.org/project/flake8-type-checking/) - #[prefix = "TYP"] + #[prefix = "TYC"] Flake8TypeChecking, /// [tryceratops](https://pypi.org/project/tryceratops/1.1.0/) #[prefix = "TRY"] diff --git a/src/rule_redirects.rs b/src/rule_redirects.rs index 6b5f648aaa..d6b4205de5 100644 --- a/src/rule_redirects.rs +++ b/src/rule_redirects.rs @@ -81,5 +81,8 @@ static REDIRECTS: Lazy> = Lazy::new(|| { ("PDV9", "PD9"), ("PDV90", "PD90"), ("PDV901", "PD901"), + // TODO(charlie): Remove by 2023-04-01. + ("TYP", "TYC"), + ("TYP001", "TYC001"), ]) }); diff --git a/src/rules/flake8_type_checking/mod.rs b/src/rules/flake8_type_checking/mod.rs index 3532f2f618..427813b168 100644 --- a/src/rules/flake8_type_checking/mod.rs +++ b/src/rules/flake8_type_checking/mod.rs @@ -14,18 +14,18 @@ mod tests { use crate::registry::Rule; use crate::settings; - #[test_case(Rule::TypingOnlyFirstPartyImport, Path::new("TYP001.py"); "TYP001")] - #[test_case(Rule::TypingOnlyThirdPartyImport, Path::new("TYP002.py"); "TYP002")] - #[test_case(Rule::TypingOnlyStandardLibraryImport, Path::new("TYP003.py"); "TYP003")] - #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYP004_1.py"); "TYP004_1")] - #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYP004_2.py"); "TYP004_2")] - #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYP004_3.py"); "TYP004_3")] - #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYP004_4.py"); "TYP004_4")] - #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYP004_5.py"); "TYP004_5")] - #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYP004_6.py"); "TYP004_6")] - #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYP004_7.py"); "TYP004_7")] - #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYP004_8.py"); "TYP004_8")] - #[test_case(Rule::EmptyTypeCheckingBlock, Path::new("TYP005.py"); "TYP005")] + #[test_case(Rule::TypingOnlyFirstPartyImport, Path::new("TYC001.py"); "TYC001")] + #[test_case(Rule::TypingOnlyThirdPartyImport, Path::new("TYC002.py"); "TYC002")] + #[test_case(Rule::TypingOnlyStandardLibraryImport, Path::new("TYC003.py"); "TYC003")] + #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYC004_1.py"); "TYC004_1")] + #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYC004_2.py"); "TYC004_2")] + #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYC004_3.py"); "TYC004_3")] + #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYC004_4.py"); "TYC004_4")] + #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYC004_5.py"); "TYC004_5")] + #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYC004_6.py"); "TYC004_6")] + #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYC004_7.py"); "TYC004_7")] + #[test_case(Rule::RuntimeImportInTypeCheckingBlock, Path::new("TYC004_8.py"); "TYC004_8")] + #[test_case(Rule::EmptyTypeCheckingBlock, Path::new("TYC005.py"); "TYC005")] fn rules(rule_code: Rule, path: &Path) -> Result<()> { let snapshot = format!("{}_{}", rule_code.as_ref(), path.to_string_lossy()); let diagnostics = test_path( diff --git a/src/rules/flake8_type_checking/rules/empty_type_checking_block.rs b/src/rules/flake8_type_checking/rules/empty_type_checking_block.rs index da67a69c61..a854b50f8a 100644 --- a/src/rules/flake8_type_checking/rules/empty_type_checking_block.rs +++ b/src/rules/flake8_type_checking/rules/empty_type_checking_block.rs @@ -17,7 +17,7 @@ impl Violation for EmptyTypeCheckingBlock { } } -/// TYP005 +/// TYC005 pub fn empty_type_checking_block(checker: &mut Checker, test: &Expr, body: &[Stmt]) { if checker.resolve_call_path(test).map_or(false, |call_path| { call_path.as_slice() == ["typing", "TYPE_CHECKING"] diff --git a/src/rules/flake8_type_checking/rules/runtime_import_in_type_checking_block.rs b/src/rules/flake8_type_checking/rules/runtime_import_in_type_checking_block.rs index 88c917027a..867a808c94 100644 --- a/src/rules/flake8_type_checking/rules/runtime_import_in_type_checking_block.rs +++ b/src/rules/flake8_type_checking/rules/runtime_import_in_type_checking_block.rs @@ -22,7 +22,7 @@ impl Violation for RuntimeImportInTypeCheckingBlock { } } -/// TYP004 +/// TYC004 pub fn runtime_import_in_type_checking_block( binding: &Binding, blocks: &[&Stmt], diff --git a/src/rules/flake8_type_checking/rules/typing_only_runtime_import.rs b/src/rules/flake8_type_checking/rules/typing_only_runtime_import.rs index 716a0cd30b..0a9c60e13d 100644 --- a/src/rules/flake8_type_checking/rules/typing_only_runtime_import.rs +++ b/src/rules/flake8_type_checking/rules/typing_only_runtime_import.rs @@ -55,7 +55,7 @@ impl Violation for TypingOnlyStandardLibraryImport { } } -/// TYP001 +/// TYC001 pub fn typing_only_runtime_import( binding: &Binding, blocks: &[&Stmt], diff --git a/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TYP005.py.snap b/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TYC005.py.snap similarity index 100% rename from src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TYP005.py.snap rename to src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TYC005.py.snap diff --git a/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_1.py.snap b/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_1.py.snap similarity index 100% rename from src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_1.py.snap rename to src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_1.py.snap diff --git a/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_2.py.snap b/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_2.py.snap similarity index 100% rename from src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_2.py.snap rename to src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_2.py.snap diff --git a/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_3.py.snap b/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_3.py.snap similarity index 100% rename from src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_3.py.snap rename to src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_3.py.snap diff --git a/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_4.py.snap b/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_4.py.snap similarity index 100% rename from src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_4.py.snap rename to src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_4.py.snap diff --git a/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_5.py.snap b/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_5.py.snap similarity index 100% rename from src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_5.py.snap rename to src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_5.py.snap diff --git a/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_6.py.snap b/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_6.py.snap similarity index 100% rename from src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_6.py.snap rename to src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_6.py.snap diff --git a/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_7.py.snap b/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_7.py.snap similarity index 100% rename from src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_7.py.snap rename to src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_7.py.snap diff --git a/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_8.py.snap b/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_8.py.snap similarity index 100% rename from src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYP004_8.py.snap rename to src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TYC004_8.py.snap diff --git a/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TYP001.py.snap b/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TYC001.py.snap similarity index 100% rename from src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TYP001.py.snap rename to src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TYC001.py.snap diff --git a/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TYP003.py.snap b/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TYC003.py.snap similarity index 100% rename from src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TYP003.py.snap rename to src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TYC003.py.snap diff --git a/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TYP002.py.snap b/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TYC002.py.snap similarity index 100% rename from src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TYP002.py.snap rename to src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TYC002.py.snap diff --git a/src/settings/mod.rs b/src/settings/mod.rs index 709399a858..9613dc6bef 100644 --- a/src/settings/mod.rs +++ b/src/settings/mod.rs @@ -358,7 +358,7 @@ fn resolve_codes<'a>(specs: impl IntoIterator>) -> FxHas for (from, target) in redirects { // TODO(martin): This belongs into the ruff_cli crate. - crate::warn_user!("`{from}` has been remapped to `{}`", target.as_ref()); + crate::warn_user!("`{from}` has been remapped to `{}`.", target.as_ref()); } rules