Skip to content

Commit

Permalink
structs 8/9: Run cargo fix and cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
not-my-profile authored and charliermarsh committed Jan 7, 2023
1 parent 6208eb7 commit 6a723b5
Show file tree
Hide file tree
Showing 175 changed files with 159 additions and 180 deletions.
1 change: 0 additions & 1 deletion src/autofix/fixer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/checkers/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/checkers/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions src/checkers/lines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 1 addition & 3 deletions src/checkers/tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.")]
Expand Down
2 changes: 1 addition & 1 deletion src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/directives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/eradicate/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
2 changes: 1 addition & 1 deletion src/eradicate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<()> {
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_2020/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_2020/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_annotations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<()> {
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_annotations/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bandit/checks/assert_used.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bandit/checks/bad_file_permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bandit/checks/exec_used.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bandit/checks/hardcoded_bind_all_interfaces.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::ast::types::Range;
use crate::registry::{Check, CheckKind};
use crate::registry::Check;
use crate::violations;

/// S104
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bandit/checks/hardcoded_password_default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ArgData>, default: &Expr) -> Option<Check> {
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bandit/checks/hardcoded_password_func_arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bandit/checks/hardcoded_password_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bandit/checks/hardcoded_tmp_directory.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bandit/checks/request_without_timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bandit/checks/unsafe_yaml_load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bandit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_blind_except/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<()> {
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_blind_except/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_boolean_trap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bugbear/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bugbear/plugins/abstract_base_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bugbear/plugins/assert_false.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bugbear/plugins/assert_raises_exception.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bugbear/plugins/assignment_to_os_environ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bugbear/plugins/cached_instance_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bugbear/plugins/cannot_raise_literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bugbear/plugins/duplicate_exceptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bugbear/plugins/f_string_docstring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bugbear/plugins/function_uses_loop_variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bugbear/plugins/getattr_with_constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/flake8_bugbear/plugins/jump_statement_in_finally.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading

0 comments on commit 6a723b5

Please sign in to comment.