diff --git a/src/autofix/fixer.rs b/src/autofix/fixer.rs index d55e03b00b..04e42573a3 100644 --- a/src/autofix/fixer.rs +++ b/src/autofix/fixer.rs @@ -9,7 +9,6 @@ use crate::ast::types::Range; use crate::autofix::Fix; use crate::registry::Check; use crate::source_code_locator::SourceCodeLocator; -use crate::violations; #[derive(Debug, Copy, Clone, Hash)] pub enum Mode { diff --git a/src/checkers/ast.rs b/src/checkers/ast.rs index 25b912981c..6db1e62872 100644 --- a/src/checkers/ast.rs +++ b/src/checkers/ast.rs @@ -30,7 +30,7 @@ use crate::python::builtins::{BUILTINS, MAGIC_GLOBALS}; use crate::python::future::ALL_FEATURE_NAMES; use crate::python::typing; use crate::python::typing::SubscriptKind; -use crate::registry::{Check, CheckCode, CheckKind, DeferralKeyword}; +use crate::registry::{Check, CheckCode, DeferralKeyword}; use crate::settings::types::PythonVersion; use crate::settings::{flags, Settings}; use crate::source_code_locator::SourceCodeLocator; diff --git a/src/checkers/imports.rs b/src/checkers/imports.rs index b2a1d61c0a..11715c195b 100644 --- a/src/checkers/imports.rs +++ b/src/checkers/imports.rs @@ -6,12 +6,12 @@ use rustpython_parser::ast::Suite; use crate::ast::visitor::Visitor; use crate::directives::IsortDirectives; +use crate::isort; use crate::isort::track::ImportTracker; use crate::registry::Check; use crate::settings::{flags, Settings}; use crate::source_code_locator::SourceCodeLocator; use crate::source_code_style::SourceCodeStyleDetector; -use crate::{isort, violations}; fn check_import_blocks( tracker: ImportTracker, diff --git a/src/checkers/lines.rs b/src/checkers/lines.rs index 5c5ad7214b..6cd8d5397f 100644 --- a/src/checkers/lines.rs +++ b/src/checkers/lines.rs @@ -5,7 +5,6 @@ use crate::pygrep_hooks::plugins::{blanket_noqa, blanket_type_ignore}; use crate::pyupgrade::checks::unnecessary_coding_comment; use crate::registry::{Check, CheckCode}; use crate::settings::{flags, Settings}; -use crate::violations; pub fn check_lines( contents: &str, @@ -83,7 +82,6 @@ mod tests { use super::check_lines; use crate::registry::CheckCode; use crate::settings::{flags, Settings}; - use crate::violations; #[test] fn e501_non_ascii_char() { diff --git a/src/checkers/tokens.rs b/src/checkers/tokens.rs index e69bd5ca87..b5d3f4230c 100644 --- a/src/checkers/tokens.rs +++ b/src/checkers/tokens.rs @@ -7,9 +7,7 @@ use crate::registry::{Check, CheckCode}; use crate::ruff::checks::Context; use crate::settings::flags; use crate::source_code_locator::SourceCodeLocator; -use crate::{ - eradicate, flake8_implicit_str_concat, flake8_quotes, pycodestyle, ruff, violations, Settings, -}; +use crate::{eradicate, flake8_implicit_str_concat, flake8_quotes, pycodestyle, ruff, Settings}; pub fn check_tokens( locator: &SourceCodeLocator, diff --git a/src/cli.rs b/src/cli.rs index 23bf3a2ad0..4c3a051686 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -4,12 +4,12 @@ use clap::{command, Parser}; use regex::Regex; use rustc_hash::FxHashMap; +use crate::fs; use crate::logging::LogLevel; use crate::registry::{CheckCode, CheckCodePrefix}; use crate::settings::types::{ FilePattern, PatternPrefixPair, PerFileIgnore, PythonVersion, SerializationFormat, }; -use crate::{fs, violations}; #[derive(Debug, Parser)] #[command(author, about = "Ruff: An extremely fast Python linter.")] diff --git a/src/commands.rs b/src/commands.rs index a7160e436b..eb34b9082c 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -22,7 +22,7 @@ use crate::iterators::par_iter; use crate::linter::{add_noqa_to_path, lint_path, lint_stdin, Diagnostics}; use crate::logging::LogLevel; use crate::message::Message; -use crate::registry::{CheckCode, CheckKind}; +use crate::registry::CheckCode; use crate::resolver::{FileDiscovery, PyprojectDiscovery}; use crate::settings::flags; use crate::settings::types::SerializationFormat; diff --git a/src/directives.rs b/src/directives.rs index 3623008c64..27c9eef777 100644 --- a/src/directives.rs +++ b/src/directives.rs @@ -6,7 +6,7 @@ use rustpython_ast::Location; use rustpython_parser::lexer::{LexResult, Tok}; use crate::registry::LintSource; -use crate::{violations, Settings}; +use crate::Settings; bitflags! { pub struct Flags: u32 { diff --git a/src/eradicate/checks.rs b/src/eradicate/checks.rs index da7942f3f5..678e73bc84 100644 --- a/src/eradicate/checks.rs +++ b/src/eradicate/checks.rs @@ -3,7 +3,7 @@ use rustpython_ast::Location; use crate::ast::types::Range; use crate::autofix::Fix; use crate::eradicate::detection::comment_contains_code; -use crate::registry::{CheckCode, CheckKind}; +use crate::registry::CheckCode; use crate::settings::flags; use crate::{violations, Check, Settings, SourceCodeLocator}; diff --git a/src/eradicate/mod.rs b/src/eradicate/mod.rs index 7ab7d5d4bc..ba8f7d0bf6 100644 --- a/src/eradicate/mod.rs +++ b/src/eradicate/mod.rs @@ -11,7 +11,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::ERA001, Path::new("ERA001.py"); "ERA001")] fn checks(check_code: CheckCode, path: &Path) -> Result<()> { diff --git a/src/flake8_2020/mod.rs b/src/flake8_2020/mod.rs index 726c862181..12d65add56 100644 --- a/src/flake8_2020/mod.rs +++ b/src/flake8_2020/mod.rs @@ -10,7 +10,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::YTT101, Path::new("YTT101.py"); "YTT101")] #[test_case(CheckCode::YTT102, Path::new("YTT102.py"); "YTT102")] diff --git a/src/flake8_2020/plugins.rs b/src/flake8_2020/plugins.rs index 7429024696..1c3dc61d04 100644 --- a/src/flake8_2020/plugins.rs +++ b/src/flake8_2020/plugins.rs @@ -4,7 +4,7 @@ use rustpython_ast::{Cmpop, Constant, Expr, ExprKind, Located}; use crate::ast::helpers::match_module_member; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; fn is_sys(checker: &Checker, expr: &Expr, target: &str) -> bool { diff --git a/src/flake8_annotations/mod.rs b/src/flake8_annotations/mod.rs index a605b3935a..408376bbc7 100644 --- a/src/flake8_annotations/mod.rs +++ b/src/flake8_annotations/mod.rs @@ -11,7 +11,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{flake8_annotations, violations, Settings}; + use crate::{flake8_annotations, Settings}; #[test] fn defaults() -> Result<()> { diff --git a/src/flake8_annotations/plugins.rs b/src/flake8_annotations/plugins.rs index 3aaee8fe67..0e82759ddf 100644 --- a/src/flake8_annotations/plugins.rs +++ b/src/flake8_annotations/plugins.rs @@ -8,7 +8,7 @@ use crate::checkers::ast::Checker; use crate::docstrings::definition::{Definition, DefinitionKind}; use crate::flake8_annotations::fixes; use crate::flake8_annotations::helpers::match_function_def; -use crate::registry::{CheckCode, CheckKind}; +use crate::registry::CheckCode; use crate::visibility::Visibility; use crate::{violations, visibility, Check}; diff --git a/src/flake8_bandit/checks/assert_used.rs b/src/flake8_bandit/checks/assert_used.rs index 8b19c75c9f..0f540f7b51 100644 --- a/src/flake8_bandit/checks/assert_used.rs +++ b/src/flake8_bandit/checks/assert_used.rs @@ -1,7 +1,7 @@ use rustpython_ast::{Located, StmtKind}; use crate::ast::types::Range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// S101 diff --git a/src/flake8_bandit/checks/bad_file_permissions.rs b/src/flake8_bandit/checks/bad_file_permissions.rs index 08119a7aad..5077d4610c 100644 --- a/src/flake8_bandit/checks/bad_file_permissions.rs +++ b/src/flake8_bandit/checks/bad_file_permissions.rs @@ -5,7 +5,7 @@ use rustpython_ast::{Constant, Expr, ExprKind, Keyword, Operator}; use crate::ast::helpers::{compose_call_path, match_module_member, SimpleCallArgs}; use crate::ast::types::Range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; const WRITE_WORLD: u16 = 0o2; diff --git a/src/flake8_bandit/checks/exec_used.rs b/src/flake8_bandit/checks/exec_used.rs index c843f9a976..e92ec22e0b 100644 --- a/src/flake8_bandit/checks/exec_used.rs +++ b/src/flake8_bandit/checks/exec_used.rs @@ -1,7 +1,7 @@ use rustpython_ast::{Expr, ExprKind}; use crate::ast::types::Range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// S102 diff --git a/src/flake8_bandit/checks/hardcoded_bind_all_interfaces.rs b/src/flake8_bandit/checks/hardcoded_bind_all_interfaces.rs index 49dc24c86a..093df44d08 100644 --- a/src/flake8_bandit/checks/hardcoded_bind_all_interfaces.rs +++ b/src/flake8_bandit/checks/hardcoded_bind_all_interfaces.rs @@ -1,5 +1,5 @@ use crate::ast::types::Range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// S104 diff --git a/src/flake8_bandit/checks/hardcoded_password_default.rs b/src/flake8_bandit/checks/hardcoded_password_default.rs index cbf02e439c..8173dd653e 100644 --- a/src/flake8_bandit/checks/hardcoded_password_default.rs +++ b/src/flake8_bandit/checks/hardcoded_password_default.rs @@ -2,7 +2,7 @@ use rustpython_ast::{ArgData, Arguments, Expr, Located}; use crate::ast::types::Range; use crate::flake8_bandit::helpers::{matches_password_name, string_literal}; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; fn check_password_kwarg(arg: &Located, default: &Expr) -> Option { diff --git a/src/flake8_bandit/checks/hardcoded_password_func_arg.rs b/src/flake8_bandit/checks/hardcoded_password_func_arg.rs index 9c8b7a6bf1..5f1bfceae7 100644 --- a/src/flake8_bandit/checks/hardcoded_password_func_arg.rs +++ b/src/flake8_bandit/checks/hardcoded_password_func_arg.rs @@ -2,7 +2,7 @@ use rustpython_ast::Keyword; use crate::ast::types::Range; use crate::flake8_bandit::helpers::{matches_password_name, string_literal}; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// S106 diff --git a/src/flake8_bandit/checks/hardcoded_password_string.rs b/src/flake8_bandit/checks/hardcoded_password_string.rs index 0a69503921..b8fb070887 100644 --- a/src/flake8_bandit/checks/hardcoded_password_string.rs +++ b/src/flake8_bandit/checks/hardcoded_password_string.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Constant, Expr, ExprKind}; use crate::ast::types::Range; use crate::flake8_bandit::helpers::{matches_password_name, string_literal}; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; fn is_password_target(target: &Expr) -> bool { diff --git a/src/flake8_bandit/checks/hardcoded_tmp_directory.rs b/src/flake8_bandit/checks/hardcoded_tmp_directory.rs index 901e5dcd78..d744d96ba9 100644 --- a/src/flake8_bandit/checks/hardcoded_tmp_directory.rs +++ b/src/flake8_bandit/checks/hardcoded_tmp_directory.rs @@ -1,7 +1,7 @@ use rustpython_ast::Expr; use crate::ast::types::Range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// S108 diff --git a/src/flake8_bandit/checks/hashlib_insecure_hash_functions.rs b/src/flake8_bandit/checks/hashlib_insecure_hash_functions.rs index 975ffc404c..63f85317e6 100644 --- a/src/flake8_bandit/checks/hashlib_insecure_hash_functions.rs +++ b/src/flake8_bandit/checks/hashlib_insecure_hash_functions.rs @@ -4,7 +4,7 @@ use rustpython_ast::{Constant, Expr, ExprKind, Keyword}; use crate::ast::helpers::{match_module_member, SimpleCallArgs}; use crate::ast::types::Range; use crate::flake8_bandit::helpers::string_literal; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; const WEAK_HASHES: [&str; 4] = ["md4", "md5", "sha", "sha1"]; diff --git a/src/flake8_bandit/checks/request_with_no_cert_validation.rs b/src/flake8_bandit/checks/request_with_no_cert_validation.rs index a7c1c0a126..9ccb6287fc 100644 --- a/src/flake8_bandit/checks/request_with_no_cert_validation.rs +++ b/src/flake8_bandit/checks/request_with_no_cert_validation.rs @@ -4,7 +4,7 @@ use rustpython_parser::ast::Constant; use crate::ast::helpers::{collect_call_paths, dealias_call_path, match_call_path, SimpleCallArgs}; use crate::ast::types::Range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; const REQUESTS_HTTP_VERBS: [&str; 7] = ["get", "options", "head", "post", "put", "patch", "delete"]; diff --git a/src/flake8_bandit/checks/request_without_timeout.rs b/src/flake8_bandit/checks/request_without_timeout.rs index 252a30c4cd..16d977554a 100644 --- a/src/flake8_bandit/checks/request_without_timeout.rs +++ b/src/flake8_bandit/checks/request_without_timeout.rs @@ -4,7 +4,7 @@ use rustpython_parser::ast::Constant; use crate::ast::helpers::{collect_call_paths, dealias_call_path, match_call_path, SimpleCallArgs}; use crate::ast::types::Range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; const HTTP_VERBS: [&str; 7] = ["get", "options", "head", "post", "put", "patch", "delete"]; diff --git a/src/flake8_bandit/checks/unsafe_yaml_load.rs b/src/flake8_bandit/checks/unsafe_yaml_load.rs index 44c725b08c..94919911d8 100644 --- a/src/flake8_bandit/checks/unsafe_yaml_load.rs +++ b/src/flake8_bandit/checks/unsafe_yaml_load.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Expr, ExprKind, Keyword}; use crate::ast::helpers::{match_module_member, SimpleCallArgs}; use crate::ast::types::Range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// S506 diff --git a/src/flake8_bandit/mod.rs b/src/flake8_bandit/mod.rs index f55ac00107..f7ccc5beba 100644 --- a/src/flake8_bandit/mod.rs +++ b/src/flake8_bandit/mod.rs @@ -11,7 +11,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{flake8_bandit, violations, Settings}; + use crate::{flake8_bandit, Settings}; #[test_case(CheckCode::S101, Path::new("S101.py"); "S101")] #[test_case(CheckCode::S102, Path::new("S102.py"); "S102")] diff --git a/src/flake8_blind_except/mod.rs b/src/flake8_blind_except/mod.rs index fd48692b75..a9ded38787 100644 --- a/src/flake8_blind_except/mod.rs +++ b/src/flake8_blind_except/mod.rs @@ -10,7 +10,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::BLE001, Path::new("BLE.py"); "BLE001")] fn checks(check_code: CheckCode, path: &Path) -> Result<()> { diff --git a/src/flake8_blind_except/plugins.rs b/src/flake8_blind_except/plugins.rs index 3fd595f087..e31e541322 100644 --- a/src/flake8_blind_except/plugins.rs +++ b/src/flake8_blind_except/plugins.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Expr, ExprKind, Stmt, StmtKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// BLE001 diff --git a/src/flake8_boolean_trap/mod.rs b/src/flake8_boolean_trap/mod.rs index da482c2335..a067814fa1 100644 --- a/src/flake8_boolean_trap/mod.rs +++ b/src/flake8_boolean_trap/mod.rs @@ -10,7 +10,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::FBT001, Path::new("FBT.py"); "FBT001")] #[test_case(CheckCode::FBT002, Path::new("FBT.py"); "FBT002")] diff --git a/src/flake8_bugbear/mod.rs b/src/flake8_bugbear/mod.rs index f868246103..2ca9f309ed 100644 --- a/src/flake8_bugbear/mod.rs +++ b/src/flake8_bugbear/mod.rs @@ -10,7 +10,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{flake8_bugbear, violations, Settings}; + use crate::{flake8_bugbear, Settings}; #[test_case(CheckCode::B002, Path::new("B002.py"); "B002")] #[test_case(CheckCode::B003, Path::new("B003.py"); "B003")] diff --git a/src/flake8_bugbear/plugins/abstract_base_class.rs b/src/flake8_bugbear/plugins/abstract_base_class.rs index 01a9aa6d41..c00fc60a31 100644 --- a/src/flake8_bugbear/plugins/abstract_base_class.rs +++ b/src/flake8_bugbear/plugins/abstract_base_class.rs @@ -4,7 +4,7 @@ use rustpython_ast::{Constant, Expr, ExprKind, Keyword, Stmt, StmtKind}; use crate::ast::helpers::match_module_member; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; fn is_abc_class( diff --git a/src/flake8_bugbear/plugins/assert_false.rs b/src/flake8_bugbear/plugins/assert_false.rs index 714a81829a..93fcc02fc4 100644 --- a/src/flake8_bugbear/plugins/assert_false.rs +++ b/src/flake8_bugbear/plugins/assert_false.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Constant, Expr, ExprContext, ExprKind, Location, Stmt, Stmt use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::source_code_generator::SourceCodeGenerator; use crate::violations; diff --git a/src/flake8_bugbear/plugins/assert_raises_exception.rs b/src/flake8_bugbear/plugins/assert_raises_exception.rs index 2738f00155..635affbcc4 100644 --- a/src/flake8_bugbear/plugins/assert_raises_exception.rs +++ b/src/flake8_bugbear/plugins/assert_raises_exception.rs @@ -3,7 +3,7 @@ use rustpython_ast::{ExprKind, Stmt, Withitem}; use crate::ast::helpers::match_module_member; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// B017 diff --git a/src/flake8_bugbear/plugins/assignment_to_os_environ.rs b/src/flake8_bugbear/plugins/assignment_to_os_environ.rs index 576858d80b..95d814b8fd 100644 --- a/src/flake8_bugbear/plugins/assignment_to_os_environ.rs +++ b/src/flake8_bugbear/plugins/assignment_to_os_environ.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Expr, ExprKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// B003 diff --git a/src/flake8_bugbear/plugins/cached_instance_method.rs b/src/flake8_bugbear/plugins/cached_instance_method.rs index d7478a9f68..86cc21e932 100644 --- a/src/flake8_bugbear/plugins/cached_instance_method.rs +++ b/src/flake8_bugbear/plugins/cached_instance_method.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Expr, ExprKind}; use crate::ast::helpers::{collect_call_paths, dealias_call_path, match_call_path}; use crate::ast::types::{Range, ScopeKind}; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; fn is_cache_func(checker: &Checker, expr: &Expr) -> bool { diff --git a/src/flake8_bugbear/plugins/cannot_raise_literal.rs b/src/flake8_bugbear/plugins/cannot_raise_literal.rs index d42baf0109..55a4adb1cb 100644 --- a/src/flake8_bugbear/plugins/cannot_raise_literal.rs +++ b/src/flake8_bugbear/plugins/cannot_raise_literal.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Expr, ExprKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// B016 diff --git a/src/flake8_bugbear/plugins/duplicate_exceptions.rs b/src/flake8_bugbear/plugins/duplicate_exceptions.rs index ec80d6abab..34d6d8872a 100644 --- a/src/flake8_bugbear/plugins/duplicate_exceptions.rs +++ b/src/flake8_bugbear/plugins/duplicate_exceptions.rs @@ -6,7 +6,7 @@ use crate::ast::helpers; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::source_code_generator::SourceCodeGenerator; use crate::violations; diff --git a/src/flake8_bugbear/plugins/f_string_docstring.rs b/src/flake8_bugbear/plugins/f_string_docstring.rs index 0098942b5e..56ebd1dc23 100644 --- a/src/flake8_bugbear/plugins/f_string_docstring.rs +++ b/src/flake8_bugbear/plugins/f_string_docstring.rs @@ -2,7 +2,7 @@ use rustpython_ast::{ExprKind, Stmt, StmtKind}; use crate::ast::helpers; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// B021 diff --git a/src/flake8_bugbear/plugins/function_uses_loop_variable.rs b/src/flake8_bugbear/plugins/function_uses_loop_variable.rs index 92048beabc..e5d2aa35f8 100644 --- a/src/flake8_bugbear/plugins/function_uses_loop_variable.rs +++ b/src/flake8_bugbear/plugins/function_uses_loop_variable.rs @@ -6,7 +6,7 @@ use crate::ast::types::{Node, Range}; use crate::ast::visitor; use crate::ast::visitor::Visitor; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; #[derive(Default)] diff --git a/src/flake8_bugbear/plugins/getattr_with_constant.rs b/src/flake8_bugbear/plugins/getattr_with_constant.rs index 3d81842d0c..05c86e2225 100644 --- a/src/flake8_bugbear/plugins/getattr_with_constant.rs +++ b/src/flake8_bugbear/plugins/getattr_with_constant.rs @@ -5,7 +5,7 @@ use crate::autofix::Fix; use crate::checkers::ast::Checker; use crate::python::identifiers::IDENTIFIER_REGEX; use crate::python::keyword::KWLIST; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::source_code_generator::SourceCodeGenerator; use crate::violations; diff --git a/src/flake8_bugbear/plugins/jump_statement_in_finally.rs b/src/flake8_bugbear/plugins/jump_statement_in_finally.rs index ce500f2ad7..6715568bae 100644 --- a/src/flake8_bugbear/plugins/jump_statement_in_finally.rs +++ b/src/flake8_bugbear/plugins/jump_statement_in_finally.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Stmt, StmtKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; fn walk_stmt(checker: &mut Checker, body: &[Stmt], f: fn(&Stmt) -> bool) { diff --git a/src/flake8_bugbear/plugins/loop_variable_overrides_iterator.rs b/src/flake8_bugbear/plugins/loop_variable_overrides_iterator.rs index bf7278b581..f078257abc 100644 --- a/src/flake8_bugbear/plugins/loop_variable_overrides_iterator.rs +++ b/src/flake8_bugbear/plugins/loop_variable_overrides_iterator.rs @@ -5,7 +5,7 @@ use crate::ast::types::Range; use crate::ast::visitor; use crate::ast::visitor::Visitor; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; #[derive(Default)] diff --git a/src/flake8_bugbear/plugins/mutable_argument_default.rs b/src/flake8_bugbear/plugins/mutable_argument_default.rs index b4a3e9b0c3..6b2c74ce5f 100644 --- a/src/flake8_bugbear/plugins/mutable_argument_default.rs +++ b/src/flake8_bugbear/plugins/mutable_argument_default.rs @@ -4,7 +4,7 @@ use rustpython_ast::{Arguments, Constant, Expr, ExprKind, Operator}; use crate::ast::helpers::{collect_call_paths, dealias_call_path, match_call_path}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; const MUTABLE_FUNCS: &[(&str, &str)] = &[ diff --git a/src/flake8_bugbear/plugins/raise_without_from_inside_except.rs b/src/flake8_bugbear/plugins/raise_without_from_inside_except.rs index a303a00d2b..a1ca215adf 100644 --- a/src/flake8_bugbear/plugins/raise_without_from_inside_except.rs +++ b/src/flake8_bugbear/plugins/raise_without_from_inside_except.rs @@ -4,7 +4,7 @@ use crate::ast::types::Range; use crate::ast::visitor::Visitor; use crate::checkers::ast::Checker; use crate::python::string::is_lower; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; struct RaiseVisitor { diff --git a/src/flake8_bugbear/plugins/redundant_tuple_in_exception_handler.rs b/src/flake8_bugbear/plugins/redundant_tuple_in_exception_handler.rs index 16db47779c..0661640e10 100644 --- a/src/flake8_bugbear/plugins/redundant_tuple_in_exception_handler.rs +++ b/src/flake8_bugbear/plugins/redundant_tuple_in_exception_handler.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Excepthandler, ExcepthandlerKind, ExprKind}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::source_code_generator::SourceCodeGenerator; use crate::violations; diff --git a/src/flake8_bugbear/plugins/setattr_with_constant.rs b/src/flake8_bugbear/plugins/setattr_with_constant.rs index b6583dfed7..6a06612d76 100644 --- a/src/flake8_bugbear/plugins/setattr_with_constant.rs +++ b/src/flake8_bugbear/plugins/setattr_with_constant.rs @@ -5,7 +5,7 @@ use crate::autofix::Fix; use crate::checkers::ast::Checker; use crate::python::identifiers::IDENTIFIER_REGEX; use crate::python::keyword::KWLIST; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::source_code_generator::SourceCodeGenerator; use crate::source_code_style::SourceCodeStyleDetector; use crate::violations; diff --git a/src/flake8_bugbear/plugins/star_arg_unpacking_after_keyword_arg.rs b/src/flake8_bugbear/plugins/star_arg_unpacking_after_keyword_arg.rs index 1c6a4b4d41..286056e90b 100644 --- a/src/flake8_bugbear/plugins/star_arg_unpacking_after_keyword_arg.rs +++ b/src/flake8_bugbear/plugins/star_arg_unpacking_after_keyword_arg.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Expr, ExprKind, Keyword}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// B026 diff --git a/src/flake8_bugbear/plugins/strip_with_multi_characters.rs b/src/flake8_bugbear/plugins/strip_with_multi_characters.rs index 8e4ed13961..9a59c054db 100644 --- a/src/flake8_bugbear/plugins/strip_with_multi_characters.rs +++ b/src/flake8_bugbear/plugins/strip_with_multi_characters.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Constant, Expr, ExprKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// B005 diff --git a/src/flake8_bugbear/plugins/unary_prefix_increment.rs b/src/flake8_bugbear/plugins/unary_prefix_increment.rs index 099ebabb65..01c247c4a8 100644 --- a/src/flake8_bugbear/plugins/unary_prefix_increment.rs +++ b/src/flake8_bugbear/plugins/unary_prefix_increment.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Expr, ExprKind, Unaryop}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// B002 diff --git a/src/flake8_bugbear/plugins/unreliable_callable_check.rs b/src/flake8_bugbear/plugins/unreliable_callable_check.rs index 9ce65db10f..96a44ae730 100644 --- a/src/flake8_bugbear/plugins/unreliable_callable_check.rs +++ b/src/flake8_bugbear/plugins/unreliable_callable_check.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Constant, Expr, ExprKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// B004 diff --git a/src/flake8_bugbear/plugins/unused_loop_control_variable.rs b/src/flake8_bugbear/plugins/unused_loop_control_variable.rs index 67d845d842..93120d2b6e 100644 --- a/src/flake8_bugbear/plugins/unused_loop_control_variable.rs +++ b/src/flake8_bugbear/plugins/unused_loop_control_variable.rs @@ -6,7 +6,7 @@ use crate::ast::visitor; use crate::ast::visitor::Visitor; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// Identify all `ExprKind::Name` nodes in an AST. diff --git a/src/flake8_bugbear/plugins/useless_comparison.rs b/src/flake8_bugbear/plugins/useless_comparison.rs index 3fa676ecdb..f3e33aa99b 100644 --- a/src/flake8_bugbear/plugins/useless_comparison.rs +++ b/src/flake8_bugbear/plugins/useless_comparison.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Expr, ExprKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; pub fn useless_comparison(checker: &mut Checker, expr: &Expr) { diff --git a/src/flake8_bugbear/plugins/useless_contextlib_suppress.rs b/src/flake8_bugbear/plugins/useless_contextlib_suppress.rs index 1d2918a7bc..8ff9d2620f 100644 --- a/src/flake8_bugbear/plugins/useless_contextlib_suppress.rs +++ b/src/flake8_bugbear/plugins/useless_contextlib_suppress.rs @@ -3,7 +3,7 @@ use rustpython_ast::Expr; use crate::ast::helpers::{collect_call_paths, match_call_path}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// B005 diff --git a/src/flake8_bugbear/plugins/useless_expression.rs b/src/flake8_bugbear/plugins/useless_expression.rs index 9acf62d1db..ea9d82cda9 100644 --- a/src/flake8_bugbear/plugins/useless_expression.rs +++ b/src/flake8_bugbear/plugins/useless_expression.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Constant, ExprKind, Stmt, StmtKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; // B018 diff --git a/src/flake8_bugbear/plugins/zip_without_explicit_strict.rs b/src/flake8_bugbear/plugins/zip_without_explicit_strict.rs index 7170196b1b..260212fa4f 100644 --- a/src/flake8_bugbear/plugins/zip_without_explicit_strict.rs +++ b/src/flake8_bugbear/plugins/zip_without_explicit_strict.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Expr, ExprKind, Keyword}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// B905 diff --git a/src/flake8_builtins/mod.rs b/src/flake8_builtins/mod.rs index 0bab186a11..89f567ca99 100644 --- a/src/flake8_builtins/mod.rs +++ b/src/flake8_builtins/mod.rs @@ -11,7 +11,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::A001, Path::new("A001.py"); "A001")] #[test_case(CheckCode::A002, Path::new("A002.py"); "A002")] diff --git a/src/flake8_comprehensions/checks.rs b/src/flake8_comprehensions/checks.rs index 01b862f00a..173ec98090 100644 --- a/src/flake8_comprehensions/checks.rs +++ b/src/flake8_comprehensions/checks.rs @@ -6,7 +6,7 @@ use rustpython_ast::{ use crate::ast::types::Range; use crate::flake8_comprehensions::fixes; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::source_code_locator::SourceCodeLocator; use crate::violations; diff --git a/src/flake8_comprehensions/mod.rs b/src/flake8_comprehensions/mod.rs index 9efa9a25df..476c7a8d8a 100644 --- a/src/flake8_comprehensions/mod.rs +++ b/src/flake8_comprehensions/mod.rs @@ -11,7 +11,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::C400, Path::new("C400.py"); "C400")] #[test_case(CheckCode::C401, Path::new("C401.py"); "C401")] diff --git a/src/flake8_datetimez/mod.rs b/src/flake8_datetimez/mod.rs index 6f93ff116f..5818473ffe 100644 --- a/src/flake8_datetimez/mod.rs +++ b/src/flake8_datetimez/mod.rs @@ -10,7 +10,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::DTZ001, Path::new("DTZ001.py"); "DTZ001")] #[test_case(CheckCode::DTZ002, Path::new("DTZ002.py"); "DTZ002")] diff --git a/src/flake8_datetimez/plugins.rs b/src/flake8_datetimez/plugins.rs index 400fdd8b43..80da2f6a72 100644 --- a/src/flake8_datetimez/plugins.rs +++ b/src/flake8_datetimez/plugins.rs @@ -5,7 +5,7 @@ use crate::ast::helpers::{ }; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; pub fn call_datetime_without_tzinfo( diff --git a/src/flake8_debugger/checks.rs b/src/flake8_debugger/checks.rs index ac5a3908fb..2f34c8d3e7 100644 --- a/src/flake8_debugger/checks.rs +++ b/src/flake8_debugger/checks.rs @@ -4,7 +4,7 @@ use rustpython_ast::{Expr, Stmt}; use crate::ast::helpers::{collect_call_paths, dealias_call_path, match_call_path}; use crate::ast::types::Range; use crate::flake8_debugger::types::DebuggerUsingType; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; const DEBUGGERS: &[(&str, &str)] = &[ diff --git a/src/flake8_debugger/mod.rs b/src/flake8_debugger/mod.rs index 1077be6ea7..05c8d29729 100644 --- a/src/flake8_debugger/mod.rs +++ b/src/flake8_debugger/mod.rs @@ -11,7 +11,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::T100, Path::new("T100.py"); "T100")] fn checks(check_code: CheckCode, path: &Path) -> Result<()> { diff --git a/src/flake8_errmsg/mod.rs b/src/flake8_errmsg/mod.rs index ced18169fa..f47de47101 100644 --- a/src/flake8_errmsg/mod.rs +++ b/src/flake8_errmsg/mod.rs @@ -9,7 +9,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{flake8_errmsg, settings, violations}; + use crate::{flake8_errmsg, settings}; #[test] fn defaults() -> Result<()> { diff --git a/src/flake8_errmsg/plugins.rs b/src/flake8_errmsg/plugins.rs index 3e6c7b58d8..d00f306aa4 100644 --- a/src/flake8_errmsg/plugins.rs +++ b/src/flake8_errmsg/plugins.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Constant, Expr, ExprKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; /// EM101, EM102, EM103 diff --git a/src/flake8_implicit_str_concat/checks.rs b/src/flake8_implicit_str_concat/checks.rs index d2f0727b5a..136627641e 100644 --- a/src/flake8_implicit_str_concat/checks.rs +++ b/src/flake8_implicit_str_concat/checks.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Constant, Expr, ExprKind, Location, Operator}; use rustpython_parser::lexer::{LexResult, Tok}; use crate::ast::types::Range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::source_code_locator::SourceCodeLocator; use crate::violations; diff --git a/src/flake8_implicit_str_concat/mod.rs b/src/flake8_implicit_str_concat/mod.rs index 0cec6df033..5c0af90c92 100644 --- a/src/flake8_implicit_str_concat/mod.rs +++ b/src/flake8_implicit_str_concat/mod.rs @@ -10,7 +10,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::ISC001, Path::new("ISC.py"); "ISC001")] #[test_case(CheckCode::ISC002, Path::new("ISC.py"); "ISC002")] diff --git a/src/flake8_import_conventions/checks.rs b/src/flake8_import_conventions/checks.rs index 9617ac02cb..6577e15e58 100644 --- a/src/flake8_import_conventions/checks.rs +++ b/src/flake8_import_conventions/checks.rs @@ -2,7 +2,7 @@ use rustc_hash::FxHashMap; use rustpython_ast::Stmt; use crate::ast::types::Range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// ICN001 diff --git a/src/flake8_import_conventions/mod.rs b/src/flake8_import_conventions/mod.rs index 37839319eb..b51aec7794 100644 --- a/src/flake8_import_conventions/mod.rs +++ b/src/flake8_import_conventions/mod.rs @@ -11,7 +11,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{flake8_import_conventions, violations, Settings}; + use crate::{flake8_import_conventions, Settings}; #[test] fn defaults() -> Result<()> { diff --git a/src/flake8_pie/mod.rs b/src/flake8_pie/mod.rs index d66d4241fe..d917732a6e 100644 --- a/src/flake8_pie/mod.rs +++ b/src/flake8_pie/mod.rs @@ -10,7 +10,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::PIE790, Path::new("PIE790.py"); "PIE790")] #[test_case(CheckCode::PIE794, Path::new("PIE794.py"); "PIE794")] diff --git a/src/flake8_pie/plugins.rs b/src/flake8_pie/plugins.rs index 6562d8d0fc..06029d5098 100644 --- a/src/flake8_pie/plugins.rs +++ b/src/flake8_pie/plugins.rs @@ -6,7 +6,7 @@ use crate::ast::types::Range; use crate::autofix::helpers::delete_stmt; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; /// PIE790 diff --git a/src/flake8_print/mod.rs b/src/flake8_print/mod.rs index bca4b4da08..228d414cd7 100644 --- a/src/flake8_print/mod.rs +++ b/src/flake8_print/mod.rs @@ -10,7 +10,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::T201, Path::new("T201.py"); "T201")] #[test_case(CheckCode::T203, Path::new("T203.py"); "T203")] diff --git a/src/flake8_print/plugins/print_call.rs b/src/flake8_print/plugins/print_call.rs index 206255445a..df50a0f945 100644 --- a/src/flake8_print/plugins/print_call.rs +++ b/src/flake8_print/plugins/print_call.rs @@ -5,7 +5,7 @@ use crate::ast::helpers::{collect_call_paths, dealias_call_path, is_const_none, use crate::ast::types::Range; use crate::autofix::helpers; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// T201, T203 diff --git a/src/flake8_pytest_style/mod.rs b/src/flake8_pytest_style/mod.rs index bab8fd877d..a56922899e 100644 --- a/src/flake8_pytest_style/mod.rs +++ b/src/flake8_pytest_style/mod.rs @@ -13,7 +13,7 @@ mod tests { use crate::flake8_pytest_style::types; use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::PT001, Path::new("PT001.py"), Settings::default(), "PT001_default"; "PT001_0")] #[test_case( diff --git a/src/flake8_pytest_style/plugins/assertion.rs b/src/flake8_pytest_style/plugins/assertion.rs index 28dcec732a..c472bc61c1 100644 --- a/src/flake8_pytest_style/plugins/assertion.rs +++ b/src/flake8_pytest_style/plugins/assertion.rs @@ -10,7 +10,7 @@ use crate::ast::visitor; use crate::ast::visitor::Visitor; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// Visitor that tracks assert statements and checks if they reference diff --git a/src/flake8_pytest_style/plugins/fail.rs b/src/flake8_pytest_style/plugins/fail.rs index 8234ecc404..0e2a161c45 100644 --- a/src/flake8_pytest_style/plugins/fail.rs +++ b/src/flake8_pytest_style/plugins/fail.rs @@ -4,7 +4,7 @@ use super::helpers::{is_empty_or_null_string, is_pytest_fail}; use crate::ast::helpers::SimpleCallArgs; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; pub fn fail_call(checker: &mut Checker, call: &Expr, args: &[Expr], keywords: &[Keyword]) { diff --git a/src/flake8_pytest_style/plugins/fixture.rs b/src/flake8_pytest_style/plugins/fixture.rs index bbf90c0cef..cc5f94fd2f 100644 --- a/src/flake8_pytest_style/plugins/fixture.rs +++ b/src/flake8_pytest_style/plugins/fixture.rs @@ -10,7 +10,7 @@ use crate::ast::visitor; use crate::ast::visitor::Visitor; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; #[derive(Default)] diff --git a/src/flake8_pytest_style/plugins/imports.rs b/src/flake8_pytest_style/plugins/imports.rs index 5ddd982d3f..b75fe22236 100644 --- a/src/flake8_pytest_style/plugins/imports.rs +++ b/src/flake8_pytest_style/plugins/imports.rs @@ -1,7 +1,7 @@ use rustpython_ast::Stmt; use crate::ast::types::Range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; fn is_pytest_or_subpackage(imported_name: &str) -> bool { diff --git a/src/flake8_pytest_style/plugins/marks.rs b/src/flake8_pytest_style/plugins/marks.rs index cbf8e0097e..c30e53f234 100644 --- a/src/flake8_pytest_style/plugins/marks.rs +++ b/src/flake8_pytest_style/plugins/marks.rs @@ -4,7 +4,7 @@ use super::helpers::{get_mark_decorators, get_mark_name}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; fn pytest_mark_parentheses( diff --git a/src/flake8_pytest_style/plugins/parametrize.rs b/src/flake8_pytest_style/plugins/parametrize.rs index 5ed3005a2d..aff862808e 100644 --- a/src/flake8_pytest_style/plugins/parametrize.rs +++ b/src/flake8_pytest_style/plugins/parametrize.rs @@ -6,7 +6,7 @@ use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; use crate::flake8_pytest_style::types; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::source_code_generator::SourceCodeGenerator; use crate::violations; diff --git a/src/flake8_pytest_style/plugins/patch.rs b/src/flake8_pytest_style/plugins/patch.rs index a30af0477d..58b6f07c3a 100644 --- a/src/flake8_pytest_style/plugins/patch.rs +++ b/src/flake8_pytest_style/plugins/patch.rs @@ -5,7 +5,7 @@ use crate::ast::helpers::{collect_arg_names, compose_call_path, SimpleCallArgs}; use crate::ast::types::Range; use crate::ast::visitor; use crate::ast::visitor::Visitor; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; const PATCH_NAMES: &[&str] = &[ diff --git a/src/flake8_pytest_style/plugins/raises.rs b/src/flake8_pytest_style/plugins/raises.rs index f3d452cbb6..77d89a3a97 100644 --- a/src/flake8_pytest_style/plugins/raises.rs +++ b/src/flake8_pytest_style/plugins/raises.rs @@ -8,7 +8,7 @@ use crate::ast::helpers::{ }; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; fn is_pytest_raises( diff --git a/src/flake8_quotes/checks.rs b/src/flake8_quotes/checks.rs index 9c54aea444..5d1910296e 100644 --- a/src/flake8_quotes/checks.rs +++ b/src/flake8_quotes/checks.rs @@ -2,7 +2,7 @@ use rustpython_ast::Location; use crate::ast::types::Range; use crate::flake8_quotes::settings::{Quote, Settings}; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::source_code_locator::SourceCodeLocator; use crate::violations; diff --git a/src/flake8_quotes/mod.rs b/src/flake8_quotes/mod.rs index f12cb63ffe..7eba2bcae9 100644 --- a/src/flake8_quotes/mod.rs +++ b/src/flake8_quotes/mod.rs @@ -11,7 +11,7 @@ mod tests { use crate::flake8_quotes::settings::Quote; use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{flake8_quotes, violations, Settings}; + use crate::{flake8_quotes, Settings}; #[test_case(Path::new("doubles.py"))] #[test_case(Path::new("doubles_escaped.py"))] diff --git a/src/flake8_return/mod.rs b/src/flake8_return/mod.rs index 4bd9750a2d..bbc91b72af 100644 --- a/src/flake8_return/mod.rs +++ b/src/flake8_return/mod.rs @@ -11,7 +11,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{violations, Settings}; + use crate::Settings; #[test_case(CheckCode::RET501, Path::new("RET501.py"); "RET501")] #[test_case(CheckCode::RET502, Path::new("RET502.py"); "RET502")] diff --git a/src/flake8_return/plugins.rs b/src/flake8_return/plugins.rs index a237c25150..3f2adad95a 100644 --- a/src/flake8_return/plugins.rs +++ b/src/flake8_return/plugins.rs @@ -8,7 +8,7 @@ use crate::autofix::Fix; use crate::checkers::ast::Checker; use crate::flake8_return::helpers::result_exists; use crate::flake8_return::visitor::{ReturnVisitor, Stack}; -use crate::registry::{Branch, CheckCode, CheckKind}; +use crate::registry::{Branch, CheckCode}; use crate::{violations, Check}; /// RET501 diff --git a/src/flake8_simplify/mod.rs b/src/flake8_simplify/mod.rs index 69300f5b4e..ea5f7e60d7 100644 --- a/src/flake8_simplify/mod.rs +++ b/src/flake8_simplify/mod.rs @@ -10,7 +10,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::SIM101, Path::new("SIM101.py"); "SIM101")] #[test_case(CheckCode::SIM102, Path::new("SIM102.py"); "SIM102")] diff --git a/src/flake8_simplify/plugins/ast_bool_op.rs b/src/flake8_simplify/plugins/ast_bool_op.rs index d628aa616c..d98b6d8e96 100644 --- a/src/flake8_simplify/plugins/ast_bool_op.rs +++ b/src/flake8_simplify/plugins/ast_bool_op.rs @@ -9,7 +9,7 @@ use crate::ast::helpers::{create_expr, unparse_expr}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; /// Return `true` if two `Expr` instances are equivalent names. diff --git a/src/flake8_simplify/plugins/ast_for.rs b/src/flake8_simplify/plugins/ast_for.rs index c17510fce5..8de02716ed 100644 --- a/src/flake8_simplify/plugins/ast_for.rs +++ b/src/flake8_simplify/plugins/ast_for.rs @@ -6,7 +6,7 @@ use crate::ast::helpers::{create_expr, create_stmt}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::source_code_generator::SourceCodeGenerator; use crate::source_code_style::SourceCodeStyleDetector; use crate::violations; diff --git a/src/flake8_simplify/plugins/ast_if.rs b/src/flake8_simplify/plugins/ast_if.rs index 631a506c89..a39528228e 100644 --- a/src/flake8_simplify/plugins/ast_if.rs +++ b/src/flake8_simplify/plugins/ast_if.rs @@ -4,7 +4,7 @@ use crate::ast::helpers::{create_expr, create_stmt, unparse_expr, unparse_stmt}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; fn is_main_check(expr: &Expr) -> bool { diff --git a/src/flake8_simplify/plugins/ast_with.rs b/src/flake8_simplify/plugins/ast_with.rs index d5cbf4c5b4..987056c501 100644 --- a/src/flake8_simplify/plugins/ast_with.rs +++ b/src/flake8_simplify/plugins/ast_with.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Stmt, StmtKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// SIM117 diff --git a/src/flake8_simplify/plugins/key_in_dict.rs b/src/flake8_simplify/plugins/key_in_dict.rs index 52772119a2..b5e71cce51 100644 --- a/src/flake8_simplify/plugins/key_in_dict.rs +++ b/src/flake8_simplify/plugins/key_in_dict.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Cmpop, Expr, ExprKind}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// SIM118 diff --git a/src/flake8_simplify/plugins/return_in_try_except_finally.rs b/src/flake8_simplify/plugins/return_in_try_except_finally.rs index 725526253d..50e96a09b5 100644 --- a/src/flake8_simplify/plugins/return_in_try_except_finally.rs +++ b/src/flake8_simplify/plugins/return_in_try_except_finally.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Excepthandler, ExcepthandlerKind, Stmt, StmtKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; fn find_return(stmts: &[Stmt]) -> Option<&Stmt> { diff --git a/src/flake8_simplify/plugins/unary_ops.rs b/src/flake8_simplify/plugins/unary_ops.rs index a0b1c9244c..6509d1fa21 100644 --- a/src/flake8_simplify/plugins/unary_ops.rs +++ b/src/flake8_simplify/plugins/unary_ops.rs @@ -4,7 +4,7 @@ use crate::ast::helpers::{create_expr, unparse_expr}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; fn is_exception_check(stmt: &Stmt) -> bool { diff --git a/src/flake8_simplify/plugins/use_contextlib_suppress.rs b/src/flake8_simplify/plugins/use_contextlib_suppress.rs index 130be2590e..1f7180c38f 100644 --- a/src/flake8_simplify/plugins/use_contextlib_suppress.rs +++ b/src/flake8_simplify/plugins/use_contextlib_suppress.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Excepthandler, ExcepthandlerKind, Stmt, StmtKind}; use crate::ast::helpers; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// SIM105 diff --git a/src/flake8_simplify/plugins/yoda_conditions.rs b/src/flake8_simplify/plugins/yoda_conditions.rs index f54047ce75..c142997ed0 100644 --- a/src/flake8_simplify/plugins/yoda_conditions.rs +++ b/src/flake8_simplify/plugins/yoda_conditions.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Cmpop, Expr, ExprKind}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// SIM300 diff --git a/src/flake8_tidy_imports/checks.rs b/src/flake8_tidy_imports/checks.rs index 9bb16e29bc..7ad61d229a 100644 --- a/src/flake8_tidy_imports/checks.rs +++ b/src/flake8_tidy_imports/checks.rs @@ -6,7 +6,7 @@ use crate::ast::helpers::match_call_path; use crate::ast::types::Range; use crate::checkers::ast::Checker; use crate::flake8_tidy_imports::settings::Strictness; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// TID252 diff --git a/src/flake8_tidy_imports/mod.rs b/src/flake8_tidy_imports/mod.rs index 83c11b26f6..049f2f36e1 100644 --- a/src/flake8_tidy_imports/mod.rs +++ b/src/flake8_tidy_imports/mod.rs @@ -11,7 +11,7 @@ mod tests { use crate::flake8_tidy_imports::settings::{BannedApi, Strictness}; use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{flake8_tidy_imports, violations, Settings}; + use crate::{flake8_tidy_imports, Settings}; #[test] fn ban_parent_imports() -> Result<()> { diff --git a/src/flake8_unused_arguments/mod.rs b/src/flake8_unused_arguments/mod.rs index 8a4702ae6c..eb9ef4d27c 100644 --- a/src/flake8_unused_arguments/mod.rs +++ b/src/flake8_unused_arguments/mod.rs @@ -13,7 +13,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{flake8_unused_arguments, settings, violations}; + use crate::{flake8_unused_arguments, settings}; #[test_case(CheckCode::ARG001, Path::new("ARG.py"); "ARG001")] #[test_case(CheckCode::ARG002, Path::new("ARG.py"); "ARG002")] diff --git a/src/fs.rs b/src/fs.rs index 79ab2ce8ac..74c0fb3a86 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -9,7 +9,6 @@ use path_absolutize::{path_dedot, Absolutize}; use rustc_hash::FxHashSet; use crate::registry::CheckCode; -use crate::violations; /// Extract the absolute path and basename (as strings) from a Path. pub fn extract_path_names(path: &Path) -> Result<(&str, &str)> { diff --git a/src/isort/mod.rs b/src/isort/mod.rs index 10287d4500..ebcff2c24c 100644 --- a/src/isort/mod.rs +++ b/src/isort/mod.rs @@ -634,7 +634,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{isort, violations, Settings}; + use crate::{isort, Settings}; #[test_case(Path::new("add_newline_before_comments.py"))] #[test_case(Path::new("combine_as_imports.py"))] diff --git a/src/isort/plugins.rs b/src/isort/plugins.rs index 9466286e1c..af3bf0a9c6 100644 --- a/src/isort/plugins.rs +++ b/src/isort/plugins.rs @@ -11,7 +11,6 @@ use crate::ast::whitespace::leading_space; use crate::autofix::Fix; use crate::isort::track::Block; use crate::isort::{comments, format_imports}; -use crate::registry::CheckKind; use crate::settings::flags; use crate::source_code_style::SourceCodeStyleDetector; use crate::{violations, Check, Settings, SourceCodeLocator}; diff --git a/src/lib_native.rs b/src/lib_native.rs index d35f45090c..d7afd8f886 100644 --- a/src/lib_native.rs +++ b/src/lib_native.rs @@ -12,7 +12,7 @@ use crate::settings::configuration::Configuration; use crate::settings::{flags, pyproject, Settings}; use crate::source_code_locator::SourceCodeLocator; use crate::source_code_style::SourceCodeStyleDetector; -use crate::{directives, packages, resolver, violations}; +use crate::{directives, packages, resolver}; /// Load the relevant `Settings` for a given `Path`. fn resolve(path: &Path) -> Result { diff --git a/src/linter.rs b/src/linter.rs index ae6bce6b3d..ba13899dc9 100644 --- a/src/linter.rs +++ b/src/linter.rs @@ -21,7 +21,7 @@ use crate::checkers::tokens::check_tokens; use crate::directives::Directives; use crate::message::{Message, Source}; use crate::noqa::add_noqa; -use crate::registry::{Check, CheckCode, CheckKind, LintSource}; +use crate::registry::{Check, CheckCode, LintSource}; use crate::settings::{flags, Settings}; use crate::source_code_locator::SourceCodeLocator; use crate::source_code_style::SourceCodeStyleDetector; diff --git a/src/mccabe/checks.rs b/src/mccabe/checks.rs index 54584ac79d..723fef5b37 100644 --- a/src/mccabe/checks.rs +++ b/src/mccabe/checks.rs @@ -1,7 +1,7 @@ use rustpython_ast::{ExcepthandlerKind, ExprKind, Stmt, StmtKind}; use crate::ast::helpers::identifier_range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::source_code_locator::SourceCodeLocator; use crate::violations; diff --git a/src/mccabe/mod.rs b/src/mccabe/mod.rs index 4c45fde090..fa8a5e8feb 100644 --- a/src/mccabe/mod.rs +++ b/src/mccabe/mod.rs @@ -10,7 +10,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{mccabe, violations, Settings}; + use crate::{mccabe, Settings}; #[test_case(0)] #[test_case(3)] diff --git a/src/message.rs b/src/message.rs index 144eb30f05..993618af62 100644 --- a/src/message.rs +++ b/src/message.rs @@ -7,7 +7,6 @@ use crate::ast::types::Range; use crate::autofix::Fix; use crate::registry::{Check, CheckKind}; use crate::source_code_locator::SourceCodeLocator; -use crate::violations; #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Message { diff --git a/src/noqa.rs b/src/noqa.rs index 7ed2582801..7ea2700cd8 100644 --- a/src/noqa.rs +++ b/src/noqa.rs @@ -10,7 +10,6 @@ use rustc_hash::{FxHashMap, FxHashSet}; use crate::registry::{Check, CheckCode, CODE_REDIRECTS}; use crate::source_code_style::LineEnding; -use crate::violations; static NOQA_LINE_REGEX: Lazy = Lazy::new(|| { Regex::new( @@ -214,7 +213,7 @@ mod tests { use crate::ast::types::Range; use crate::noqa::{add_noqa_inner, NOQA_LINE_REGEX}; - use crate::registry::{Check, CheckKind}; + use crate::registry::Check; use crate::source_code_style::LineEnding; use crate::violations; diff --git a/src/pandas_vet/checks.rs b/src/pandas_vet/checks.rs index e42d4ac1d8..2a22b552fa 100644 --- a/src/pandas_vet/checks.rs +++ b/src/pandas_vet/checks.rs @@ -1,7 +1,7 @@ use rustpython_ast::{Constant, Expr, ExprKind, Keyword}; use crate::ast::types::Range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// PD002 diff --git a/src/pandas_vet/mod.rs b/src/pandas_vet/mod.rs index 7d79de79b9..9673957721 100644 --- a/src/pandas_vet/mod.rs +++ b/src/pandas_vet/mod.rs @@ -15,7 +15,7 @@ mod tests { use crate::settings::flags; use crate::source_code_locator::SourceCodeLocator; use crate::source_code_style::SourceCodeStyleDetector; - use crate::{directives, rustpython_helpers, settings, violations}; + use crate::{directives, rustpython_helpers, settings}; fn check_code(contents: &str, expected: &[CheckCode]) -> Result<()> { let contents = dedent(contents); diff --git a/src/pep8_naming/checks.rs b/src/pep8_naming/checks.rs index ec23d030ea..15035f987d 100644 --- a/src/pep8_naming/checks.rs +++ b/src/pep8_naming/checks.rs @@ -7,7 +7,7 @@ use crate::ast::types::{Range, Scope, ScopeKind}; use crate::pep8_naming::helpers; use crate::pep8_naming::settings::Settings; use crate::python::string::{self}; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::source_code_locator::SourceCodeLocator; use crate::violations; diff --git a/src/pep8_naming/mod.rs b/src/pep8_naming/mod.rs index bfcf252eb6..3fe6c8ac51 100644 --- a/src/pep8_naming/mod.rs +++ b/src/pep8_naming/mod.rs @@ -13,7 +13,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::N801, Path::new("N801.py"); "N801")] #[test_case(CheckCode::N802, Path::new("N802.py"); "N802")] diff --git a/src/pep8_naming/plugins.rs b/src/pep8_naming/plugins.rs index 9543619af1..9735378d6f 100644 --- a/src/pep8_naming/plugins.rs +++ b/src/pep8_naming/plugins.rs @@ -3,7 +3,6 @@ use rustpython_ast::{Expr, Stmt}; use crate::ast::types::Range; use crate::checkers::ast::Checker; use crate::pep8_naming::helpers; -use crate::registry::CheckKind; use crate::{violations, Check}; /// N806 diff --git a/src/printer.rs b/src/printer.rs index 00099dc80a..af7f1cc762 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -17,7 +17,7 @@ use crate::logging::LogLevel; use crate::message::Message; use crate::registry::CheckCode; use crate::settings::types::SerializationFormat; -use crate::{tell_user, violations}; +use crate::tell_user; /// Enum to control whether lint violations are shown to the user. pub enum Violations { diff --git a/src/pycodestyle/checks.rs b/src/pycodestyle/checks.rs index d9a27aff62..59caea4356 100644 --- a/src/pycodestyle/checks.rs +++ b/src/pycodestyle/checks.rs @@ -7,7 +7,7 @@ use rustpython_parser::ast::{Cmpop, Expr, ExprKind}; use crate::ast::helpers::except_range; use crate::ast::types::Range; use crate::autofix::Fix; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::settings::Settings; use crate::source_code_locator::SourceCodeLocator; use crate::violations; diff --git a/src/pycodestyle/mod.rs b/src/pycodestyle/mod.rs index c10657a1b9..49ee8db613 100644 --- a/src/pycodestyle/mod.rs +++ b/src/pycodestyle/mod.rs @@ -13,7 +13,7 @@ mod tests { use super::settings::Settings; use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::E401, Path::new("E40.py"))] #[test_case(CheckCode::E402, Path::new("E40.py"))] diff --git a/src/pycodestyle/plugins.rs b/src/pycodestyle/plugins.rs index 5f90fb4ac6..e00bad737b 100644 --- a/src/pycodestyle/plugins.rs +++ b/src/pycodestyle/plugins.rs @@ -11,7 +11,7 @@ use crate::ast::types::Range; use crate::ast::whitespace::leading_space; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::source_code_generator::SourceCodeGenerator; use crate::source_code_style::SourceCodeStyleDetector; use crate::violations; diff --git a/src/pydocstyle/mod.rs b/src/pydocstyle/mod.rs index eb4f5b0024..b8c0842d9f 100644 --- a/src/pydocstyle/mod.rs +++ b/src/pydocstyle/mod.rs @@ -13,7 +13,7 @@ mod tests { use crate::linter::test_path; use crate::pydocstyle::settings::{Convention, Settings}; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::D100, Path::new("D.py"); "D100")] #[test_case(CheckCode::D101, Path::new("D.py"); "D101")] diff --git a/src/pydocstyle/plugins.rs b/src/pydocstyle/plugins.rs index cb5c8ac408..12f164f823 100644 --- a/src/pydocstyle/plugins.rs +++ b/src/pydocstyle/plugins.rs @@ -16,7 +16,7 @@ use crate::docstrings::sections::{section_contexts, SectionContext}; use crate::docstrings::styles::SectionStyle; use crate::pydocstyle::helpers::{leading_quote, logical_line}; use crate::pydocstyle::settings::Convention; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; use crate::visibility::{is_init, is_magic, is_overload, is_override, is_staticmethod, Visibility}; diff --git a/src/pydocstyle/settings.rs b/src/pydocstyle/settings.rs index d53601833d..e679c75203 100644 --- a/src/pydocstyle/settings.rs +++ b/src/pydocstyle/settings.rs @@ -5,7 +5,6 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::registry::CheckCodePrefix; -use crate::violations; #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Hash, JsonSchema)] #[serde(deny_unknown_fields, rename_all = "kebab-case")] diff --git a/src/pyflakes/checks.rs b/src/pyflakes/checks.rs index e1458e7457..53788e29c1 100644 --- a/src/pyflakes/checks.rs +++ b/src/pyflakes/checks.rs @@ -6,7 +6,7 @@ use rustpython_parser::ast::{ use crate::ast::helpers::except_range; use crate::ast::types::{Binding, Range, Scope, ScopeKind}; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::source_code_locator::SourceCodeLocator; use crate::violations; diff --git a/src/pyflakes/mod.rs b/src/pyflakes/mod.rs index 92140ae7b7..799b2ec477 100644 --- a/src/pyflakes/mod.rs +++ b/src/pyflakes/mod.rs @@ -20,7 +20,7 @@ mod tests { use crate::settings::flags; use crate::source_code_locator::SourceCodeLocator; use crate::source_code_style::SourceCodeStyleDetector; - use crate::{directives, rustpython_helpers, settings, violations}; + use crate::{directives, rustpython_helpers, settings}; #[test_case(CheckCode::F401, Path::new("F401_0.py"); "F401_0")] #[test_case(CheckCode::F401, Path::new("F401_1.py"); "F401_1")] diff --git a/src/pyflakes/plugins/f_string_missing_placeholders.rs b/src/pyflakes/plugins/f_string_missing_placeholders.rs index 9ce73e7200..47dbdeff8c 100644 --- a/src/pyflakes/plugins/f_string_missing_placeholders.rs +++ b/src/pyflakes/plugins/f_string_missing_placeholders.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Expr, ExprKind}; use crate::ast::helpers::find_useless_f_strings; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; /// F541 diff --git a/src/pyflakes/plugins/invalid_literal_comparisons.rs b/src/pyflakes/plugins/invalid_literal_comparisons.rs index e0dcdc4615..2386fb8cdb 100644 --- a/src/pyflakes/plugins/invalid_literal_comparisons.rs +++ b/src/pyflakes/plugins/invalid_literal_comparisons.rs @@ -7,7 +7,7 @@ use crate::ast::operations::locate_cmpops; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// F632 diff --git a/src/pyflakes/plugins/invalid_print_syntax.rs b/src/pyflakes/plugins/invalid_print_syntax.rs index ec84fe6558..2f5b000181 100644 --- a/src/pyflakes/plugins/invalid_print_syntax.rs +++ b/src/pyflakes/plugins/invalid_print_syntax.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Expr, ExprKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// F633 diff --git a/src/pyflakes/plugins/raise_not_implemented.rs b/src/pyflakes/plugins/raise_not_implemented.rs index 4ad41e529a..67b0938a8b 100644 --- a/src/pyflakes/plugins/raise_not_implemented.rs +++ b/src/pyflakes/plugins/raise_not_implemented.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Expr, ExprKind}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; fn match_not_implemented(expr: &Expr) -> Option<&Expr> { diff --git a/src/pyflakes/plugins/strings.rs b/src/pyflakes/plugins/strings.rs index e2805cd071..bd975c66a6 100644 --- a/src/pyflakes/plugins/strings.rs +++ b/src/pyflakes/plugins/strings.rs @@ -12,7 +12,7 @@ use crate::pyflakes::fixes::{ remove_unused_format_arguments_from_dict, remove_unused_keyword_arguments_from_format_call, }; use crate::pyflakes::format::FormatSummary; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; fn has_star_star_kwargs(keywords: &[Keyword]) -> bool { diff --git a/src/pyflakes/plugins/unused_annotation.rs b/src/pyflakes/plugins/unused_annotation.rs index 4944b5910c..53deb278a5 100644 --- a/src/pyflakes/plugins/unused_annotation.rs +++ b/src/pyflakes/plugins/unused_annotation.rs @@ -1,6 +1,6 @@ use crate::ast::types::BindingKind; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// F842 diff --git a/src/pyflakes/plugins/unused_variable.rs b/src/pyflakes/plugins/unused_variable.rs index 78f827c1e6..4d952517b4 100644 --- a/src/pyflakes/plugins/unused_variable.rs +++ b/src/pyflakes/plugins/unused_variable.rs @@ -5,7 +5,7 @@ use crate::ast::types::{BindingKind, Range, RefEquality, ScopeKind}; use crate::autofix::helpers::delete_stmt; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; fn is_literal_or_name(expr: &Expr, checker: &Checker) -> bool { diff --git a/src/pygrep_hooks/mod.rs b/src/pygrep_hooks/mod.rs index 6a901da183..c20b69997b 100644 --- a/src/pygrep_hooks/mod.rs +++ b/src/pygrep_hooks/mod.rs @@ -10,7 +10,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::PGH001, Path::new("PGH001_0.py"); "PGH001_0")] #[test_case(CheckCode::PGH001, Path::new("PGH001_1.py"); "PGH001_1")] diff --git a/src/pygrep_hooks/plugins/blanket_noqa.rs b/src/pygrep_hooks/plugins/blanket_noqa.rs index 6effb8a65b..b627da5743 100644 --- a/src/pygrep_hooks/plugins/blanket_noqa.rs +++ b/src/pygrep_hooks/plugins/blanket_noqa.rs @@ -3,7 +3,7 @@ use regex::Regex; use rustpython_ast::Location; use crate::ast::types::Range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; static BLANKET_NOQA_REGEX: Lazy = diff --git a/src/pygrep_hooks/plugins/blanket_type_ignore.rs b/src/pygrep_hooks/plugins/blanket_type_ignore.rs index fa3fc8ac90..d671595639 100644 --- a/src/pygrep_hooks/plugins/blanket_type_ignore.rs +++ b/src/pygrep_hooks/plugins/blanket_type_ignore.rs @@ -3,7 +3,7 @@ use regex::Regex; use rustpython_ast::Location; use crate::ast::types::Range; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; static BLANKET_TYPE_IGNORE_REGEX: Lazy = diff --git a/src/pygrep_hooks/plugins/deprecated_log_warn.rs b/src/pygrep_hooks/plugins/deprecated_log_warn.rs index 1eade04fe1..b59fc640c2 100644 --- a/src/pygrep_hooks/plugins/deprecated_log_warn.rs +++ b/src/pygrep_hooks/plugins/deprecated_log_warn.rs @@ -3,7 +3,7 @@ use rustpython_ast::Expr; use crate::ast::helpers::{collect_call_paths, dealias_call_path, match_call_path}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// PGH002 - deprecated use of logging.warn diff --git a/src/pygrep_hooks/plugins/no_eval.rs b/src/pygrep_hooks/plugins/no_eval.rs index 90c691a68c..3174319bd2 100644 --- a/src/pygrep_hooks/plugins/no_eval.rs +++ b/src/pygrep_hooks/plugins/no_eval.rs @@ -2,7 +2,7 @@ use rustpython_ast::{Expr, ExprKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// PGH001 - no eval diff --git a/src/pylint/mod.rs b/src/pylint/mod.rs index 01d3144dd9..13ab36b81b 100644 --- a/src/pylint/mod.rs +++ b/src/pylint/mod.rs @@ -9,7 +9,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{violations, Settings}; + use crate::Settings; #[test_case(CheckCode::PLC0414, Path::new("import_aliasing.py"); "PLC0414")] #[test_case(CheckCode::PLC2201, Path::new("misplaced_comparison_constant.py"); "PLC2201")] diff --git a/src/pylint/plugins/await_outside_async.rs b/src/pylint/plugins/await_outside_async.rs index b362ee6567..9908fe4beb 100644 --- a/src/pylint/plugins/await_outside_async.rs +++ b/src/pylint/plugins/await_outside_async.rs @@ -2,7 +2,6 @@ use rustpython_ast::Expr; use crate::ast::types::{FunctionDef, Range, ScopeKind}; use crate::checkers::ast::Checker; -use crate::registry::CheckKind; use crate::{violations, Check}; /// PLE1142 diff --git a/src/pylint/plugins/merge_isinstance.rs b/src/pylint/plugins/merge_isinstance.rs index b2f5b21c3a..432d8e0a15 100644 --- a/src/pylint/plugins/merge_isinstance.rs +++ b/src/pylint/plugins/merge_isinstance.rs @@ -4,7 +4,6 @@ use rustpython_ast::{Boolop, Expr, ExprKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::CheckKind; use crate::{violations, Check}; /// PLR1701 diff --git a/src/pylint/plugins/misplaced_comparison_constant.rs b/src/pylint/plugins/misplaced_comparison_constant.rs index 711e0c4dbc..37cde53382 100644 --- a/src/pylint/plugins/misplaced_comparison_constant.rs +++ b/src/pylint/plugins/misplaced_comparison_constant.rs @@ -3,7 +3,6 @@ use rustpython_ast::{Cmpop, Expr, ExprKind}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::CheckKind; use crate::{violations, Check}; /// PLC2201 diff --git a/src/pylint/plugins/property_with_parameters.rs b/src/pylint/plugins/property_with_parameters.rs index a427c797e1..7b0f771973 100644 --- a/src/pylint/plugins/property_with_parameters.rs +++ b/src/pylint/plugins/property_with_parameters.rs @@ -2,7 +2,6 @@ use rustpython_ast::{Arguments, Expr, ExprKind, Stmt}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::CheckKind; use crate::{violations, Check}; /// PLR0206 diff --git a/src/pylint/plugins/unnecessary_direct_lambda_call.rs b/src/pylint/plugins/unnecessary_direct_lambda_call.rs index 174a70dbbf..37fef0e2ef 100644 --- a/src/pylint/plugins/unnecessary_direct_lambda_call.rs +++ b/src/pylint/plugins/unnecessary_direct_lambda_call.rs @@ -2,7 +2,6 @@ use rustpython_ast::{Expr, ExprKind}; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::CheckKind; use crate::{violations, Check}; /// PLC3002 diff --git a/src/pylint/plugins/use_from_import.rs b/src/pylint/plugins/use_from_import.rs index fd62fbaa3d..b85798de83 100644 --- a/src/pylint/plugins/use_from_import.rs +++ b/src/pylint/plugins/use_from_import.rs @@ -2,7 +2,6 @@ use rustpython_ast::Alias; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::CheckKind; use crate::{violations, Check}; /// PLR0402 diff --git a/src/pylint/plugins/use_sys_exit.rs b/src/pylint/plugins/use_sys_exit.rs index a0d5686fd5..a5f2b3f386 100644 --- a/src/pylint/plugins/use_sys_exit.rs +++ b/src/pylint/plugins/use_sys_exit.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Expr, ExprKind}; use crate::ast::types::{BindingKind, Range}; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// Return `true` if the `module` was imported using a star import (e.g., `from diff --git a/src/pylint/plugins/used_prior_global_declaration.rs b/src/pylint/plugins/used_prior_global_declaration.rs index 66691054f7..56701b50fb 100644 --- a/src/pylint/plugins/used_prior_global_declaration.rs +++ b/src/pylint/plugins/used_prior_global_declaration.rs @@ -2,7 +2,6 @@ use rustpython_ast::Expr; use crate::ast::types::{Range, ScopeKind}; use crate::checkers::ast::Checker; -use crate::registry::CheckKind; use crate::{violations, Check}; /// PLE0118 diff --git a/src/pylint/plugins/useless_else_on_loop.rs b/src/pylint/plugins/useless_else_on_loop.rs index 564ad472cc..dfc9b29b99 100644 --- a/src/pylint/plugins/useless_else_on_loop.rs +++ b/src/pylint/plugins/useless_else_on_loop.rs @@ -2,7 +2,6 @@ use rustpython_ast::{ExcepthandlerKind, Stmt, StmtKind}; use crate::ast::helpers; use crate::checkers::ast::Checker; -use crate::registry::CheckKind; use crate::{violations, Check}; fn loop_exits_early(body: &[Stmt]) -> bool { diff --git a/src/pylint/plugins/useless_import_alias.rs b/src/pylint/plugins/useless_import_alias.rs index 008bc61f23..0f98182727 100644 --- a/src/pylint/plugins/useless_import_alias.rs +++ b/src/pylint/plugins/useless_import_alias.rs @@ -3,7 +3,6 @@ use rustpython_ast::Alias; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::CheckKind; use crate::{violations, Check}; /// PLC0414 diff --git a/src/pyupgrade/checks.rs b/src/pyupgrade/checks.rs index af825564d9..b80da6d462 100644 --- a/src/pyupgrade/checks.rs +++ b/src/pyupgrade/checks.rs @@ -8,7 +8,7 @@ use crate::ast::helpers::{self}; use crate::ast::types::{Binding, BindingKind, Range, Scope, ScopeKind}; use crate::autofix::Fix; use crate::pyupgrade::types::Primitive; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::settings::types::PythonVersion; use crate::violations; diff --git a/src/pyupgrade/mod.rs b/src/pyupgrade/mod.rs index a8aca2f3b5..17d6a422a0 100644 --- a/src/pyupgrade/mod.rs +++ b/src/pyupgrade/mod.rs @@ -14,8 +14,8 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; + use crate::settings; use crate::settings::types::PythonVersion; - use crate::{settings, violations}; #[test_case(CheckCode::UP001, Path::new("UP001.py"); "UP001")] #[test_case(CheckCode::UP003, Path::new("UP003.py"); "UP003")] diff --git a/src/pyupgrade/plugins/convert_named_tuple_functional_to_class.rs b/src/pyupgrade/plugins/convert_named_tuple_functional_to_class.rs index b8d1f79952..1ad215a281 100644 --- a/src/pyupgrade/plugins/convert_named_tuple_functional_to_class.rs +++ b/src/pyupgrade/plugins/convert_named_tuple_functional_to_class.rs @@ -8,7 +8,7 @@ use crate::autofix::Fix; use crate::checkers::ast::Checker; use crate::python::identifiers::IDENTIFIER_REGEX; use crate::python::keyword::KWLIST; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::source_code_generator::SourceCodeGenerator; use crate::source_code_style::SourceCodeStyleDetector; use crate::violations; diff --git a/src/pyupgrade/plugins/convert_typed_dict_functional_to_class.rs b/src/pyupgrade/plugins/convert_typed_dict_functional_to_class.rs index 7af6c2c18d..7c0345e794 100644 --- a/src/pyupgrade/plugins/convert_typed_dict_functional_to_class.rs +++ b/src/pyupgrade/plugins/convert_typed_dict_functional_to_class.rs @@ -10,7 +10,7 @@ use crate::autofix::Fix; use crate::checkers::ast::Checker; use crate::python::identifiers::IDENTIFIER_REGEX; use crate::python::keyword::KWLIST; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::source_code_generator::SourceCodeGenerator; use crate::source_code_style::SourceCodeStyleDetector; use crate::violations; diff --git a/src/pyupgrade/plugins/datetime_utc_alias.rs b/src/pyupgrade/plugins/datetime_utc_alias.rs index 1815c782d2..67d32e5b77 100644 --- a/src/pyupgrade/plugins/datetime_utc_alias.rs +++ b/src/pyupgrade/plugins/datetime_utc_alias.rs @@ -4,7 +4,7 @@ use crate::ast::helpers::{collect_call_paths, compose_call_path, dealias_call_pa use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; /// UP017 diff --git a/src/pyupgrade/plugins/deprecated_unittest_alias.rs b/src/pyupgrade/plugins/deprecated_unittest_alias.rs index d1c31679f5..8dd1468432 100644 --- a/src/pyupgrade/plugins/deprecated_unittest_alias.rs +++ b/src/pyupgrade/plugins/deprecated_unittest_alias.rs @@ -5,7 +5,7 @@ use rustpython_ast::{Expr, ExprKind}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; static DEPRECATED_ALIASES: Lazy> = Lazy::new(|| { diff --git a/src/pyupgrade/plugins/native_literals.rs b/src/pyupgrade/plugins/native_literals.rs index 525bce3c68..c42b41f9f5 100644 --- a/src/pyupgrade/plugins/native_literals.rs +++ b/src/pyupgrade/plugins/native_literals.rs @@ -5,7 +5,7 @@ use rustpython_parser::lexer::Tok; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind, LiteralType}; +use crate::registry::{Check, CheckCode, LiteralType}; use crate::violations; /// UP018 diff --git a/src/pyupgrade/plugins/open_alias.rs b/src/pyupgrade/plugins/open_alias.rs index d8d89d86e1..f1a581edfd 100644 --- a/src/pyupgrade/plugins/open_alias.rs +++ b/src/pyupgrade/plugins/open_alias.rs @@ -4,7 +4,7 @@ use crate::ast::helpers::{collect_call_paths, dealias_call_path, match_call_path use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; /// UP020 diff --git a/src/pyupgrade/plugins/os_error_alias.rs b/src/pyupgrade/plugins/os_error_alias.rs index 20a4bc684e..e9d68ad407 100644 --- a/src/pyupgrade/plugins/os_error_alias.rs +++ b/src/pyupgrade/plugins/os_error_alias.rs @@ -7,7 +7,7 @@ use crate::ast::helpers::{compose_call_path, match_module_member}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; const ERROR_NAMES: &[&str] = &["EnvironmentError", "IOError", "WindowsError"]; diff --git a/src/pyupgrade/plugins/redundant_open_modes.rs b/src/pyupgrade/plugins/redundant_open_modes.rs index fa398386ac..8638925789 100644 --- a/src/pyupgrade/plugins/redundant_open_modes.rs +++ b/src/pyupgrade/plugins/redundant_open_modes.rs @@ -10,7 +10,7 @@ use crate::ast::helpers::find_keyword; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::source_code_locator::SourceCodeLocator; use crate::violations; diff --git a/src/pyupgrade/plugins/remove_six_compat.rs b/src/pyupgrade/plugins/remove_six_compat.rs index 84d41394f1..f7ed63726d 100644 --- a/src/pyupgrade/plugins/remove_six_compat.rs +++ b/src/pyupgrade/plugins/remove_six_compat.rs @@ -4,7 +4,7 @@ use crate::ast::helpers::{collect_call_paths, create_expr, create_stmt, dealias_ use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::source_code_generator::SourceCodeGenerator; use crate::source_code_style::SourceCodeStyleDetector; use crate::{violations, SourceCodeLocator}; diff --git a/src/pyupgrade/plugins/replace_stdout_stderr.rs b/src/pyupgrade/plugins/replace_stdout_stderr.rs index 224ea115eb..2c22ac44be 100644 --- a/src/pyupgrade/plugins/replace_stdout_stderr.rs +++ b/src/pyupgrade/plugins/replace_stdout_stderr.rs @@ -5,7 +5,7 @@ use crate::ast::types::Range; use crate::ast::whitespace::indentation; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; #[derive(Debug)] diff --git a/src/pyupgrade/plugins/replace_universal_newlines.rs b/src/pyupgrade/plugins/replace_universal_newlines.rs index 63ab1357a8..682536808c 100644 --- a/src/pyupgrade/plugins/replace_universal_newlines.rs +++ b/src/pyupgrade/plugins/replace_universal_newlines.rs @@ -4,7 +4,7 @@ use crate::ast::helpers::{find_keyword, match_module_member}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// UP021 diff --git a/src/pyupgrade/plugins/rewrite_c_element_tree.rs b/src/pyupgrade/plugins/rewrite_c_element_tree.rs index c4c4750ed3..c2bb290e39 100644 --- a/src/pyupgrade/plugins/rewrite_c_element_tree.rs +++ b/src/pyupgrade/plugins/rewrite_c_element_tree.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Located, Stmt, StmtKind}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; fn add_check_for_node(checker: &mut Checker, node: &Located) { diff --git a/src/pyupgrade/plugins/rewrite_mock_import.rs b/src/pyupgrade/plugins/rewrite_mock_import.rs index 20ea06849b..a719af4bc4 100644 --- a/src/pyupgrade/plugins/rewrite_mock_import.rs +++ b/src/pyupgrade/plugins/rewrite_mock_import.rs @@ -12,7 +12,7 @@ use crate::ast::whitespace::indentation; use crate::autofix::Fix; use crate::checkers::ast::Checker; use crate::cst::matchers::{match_import, match_import_from, match_module}; -use crate::registry::{Check, CheckCode, CheckKind, MockReference}; +use crate::registry::{Check, CheckCode, MockReference}; use crate::source_code_locator::SourceCodeLocator; use crate::source_code_style::SourceCodeStyleDetector; use crate::violations; diff --git a/src/pyupgrade/plugins/rewrite_unicode_literal.rs b/src/pyupgrade/plugins/rewrite_unicode_literal.rs index b5f56bf07c..7bddc53c41 100644 --- a/src/pyupgrade/plugins/rewrite_unicode_literal.rs +++ b/src/pyupgrade/plugins/rewrite_unicode_literal.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Expr, Location}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// UP025 diff --git a/src/pyupgrade/plugins/rewrite_yield_from.rs b/src/pyupgrade/plugins/rewrite_yield_from.rs index d18b295398..8978fd0dcb 100644 --- a/src/pyupgrade/plugins/rewrite_yield_from.rs +++ b/src/pyupgrade/plugins/rewrite_yield_from.rs @@ -6,7 +6,7 @@ use crate::ast::visitor; use crate::ast::visitor::Visitor; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// Return `true` if the two expressions are equivalent, and consistent solely diff --git a/src/pyupgrade/plugins/typing_text_str_alias.rs b/src/pyupgrade/plugins/typing_text_str_alias.rs index 9375747834..9a5a6e9ba0 100644 --- a/src/pyupgrade/plugins/typing_text_str_alias.rs +++ b/src/pyupgrade/plugins/typing_text_str_alias.rs @@ -4,7 +4,7 @@ use crate::ast::helpers::match_module_member; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// UP019 diff --git a/src/pyupgrade/plugins/unnecessary_builtin_import.rs b/src/pyupgrade/plugins/unnecessary_builtin_import.rs index acd9dfebb8..7e66889bef 100644 --- a/src/pyupgrade/plugins/unnecessary_builtin_import.rs +++ b/src/pyupgrade/plugins/unnecessary_builtin_import.rs @@ -5,7 +5,7 @@ use rustpython_parser::ast::Stmt; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::{autofix, violations}; const BUILTINS: &[&str] = &[ diff --git a/src/pyupgrade/plugins/unnecessary_encode_utf8.rs b/src/pyupgrade/plugins/unnecessary_encode_utf8.rs index 15d6c47ed2..3c3eac3d65 100644 --- a/src/pyupgrade/plugins/unnecessary_encode_utf8.rs +++ b/src/pyupgrade/plugins/unnecessary_encode_utf8.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Constant, Expr, ExprKind, Keyword}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::source_code_locator::SourceCodeLocator; use crate::violations; diff --git a/src/pyupgrade/plugins/unnecessary_future_import.rs b/src/pyupgrade/plugins/unnecessary_future_import.rs index bd73f0a677..a89fe4694f 100644 --- a/src/pyupgrade/plugins/unnecessary_future_import.rs +++ b/src/pyupgrade/plugins/unnecessary_future_import.rs @@ -5,7 +5,7 @@ use rustpython_parser::ast::Stmt; use crate::ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::settings::types::PythonVersion; use crate::{autofix, violations}; diff --git a/src/pyupgrade/plugins/unpack_list_comprehension.rs b/src/pyupgrade/plugins/unpack_list_comprehension.rs index 9190eb3754..7609845771 100644 --- a/src/pyupgrade/plugins/unpack_list_comprehension.rs +++ b/src/pyupgrade/plugins/unpack_list_comprehension.rs @@ -3,7 +3,7 @@ use rustpython_ast::{Expr, ExprKind}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckCode, CheckKind}; +use crate::registry::{Check, CheckCode}; use crate::violations; /// Returns `true` if `expr` contains an `ExprKind::Await`. diff --git a/src/pyupgrade/plugins/use_pep585_annotation.rs b/src/pyupgrade/plugins/use_pep585_annotation.rs index 05711cc1da..38857eeb32 100644 --- a/src/pyupgrade/plugins/use_pep585_annotation.rs +++ b/src/pyupgrade/plugins/use_pep585_annotation.rs @@ -3,7 +3,7 @@ use rustpython_ast::Expr; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::violations; /// UP006 diff --git a/src/pyupgrade/plugins/use_pep604_annotation.rs b/src/pyupgrade/plugins/use_pep604_annotation.rs index 0538a4445d..0d03535383 100644 --- a/src/pyupgrade/plugins/use_pep604_annotation.rs +++ b/src/pyupgrade/plugins/use_pep604_annotation.rs @@ -4,7 +4,7 @@ use crate::ast::helpers::{collect_call_paths, dealias_call_path}; use crate::ast::types::Range; use crate::autofix::Fix; use crate::checkers::ast::Checker; -use crate::registry::{Check, CheckKind}; +use crate::registry::Check; use crate::source_code_generator::SourceCodeGenerator; use crate::violations; diff --git a/src/ruff/mod.rs b/src/ruff/mod.rs index 23e89e6e17..633ccc7196 100644 --- a/src/ruff/mod.rs +++ b/src/ruff/mod.rs @@ -12,7 +12,7 @@ mod tests { use crate::linter::test_path; use crate::registry::CheckCode; - use crate::{settings, violations}; + use crate::settings; #[test_case(CheckCode::RUF004, Path::new("RUF004.py"); "RUF004")] fn checks(check_code: CheckCode, path: &Path) -> Result<()> { let snapshot = format!("{}_{}", check_code.as_ref(), path.to_string_lossy()); diff --git a/src/settings/configuration.rs b/src/settings/configuration.rs index f1fdc1fd3b..dc262eed4e 100644 --- a/src/settings/configuration.rs +++ b/src/settings/configuration.rs @@ -22,7 +22,7 @@ use crate::settings::types::{ use crate::{ flake8_annotations, flake8_bandit, flake8_bugbear, flake8_errmsg, flake8_import_conventions, flake8_pytest_style, flake8_quotes, flake8_tidy_imports, flake8_unused_arguments, fs, isort, - mccabe, pep8_naming, pycodestyle, pydocstyle, pyupgrade, violations, + mccabe, pep8_naming, pycodestyle, pydocstyle, pyupgrade, }; #[derive(Debug, Default)] diff --git a/src/settings/mod.rs b/src/settings/mod.rs index c49c0fd9f8..48b97fefe5 100644 --- a/src/settings/mod.rs +++ b/src/settings/mod.rs @@ -25,7 +25,7 @@ use crate::settings::types::{ use crate::{ flake8_annotations, flake8_bandit, flake8_bugbear, flake8_errmsg, flake8_import_conventions, flake8_pytest_style, flake8_quotes, flake8_tidy_imports, flake8_unused_arguments, isort, - mccabe, one_time_warning, pep8_naming, pycodestyle, pydocstyle, pyupgrade, violations, + mccabe, one_time_warning, pep8_naming, pycodestyle, pydocstyle, pyupgrade, }; pub mod configuration; @@ -442,7 +442,6 @@ mod tests { use crate::registry::{CheckCode, CheckCodePrefix}; use crate::settings::{resolve_codes, CheckCodeSpec}; - use crate::violations; #[test] fn check_codes() { diff --git a/src/settings/options.rs b/src/settings/options.rs index 4375a5751d..620dd96368 100644 --- a/src/settings/options.rs +++ b/src/settings/options.rs @@ -10,7 +10,7 @@ use crate::settings::types::{PythonVersion, SerializationFormat, Version}; use crate::{ flake8_annotations, flake8_bandit, flake8_bugbear, flake8_errmsg, flake8_import_conventions, flake8_pytest_style, flake8_quotes, flake8_tidy_imports, flake8_unused_arguments, isort, - mccabe, pep8_naming, pycodestyle, pydocstyle, pyupgrade, violations, + mccabe, pep8_naming, pycodestyle, pydocstyle, pyupgrade, }; #[derive( diff --git a/src/settings/pyproject.rs b/src/settings/pyproject.rs index 5ca65efa7c..5b888e3d5e 100644 --- a/src/settings/pyproject.rs +++ b/src/settings/pyproject.rs @@ -138,7 +138,7 @@ mod tests { use crate::settings::types::PatternPrefixPair; use crate::{ flake8_bugbear, flake8_errmsg, flake8_import_conventions, flake8_pytest_style, - flake8_quotes, flake8_tidy_imports, mccabe, pep8_naming, violations, + flake8_quotes, flake8_tidy_imports, mccabe, pep8_naming, }; #[test] diff --git a/src/settings/types.rs b/src/settings/types.rs index a76f757ea0..56383b87c7 100644 --- a/src/settings/types.rs +++ b/src/settings/types.rs @@ -10,8 +10,8 @@ use rustc_hash::FxHashSet; use schemars::JsonSchema; use serde::{de, Deserialize, Deserializer, Serialize}; +use crate::fs; use crate::registry::{CheckCode, CheckCodePrefix}; -use crate::{fs, violations}; #[derive( Clone, Copy, Debug, PartialOrd, Ord, PartialEq, Eq, Serialize, Deserialize, Hash, JsonSchema,