diff --git a/crates/ruff/src/autofix/mod.rs b/crates/ruff/src/autofix/mod.rs index 302d61a134..a6f873d777 100644 --- a/crates/ruff/src/autofix/mod.rs +++ b/crates/ruff/src/autofix/mod.rs @@ -4,12 +4,13 @@ use itertools::Itertools; use rustc_hash::FxHashMap; use rustpython_parser::ast::Location; -use crate::fix::Fix; -use crate::linter::FixTable; -use crate::registry::Diagnostic; use ruff_python_ast::source_code::Locator; use ruff_python_ast::types::Range; +use crate::fix::Fix; +use crate::linter::FixTable; +use crate::registry::{AsRule, Diagnostic}; + pub mod helpers; /// Auto-fix errors in a file, and write the fixed source code to disk. @@ -95,13 +96,13 @@ pub(crate) fn apply_fix(fix: &Fix, locator: &Locator) -> String { mod tests { use rustpython_parser::ast::Location; + use ruff_python_ast::source_code::Locator; + use crate::autofix::{apply_fix, apply_fixes}; use crate::fix::Fix; use crate::registry::Diagnostic; use crate::rules::pycodestyle::rules::NoNewLineAtEndOfFile; - use ruff_python_ast::source_code::Locator; - #[test] fn empty_file() { let fixes: Vec = vec![]; diff --git a/crates/ruff/src/checkers/ast/mod.rs b/crates/ruff/src/checkers/ast/mod.rs index e8d01c96ad..8f96c869e5 100644 --- a/crates/ruff/src/checkers/ast/mod.rs +++ b/crates/ruff/src/checkers/ast/mod.rs @@ -36,7 +36,7 @@ use crate::checkers::ast::deferred::Deferred; use crate::docstrings::definition::{ transition_scope, Definition, DefinitionKind, Docstring, Documentable, }; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::rules::{ flake8_2020, flake8_annotations, flake8_bandit, flake8_blind_except, flake8_boolean_trap, flake8_bugbear, flake8_builtins, flake8_comprehensions, flake8_datetimez, flake8_debugger, diff --git a/crates/ruff/src/checkers/logical_lines.rs b/crates/ruff/src/checkers/logical_lines.rs index 2549489c73..e06a815b24 100644 --- a/crates/ruff/src/checkers/logical_lines.rs +++ b/crates/ruff/src/checkers/logical_lines.rs @@ -5,7 +5,7 @@ use itertools::Itertools; use rustpython_parser::ast::Location; use rustpython_parser::lexer::LexResult; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::rules::pycodestyle::logical_lines::{iter_logical_lines, TokenFlags}; use crate::rules::pycodestyle::rules::{ extraneous_whitespace, indentation, missing_whitespace, missing_whitespace_after_keyword, diff --git a/crates/ruff/src/checkers/noqa.rs b/crates/ruff/src/checkers/noqa.rs index 1c8f6c8bc6..ede17d2536 100644 --- a/crates/ruff/src/checkers/noqa.rs +++ b/crates/ruff/src/checkers/noqa.rs @@ -4,15 +4,16 @@ use log::warn; use nohash_hasher::IntMap; use rustpython_parser::ast::Location; +use ruff_python_ast::types::Range; + use crate::codes::NoqaCode; use crate::fix::Fix; use crate::noqa; use crate::noqa::{extract_file_exemption, Directive, Exemption}; -use crate::registry::{Diagnostic, DiagnosticKind, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::rule_redirects::get_redirect_target; use crate::rules::ruff::rules::{UnusedCodes, UnusedNOQA}; use crate::settings::{flags, Settings}; -use ruff_python_ast::types::Range; pub fn check_noqa( diagnostics: &mut Vec, @@ -65,7 +66,7 @@ pub fn check_noqa( // Remove any ignored diagnostics. for (index, diagnostic) in diagnostics.iter().enumerate() { - if matches!(diagnostic.kind, DiagnosticKind::BlanketNOQA(..)) { + if matches!(diagnostic.kind.rule(), Rule::BlanketNOQA) { continue; } diff --git a/crates/ruff/src/checkers/tokens.rs b/crates/ruff/src/checkers/tokens.rs index e69fd95478..f655faddf9 100644 --- a/crates/ruff/src/checkers/tokens.rs +++ b/crates/ruff/src/checkers/tokens.rs @@ -4,7 +4,7 @@ use rustpython_parser::lexer::LexResult; use rustpython_parser::Tok; use crate::lex::docstring_detection::StateMachine; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::rules::ruff::rules::Context; use crate::rules::{ eradicate, flake8_commas, flake8_implicit_str_concat, flake8_pyi, flake8_quotes, pycodestyle, diff --git a/crates/ruff/src/lib_wasm.rs b/crates/ruff/src/lib_wasm.rs index 5e05ea1346..c9f9473847 100644 --- a/crates/ruff/src/lib_wasm.rs +++ b/crates/ruff/src/lib_wasm.rs @@ -7,7 +7,7 @@ use wasm_bindgen::prelude::*; use crate::directives; use crate::linter::{check_path, LinterResult}; -use crate::registry::Rule; +use crate::registry::{AsRule, Rule}; use crate::rules::{ flake8_annotations, flake8_bandit, flake8_bugbear, flake8_builtins, flake8_comprehensions, flake8_errmsg, flake8_implicit_str_concat, flake8_import_conventions, flake8_pytest_style, @@ -50,17 +50,17 @@ export interface Diagnostic { "#; #[derive(Serialize)] -struct ExpandedMessage { - code: SerializeRuleAsCode, +struct ExpandedMessage<'a> { + code: SerializeRuleAsCode<'a>, message: String, location: Location, end_location: Location, fix: Option, } -struct SerializeRuleAsCode(Rule); +struct SerializeRuleAsCode<'a>(&'a Rule); -impl Serialize for SerializeRuleAsCode { +impl Serialize for SerializeRuleAsCode<'_> { fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, @@ -69,8 +69,8 @@ impl Serialize for SerializeRuleAsCode { } } -impl From for SerializeRuleAsCode { - fn from(rule: Rule) -> Self { +impl<'a> From<&'a Rule> for SerializeRuleAsCode<'a> { + fn from(rule: &'a Rule) -> Self { Self(rule) } } @@ -207,14 +207,14 @@ pub fn check(contents: &str, options: JsValue) -> Result { let messages: Vec = diagnostics .into_iter() - .map(|diagnostic| ExpandedMessage { - code: diagnostic.kind.rule().clone().into(), - message: diagnostic.kind.body(), - location: diagnostic.location, - end_location: diagnostic.end_location, - fix: diagnostic.fix.map(|fix| ExpandedFix { + .map(|message| ExpandedMessage { + code: message.kind.rule().into(), + message: message.kind.body.clone(), + location: message.location, + end_location: message.end_location, + fix: message.fix.map(|fix| ExpandedFix { content: fix.content, - message: diagnostic.kind.commit(), + message: message.kind.commit, location: fix.location, end_location: fix.end_location, }), diff --git a/crates/ruff/src/linter.rs b/crates/ruff/src/linter.rs index 834c78519a..a318736cb0 100644 --- a/crates/ruff/src/linter.rs +++ b/crates/ruff/src/linter.rs @@ -21,7 +21,7 @@ use crate::directives::Directives; use crate::doc_lines::{doc_lines_from_ast, doc_lines_from_tokens}; use crate::message::{Message, Source}; use crate::noqa::{add_noqa, rule_is_ignored}; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::rules::pycodestyle; use crate::settings::{flags, Settings}; use crate::{directives, fs}; @@ -202,7 +202,7 @@ pub fn check_path( if !diagnostics.is_empty() && !settings.per_file_ignores.is_empty() { let ignores = fs::ignores_from_path(path, &settings.per_file_ignores); if !ignores.is_empty() { - diagnostics.retain(|diagnostic| !ignores.contains(&diagnostic.kind.rule())); + diagnostics.retain(|diagnostic| !ignores.contains(diagnostic.kind.rule())); } }; diff --git a/crates/ruff/src/noqa.rs b/crates/ruff/src/noqa.rs index e5eb8f0b83..603e8d68de 100644 --- a/crates/ruff/src/noqa.rs +++ b/crates/ruff/src/noqa.rs @@ -11,12 +11,13 @@ use regex::Regex; use rustc_hash::{FxHashMap, FxHashSet}; use rustpython_parser::ast::Location; -use crate::codes::NoqaCode; -use crate::registry::{Diagnostic, Rule}; -use crate::rule_redirects::get_redirect_target; use ruff_python_ast::source_code::{LineEnding, Locator}; use ruff_python_ast::types::Range; +use crate::codes::NoqaCode; +use crate::registry::{AsRule, Diagnostic, Rule}; +use crate::rule_redirects::get_redirect_target; + static NOQA_LINE_REGEX: Lazy = Lazy::new(|| { Regex::new( r"(?P\s*)(?P(?i:# noqa)(?::\s?(?P([A-Z]+[0-9]+(?:[,\s]+)?)+))?)", @@ -332,12 +333,13 @@ mod tests { use nohash_hasher::IntMap; use rustpython_parser::ast::Location; + use ruff_python_ast::source_code::LineEnding; + use ruff_python_ast::types::Range; + use crate::noqa::{add_noqa_inner, NOQA_LINE_REGEX}; use crate::registry::Diagnostic; use crate::rules::pycodestyle::rules::AmbiguousVariableName; use crate::rules::pyflakes; - use ruff_python_ast::source_code::LineEnding; - use ruff_python_ast::types::Range; #[test] fn regex() { diff --git a/crates/ruff/src/registry.rs b/crates/ruff/src/registry.rs index 215cf189a9..174b532225 100644 --- a/crates/ruff/src/registry.rs +++ b/crates/ruff/src/registry.rs @@ -1,15 +1,16 @@ //! Registry of [`Rule`] to [`DiagnosticKind`] mappings. -use ruff_macros::RuleNamespace; use rustpython_parser::ast::Location; use serde::{Deserialize, Serialize}; use strum_macros::{AsRefStr, EnumIter}; +use ruff_macros::RuleNamespace; +use ruff_python_ast::types::Range; + use crate::codes::{self, RuleCodePrefix}; use crate::fix::Fix; use crate::rules; use crate::violation::Violation; -use ruff_python_ast::types::Range; ruff_macros::register_rules!( // pycodestyle errors @@ -883,6 +884,18 @@ impl Rule { } } +#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +pub struct DiagnosticKind { + /// The identifier of the corresponding [`Rule`]. + pub name: String, + /// The message body to display to the user, to explain the diagnostic. + pub body: String, + /// The message to display to the user, to explain the suggested fix. + pub commit: Option, + /// Whether the diagnostic is automatically fixable. + pub fixable: bool, +} + #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Diagnostic { pub kind: DiagnosticKind, diff --git a/crates/ruff/src/rules/eradicate/snapshots/ruff__rules__eradicate__tests__ERA001_ERA001.py.snap b/crates/ruff/src/rules/eradicate/snapshots/ruff__rules__eradicate__tests__ERA001_ERA001.py.snap index 06c113c756..70bc98effa 100644 --- a/crates/ruff/src/rules/eradicate/snapshots/ruff__rules__eradicate__tests__ERA001_ERA001.py.snap +++ b/crates/ruff/src/rules/eradicate/snapshots/ruff__rules__eradicate__tests__ERA001_ERA001.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/eradicate/mod.rs expression: diagnostics --- - kind: - CommentedOutCode: ~ + name: CommentedOutCode + body: Found commented-out code + commit: Remove commented-out code + fixable: true location: row: 1 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CommentedOutCode: ~ + name: CommentedOutCode + body: Found commented-out code + commit: Remove commented-out code + fixable: true location: row: 2 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CommentedOutCode: ~ + name: CommentedOutCode + body: Found commented-out code + commit: Remove commented-out code + fixable: true location: row: 3 column: 0 @@ -54,7 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CommentedOutCode: ~ + name: CommentedOutCode + body: Found commented-out code + commit: Remove commented-out code + fixable: true location: row: 5 column: 0 @@ -71,7 +83,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CommentedOutCode: ~ + name: CommentedOutCode + body: Found commented-out code + commit: Remove commented-out code + fixable: true location: row: 12 column: 4 diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT101_YTT101.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT101_YTT101.py.snap index 69b345f3be..8fcf8ab040 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT101_YTT101.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT101_YTT101.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_2020/mod.rs +source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- - kind: - SysVersionSlice3Referenced: ~ + name: SysVersionSlice3Referenced + body: "`sys.version[:3]` referenced (python3.10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 6 column: 6 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionSlice3Referenced: ~ + name: SysVersionSlice3Referenced + body: "`sys.version[:3]` referenced (python3.10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 7 column: 6 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionSlice3Referenced: ~ + name: SysVersionSlice3Referenced + body: "`sys.version[:3]` referenced (python3.10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 8 column: 6 diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT102_YTT102.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT102_YTT102.py.snap index 36e5435a50..e17cfc3d3d 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT102_YTT102.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT102_YTT102.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_2020/mod.rs +source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- - kind: - SysVersion2Referenced: ~ + name: SysVersion2Referenced + body: "`sys.version[2]` referenced (python3.10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 4 column: 11 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersion2Referenced: ~ + name: SysVersion2Referenced + body: "`sys.version[2]` referenced (python3.10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 5 column: 11 diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT103_YTT103.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT103_YTT103.py.snap index 73e247a950..fdee5225eb 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT103_YTT103.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT103_YTT103.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_2020/mod.rs +source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- - kind: - SysVersionCmpStr3: ~ + name: SysVersionCmpStr3 + body: "`sys.version` compared to string (python3.10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionCmpStr3: ~ + name: SysVersionCmpStr3 + body: "`sys.version` compared to string (python3.10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionCmpStr3: ~ + name: SysVersionCmpStr3 + body: "`sys.version` compared to string (python3.10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionCmpStr3: ~ + name: SysVersionCmpStr3 + body: "`sys.version` compared to string (python3.10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionCmpStr3: ~ + name: SysVersionCmpStr3 + body: "`sys.version` compared to string (python3.10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 8 column: 0 diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT201_YTT201.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT201_YTT201.py.snap index 6149f9585c..692a432d29 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT201_YTT201.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT201_YTT201.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_2020/mod.rs +source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- - kind: - SysVersionInfo0Eq3Referenced: ~ + name: SysVersionInfo0Eq3Referenced + body: "`sys.version_info[0] == 3` referenced (python4), use `>=`" + commit: ~ + fixable: false location: row: 7 column: 6 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionInfo0Eq3Referenced: ~ + name: SysVersionInfo0Eq3Referenced + body: "`sys.version_info[0] == 3` referenced (python4), use `>=`" + commit: ~ + fixable: false location: row: 8 column: 6 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionInfo0Eq3Referenced: ~ + name: SysVersionInfo0Eq3Referenced + body: "`sys.version_info[0] == 3` referenced (python4), use `>=`" + commit: ~ + fixable: false location: row: 9 column: 6 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionInfo0Eq3Referenced: ~ + name: SysVersionInfo0Eq3Referenced + body: "`sys.version_info[0] == 3` referenced (python4), use `>=`" + commit: ~ + fixable: false location: row: 10 column: 6 diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT202_YTT202.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT202_YTT202.py.snap index 46bf6cdfdd..54fec5bace 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT202_YTT202.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT202_YTT202.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_2020/mod.rs +source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- - kind: - SixPY3Referenced: ~ + name: SixPY3Referenced + body: "`six.PY3` referenced (python4), use `not six.PY2`" + commit: ~ + fixable: false location: row: 4 column: 3 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SixPY3Referenced: ~ + name: SixPY3Referenced + body: "`six.PY3` referenced (python4), use `not six.PY2`" + commit: ~ + fixable: false location: row: 6 column: 3 diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT203_YTT203.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT203_YTT203.py.snap index 51ffa966c9..ef65a122e1 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT203_YTT203.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT203_YTT203.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_2020/mod.rs +source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- - kind: - SysVersionInfo1CmpInt: ~ + name: SysVersionInfo1CmpInt + body: "`sys.version_info[1]` compared to integer (python4), compare `sys.version_info` to tuple" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionInfo1CmpInt: ~ + name: SysVersionInfo1CmpInt + body: "`sys.version_info[1]` compared to integer (python4), compare `sys.version_info` to tuple" + commit: ~ + fixable: false location: row: 5 column: 0 diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT204_YTT204.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT204_YTT204.py.snap index 3935df9d53..e695bfd9f2 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT204_YTT204.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT204_YTT204.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_2020/mod.rs +source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- - kind: - SysVersionInfoMinorCmpInt: ~ + name: SysVersionInfoMinorCmpInt + body: "`sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionInfoMinorCmpInt: ~ + name: SysVersionInfoMinorCmpInt + body: "`sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple" + commit: ~ + fixable: false location: row: 5 column: 0 diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT301_YTT301.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT301_YTT301.py.snap index aeac254f7c..b9352f3537 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT301_YTT301.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT301_YTT301.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_2020/mod.rs +source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- - kind: - SysVersion0Referenced: ~ + name: SysVersion0Referenced + body: "`sys.version[0]` referenced (python10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 4 column: 11 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersion0Referenced: ~ + name: SysVersion0Referenced + body: "`sys.version[0]` referenced (python10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 5 column: 11 diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT302_YTT302.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT302_YTT302.py.snap index 6084621298..5344b14f41 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT302_YTT302.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT302_YTT302.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_2020/mod.rs +source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- - kind: - SysVersionCmpStr10: ~ + name: SysVersionCmpStr10 + body: "`sys.version` compared to string (python10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionCmpStr10: ~ + name: SysVersionCmpStr10 + body: "`sys.version` compared to string (python10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionCmpStr10: ~ + name: SysVersionCmpStr10 + body: "`sys.version` compared to string (python10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionCmpStr10: ~ + name: SysVersionCmpStr10 + body: "`sys.version` compared to string (python10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionCmpStr10: ~ + name: SysVersionCmpStr10 + body: "`sys.version` compared to string (python10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 8 column: 0 diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT303_YTT303.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT303_YTT303.py.snap index c40c6116dd..06c49a08c2 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT303_YTT303.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT303_YTT303.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_2020/mod.rs +source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- - kind: - SysVersionSlice1Referenced: ~ + name: SysVersionSlice1Referenced + body: "`sys.version[:1]` referenced (python10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 4 column: 6 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SysVersionSlice1Referenced: ~ + name: SysVersionSlice1Referenced + body: "`sys.version[:1]` referenced (python10), use `sys.version_info`" + commit: ~ + fixable: false location: row: 5 column: 6 diff --git a/crates/ruff/src/rules/flake8_annotations/rules.rs b/crates/ruff/src/rules/flake8_annotations/rules.rs index 91fd5fa676..b4d9c15e98 100644 --- a/crates/ruff/src/rules/flake8_annotations/rules.rs +++ b/crates/ruff/src/rules/flake8_annotations/rules.rs @@ -11,7 +11,7 @@ use ruff_python_ast::{cast, helpers}; use crate::checkers::ast::Checker; use crate::docstrings::definition::{Definition, DefinitionKind}; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::violation::{AlwaysAutofixableViolation, Violation}; use super::fixes; diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_overload.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_overload.snap index c2c5694329..9a4ccfdcf8 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_overload.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_overload.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_annotations/mod.rs +source: crates/ruff/src/rules/flake8_annotations/mod.rs expression: diagnostics --- - kind: - MissingReturnTypePublicFunction: - name: bar + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `bar`" + commit: ~ + fixable: false location: row: 29 column: 8 diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_star_arg_any.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_star_arg_any.snap index 374681e49a..1fb8f963fb 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_star_arg_any.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_star_arg_any.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs expression: diagnostics --- - kind: - AnyType: - name: a + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `a`" + commit: ~ + fixable: false location: row: 10 column: 11 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: foo + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `foo`" + commit: ~ + fixable: false location: row: 15 column: 46 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: a + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `a`" + commit: ~ + fixable: false location: row: 40 column: 28 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: foo_method + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `foo_method`" + commit: ~ + fixable: false location: row: 44 column: 66 diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__defaults.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__defaults.snap index 3e5c6451bc..25f5e20e1f 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__defaults.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__defaults.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs expression: diagnostics --- - kind: - MissingReturnTypePublicFunction: - name: foo + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `foo`" + commit: ~ + fixable: false location: row: 4 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingTypeFunctionArgument: - name: a + name: MissingTypeFunctionArgument + body: "Missing type annotation for function argument `a`" + commit: ~ + fixable: false location: row: 4 column: 8 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingTypeFunctionArgument: - name: b + name: MissingTypeFunctionArgument + body: "Missing type annotation for function argument `b`" + commit: ~ + fixable: false location: row: 4 column: 11 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingReturnTypePublicFunction: - name: foo + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `foo`" + commit: ~ + fixable: false location: row: 9 column: 4 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingTypeFunctionArgument: - name: b + name: MissingTypeFunctionArgument + body: "Missing type annotation for function argument `b`" + commit: ~ + fixable: false location: row: 9 column: 16 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingTypeFunctionArgument: - name: b + name: MissingTypeFunctionArgument + body: "Missing type annotation for function argument `b`" + commit: ~ + fixable: false location: row: 14 column: 16 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingReturnTypePublicFunction: - name: foo + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `foo`" + commit: ~ + fixable: false location: row: 19 column: 4 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingReturnTypePublicFunction: - name: foo + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `foo`" + commit: ~ + fixable: false location: row: 24 column: 4 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: a + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `a`" + commit: ~ + fixable: false location: row: 44 column: 11 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: foo + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `foo`" + commit: ~ + fixable: false location: row: 49 column: 46 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: "*args" + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `*args`" + commit: ~ + fixable: false location: row: 54 column: 23 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: "**kwargs" + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `**kwargs`" + commit: ~ + fixable: false location: row: 54 column: 38 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: "*args" + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `*args`" + commit: ~ + fixable: false location: row: 59 column: 23 @@ -146,8 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: "**kwargs" + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `**kwargs`" + commit: ~ + fixable: false location: row: 64 column: 38 @@ -157,8 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingTypeSelf: - name: self + name: MissingTypeSelf + body: "Missing type annotation for `self` in method" + commit: ~ + fixable: false location: row: 74 column: 12 @@ -168,8 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: a + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `a`" + commit: ~ + fixable: false location: row: 78 column: 28 @@ -179,8 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: foo + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `foo`" + commit: ~ + fixable: false location: row: 82 column: 66 @@ -190,8 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: "*params" + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `*params`" + commit: ~ + fixable: false location: row: 86 column: 42 @@ -201,8 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: "**options" + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `**options`" + commit: ~ + fixable: false location: row: 86 column: 58 @@ -212,8 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: "*params" + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `*params`" + commit: ~ + fixable: false location: row: 90 column: 42 @@ -223,8 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AnyType: - name: "**options" + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `**options`" + commit: ~ + fixable: false location: row: 94 column: 58 @@ -234,8 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingTypeCls: - name: cls + name: MissingTypeCls + body: "Missing type annotation for `cls` in classmethod" + commit: ~ + fixable: false location: row: 104 column: 12 @@ -245,8 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingTypeSelf: - name: self + name: MissingTypeSelf + body: "Missing type annotation for `self` in method" + commit: ~ + fixable: false location: row: 108 column: 12 diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__ignore_fully_untyped.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__ignore_fully_untyped.snap index b43a0bfdc4..89a39cc890 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__ignore_fully_untyped.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__ignore_fully_untyped.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs expression: diagnostics --- - kind: - MissingReturnTypePublicFunction: - name: error_partially_typed_1 + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `error_partially_typed_1`" + commit: ~ + fixable: false location: row: 24 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingTypeFunctionArgument: - name: b + name: MissingTypeFunctionArgument + body: "Missing type annotation for function argument `b`" + commit: ~ + fixable: false location: row: 24 column: 36 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingTypeFunctionArgument: - name: b + name: MissingTypeFunctionArgument + body: "Missing type annotation for function argument `b`" + commit: ~ + fixable: false location: row: 28 column: 36 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingReturnTypePublicFunction: - name: error_partially_typed_3 + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `error_partially_typed_3`" + commit: ~ + fixable: false location: row: 32 column: 4 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingReturnTypePublicFunction: - name: error_typed_self + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `error_typed_self`" + commit: ~ + fixable: false location: row: 43 column: 8 diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__mypy_init_return.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__mypy_init_return.snap index a134fd9184..de6652fc6e 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__mypy_init_return.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__mypy_init_return.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs expression: diagnostics --- - kind: - MissingReturnTypeSpecialMethod: - name: __init__ + name: MissingReturnTypeSpecialMethod + body: "Missing return type annotation for special method `__init__`" + commit: "Add `None` return type" + fixable: true location: row: 5 column: 8 @@ -21,8 +23,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - MissingReturnTypeSpecialMethod: - name: __init__ + name: MissingReturnTypeSpecialMethod + body: "Missing return type annotation for special method `__init__`" + commit: "Add `None` return type" + fixable: true location: row: 11 column: 8 @@ -39,8 +43,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - MissingReturnTypePrivateFunction: - name: __init__ + name: MissingReturnTypePrivateFunction + body: "Missing return type annotation for private function `__init__`" + commit: ~ + fixable: false location: row: 40 column: 4 @@ -50,8 +56,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingReturnTypeSpecialMethod: - name: __init__ + name: MissingReturnTypeSpecialMethod + body: "Missing return type annotation for special method `__init__`" + commit: "Add `None` return type" + fixable: true location: row: 47 column: 8 diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_none_returning.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_none_returning.snap index 86c5371be1..053b107ea5 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_none_returning.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_none_returning.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs expression: diagnostics --- - kind: - MissingReturnTypePublicFunction: - name: foo + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `foo`" + commit: ~ + fixable: false location: row: 45 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingReturnTypePublicFunction: - name: foo + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `foo`" + commit: ~ + fixable: false location: row: 50 column: 4 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingTypeFunctionArgument: - name: a + name: MissingTypeFunctionArgument + body: "Missing type annotation for function argument `a`" + commit: ~ + fixable: false location: row: 59 column: 8 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S101_S101.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S101_S101.py.snap index 3036c7a844..6eb98a4961 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S101_S101.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S101_S101.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - Assert: ~ + name: Assert + body: "Use of `assert` detected" + commit: ~ + fixable: false location: row: 2 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - Assert: ~ + name: Assert + body: "Use of `assert` detected" + commit: ~ + fixable: false location: row: 8 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - Assert: ~ + name: Assert + body: "Use of `assert` detected" + commit: ~ + fixable: false location: row: 11 column: 4 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S102_S102.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S102_S102.py.snap index f99baafd24..db890e15e5 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S102_S102.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S102_S102.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - ExecBuiltin: ~ + name: ExecBuiltin + body: "Use of `exec` detected" + commit: ~ + fixable: false location: row: 3 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ExecBuiltin: ~ + name: ExecBuiltin + body: "Use of `exec` detected" + commit: ~ + fixable: false location: row: 5 column: 0 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S103_S103.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S103_S103.py.snap index 885e91e99a..2140d41bd4 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S103_S103.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S103_S103.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bandit/mod.rs +source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - BadFilePermissions: - mask: 151 + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o227` on file or directory" + commit: ~ + fixable: false location: row: 6 column: 24 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadFilePermissions: - mask: 7 + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o7` on file or directory" + commit: ~ + fixable: false location: row: 7 column: 24 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadFilePermissions: - mask: 511 + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o777` on file or directory" + commit: ~ + fixable: false location: row: 9 column: 24 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadFilePermissions: - mask: 504 + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o770` on file or directory" + commit: ~ + fixable: false location: row: 10 column: 24 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadFilePermissions: - mask: 510 + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o776` on file or directory" + commit: ~ + fixable: false location: row: 11 column: 24 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadFilePermissions: - mask: 511 + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o777` on file or directory" + commit: ~ + fixable: false location: row: 13 column: 22 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadFilePermissions: - mask: 511 + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o777` on file or directory" + commit: ~ + fixable: false location: row: 14 column: 23 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadFilePermissions: - mask: 511 + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o777` on file or directory" + commit: ~ + fixable: false location: row: 15 column: 24 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadFilePermissions: - mask: 511 + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o777` on file or directory" + commit: ~ + fixable: false location: row: 17 column: 18 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadFilePermissions: - mask: 511 + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o777` on file or directory" + commit: ~ + fixable: false location: row: 18 column: 18 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadFilePermissions: - mask: 511 + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o777` on file or directory" + commit: ~ + fixable: false location: row: 19 column: 18 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadFilePermissions: - mask: 8 + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o10` on file or directory" + commit: ~ + fixable: false location: row: 20 column: 26 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadFilePermissions: - mask: 2 + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o2` on file or directory" + commit: ~ + fixable: false location: row: 22 column: 24 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S104_S104.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S104_S104.py.snap index 1be1484be9..a0752c60e5 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S104_S104.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S104_S104.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bandit/mod.rs +source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - HardcodedBindAllInterfaces: ~ + name: HardcodedBindAllInterfaces + body: Possible binding to all interfaces + commit: ~ + fixable: false location: row: 9 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedBindAllInterfaces: ~ + name: HardcodedBindAllInterfaces + body: Possible binding to all interfaces + commit: ~ + fixable: false location: row: 10 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedBindAllInterfaces: ~ + name: HardcodedBindAllInterfaces + body: Possible binding to all interfaces + commit: ~ + fixable: false location: row: 14 column: 5 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedBindAllInterfaces: ~ + name: HardcodedBindAllInterfaces + body: Possible binding to all interfaces + commit: ~ + fixable: false location: row: 18 column: 8 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S105_S105.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S105_S105.py.snap index b6b286d4d0..5b9483a3b9 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S105_S105.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S105_S105.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 13 column: 11 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 14 column: 8 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 15 column: 9 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 16 column: 6 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 17 column: 9 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 18 column: 8 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 19 column: 10 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 20 column: 18 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 21 column: 18 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 22 column: 11 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 23 column: 11 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 25 column: 16 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 26 column: 12 @@ -146,8 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 27 column: 14 @@ -157,8 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 28 column: 11 @@ -168,8 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 29 column: 14 @@ -179,8 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 30 column: 13 @@ -190,8 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 31 column: 15 @@ -201,8 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 32 column: 23 @@ -212,8 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 33 column: 23 @@ -223,8 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 37 column: 15 @@ -234,8 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 41 column: 19 @@ -245,8 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 42 column: 16 @@ -256,8 +302,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 43 column: 17 @@ -267,8 +315,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 44 column: 14 @@ -278,8 +328,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 45 column: 17 @@ -289,8 +341,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 46 column: 16 @@ -300,8 +354,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 47 column: 18 @@ -311,8 +367,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 49 column: 12 @@ -322,8 +380,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 50 column: 9 @@ -333,8 +393,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 51 column: 10 @@ -344,8 +406,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 52 column: 7 @@ -355,8 +419,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 53 column: 10 @@ -366,8 +432,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 54 column: 9 @@ -377,8 +445,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 55 column: 11 @@ -388,8 +458,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: s3cr3t + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 56 column: 20 @@ -399,8 +471,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: "1\n2" + name: HardcodedPasswordString + body: "Possible hardcoded password: \"1\\n2\"" + commit: ~ + fixable: false location: row: 58 column: 12 @@ -410,8 +484,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: "3\t4" + name: HardcodedPasswordString + body: "Possible hardcoded password: \"3\\t4\"" + commit: ~ + fixable: false location: row: 61 column: 12 @@ -421,8 +497,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordString: - string: "5\r6" + name: HardcodedPasswordString + body: "Possible hardcoded password: \"5\\r6\"" + commit: ~ + fixable: false location: row: 64 column: 12 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S106_S106.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S106_S106.py.snap index 2b82892c5b..0109515f8c 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S106_S106.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S106_S106.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bandit/mod.rs +source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - HardcodedPasswordFuncArg: - string: s3cr3t + name: HardcodedPasswordFuncArg + body: "Possible hardcoded password: \"s3cr3t\"" + commit: ~ + fixable: false location: row: 14 column: 8 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S107_S107.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S107_S107.py.snap index 106ad3a790..4f4dcca2d2 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S107_S107.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S107_S107.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bandit/mod.rs +source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - HardcodedPasswordDefault: - string: default + name: HardcodedPasswordDefault + body: "Possible hardcoded password: \"default\"" + commit: ~ + fixable: false location: row: 5 column: 28 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordDefault: - string: posonly + name: HardcodedPasswordDefault + body: "Possible hardcoded password: \"posonly\"" + commit: ~ + fixable: false location: row: 13 column: 44 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordDefault: - string: kwonly + name: HardcodedPasswordDefault + body: "Possible hardcoded password: \"kwonly\"" + commit: ~ + fixable: false location: row: 21 column: 38 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordDefault: - string: posonly + name: HardcodedPasswordDefault + body: "Possible hardcoded password: \"posonly\"" + commit: ~ + fixable: false location: row: 29 column: 38 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedPasswordDefault: - string: kwonly + name: HardcodedPasswordDefault + body: "Possible hardcoded password: \"kwonly\"" + commit: ~ + fixable: false location: row: 29 column: 61 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_S108.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_S108.py.snap index e11ea15057..5062bd5b3b 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_S108.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_S108.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bandit/mod.rs +source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - HardcodedTempFile: - string: /tmp/abc + name: HardcodedTempFile + body: "Probable insecure usage of temporary file or directory: \"/tmp/abc\"" + commit: ~ + fixable: false location: row: 5 column: 10 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedTempFile: - string: /var/tmp/123 + name: HardcodedTempFile + body: "Probable insecure usage of temporary file or directory: \"/var/tmp/123\"" + commit: ~ + fixable: false location: row: 8 column: 10 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedTempFile: - string: /dev/shm/unit/test + name: HardcodedTempFile + body: "Probable insecure usage of temporary file or directory: \"/dev/shm/unit/test\"" + commit: ~ + fixable: false location: row: 11 column: 10 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_extend.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_extend.snap index 4c35ea16c3..c138b2e66e 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_extend.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_extend.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bandit/mod.rs +source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - HardcodedTempFile: - string: /tmp/abc + name: HardcodedTempFile + body: "Probable insecure usage of temporary file or directory: \"/tmp/abc\"" + commit: ~ + fixable: false location: row: 5 column: 10 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedTempFile: - string: /var/tmp/123 + name: HardcodedTempFile + body: "Probable insecure usage of temporary file or directory: \"/var/tmp/123\"" + commit: ~ + fixable: false location: row: 8 column: 10 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedTempFile: - string: /dev/shm/unit/test + name: HardcodedTempFile + body: "Probable insecure usage of temporary file or directory: \"/dev/shm/unit/test\"" + commit: ~ + fixable: false location: row: 11 column: 10 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedTempFile: - string: /foo/bar + name: HardcodedTempFile + body: "Probable insecure usage of temporary file or directory: \"/foo/bar\"" + commit: ~ + fixable: false location: row: 15 column: 10 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_S110.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_S110.py.snap index fa84ca9ab5..a911507a3d 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_S110.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_S110.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - TryExceptPass: ~ + name: TryExceptPass + body: "`try`-`except`-`pass` detected, consider logging the exception" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TryExceptPass: ~ + name: TryExceptPass + body: "`try`-`except`-`pass` detected, consider logging the exception" + commit: ~ + fixable: false location: row: 8 column: 0 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_typed.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_typed.snap index 2f7ce24e16..56821e7459 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_typed.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_typed.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - TryExceptPass: ~ + name: TryExceptPass + body: "`try`-`except`-`pass` detected, consider logging the exception" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TryExceptPass: ~ + name: TryExceptPass + body: "`try`-`except`-`pass` detected, consider logging the exception" + commit: ~ + fixable: false location: row: 8 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TryExceptPass: ~ + name: TryExceptPass + body: "`try`-`except`-`pass` detected, consider logging the exception" + commit: ~ + fixable: false location: row: 13 column: 0 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S112_S112.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S112_S112.py.snap index 36a8846f72..6f326be3a4 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S112_S112.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S112_S112.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - TryExceptContinue: ~ + name: TryExceptContinue + body: "`try`-`except`-`continue` detected, consider logging the exception" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TryExceptContinue: ~ + name: TryExceptContinue + body: "`try`-`except`-`continue` detected, consider logging the exception" + commit: ~ + fixable: false location: row: 8 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TryExceptContinue: ~ + name: TryExceptContinue + body: "`try`-`except`-`continue` detected, consider logging the exception" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TryExceptContinue: ~ + name: TryExceptContinue + body: "`try`-`except`-`continue` detected, consider logging the exception" + commit: ~ + fixable: false location: row: 18 column: 0 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S113_S113.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S113_S113.py.snap index bda5d3925b..040c00e48b 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S113_S113.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S113_S113.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bandit/mod.rs +source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - RequestWithoutTimeout: - timeout: ~ + name: RequestWithoutTimeout + body: Probable use of requests call without timeout + commit: ~ + fixable: false location: row: 3 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithoutTimeout: - timeout: None + name: RequestWithoutTimeout + body: "Probable use of requests call with timeout set to `None`" + commit: ~ + fixable: false location: row: 4 column: 42 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithoutTimeout: - timeout: ~ + name: RequestWithoutTimeout + body: Probable use of requests call without timeout + commit: ~ + fixable: false location: row: 6 column: 0 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithoutTimeout: - timeout: None + name: RequestWithoutTimeout + body: "Probable use of requests call with timeout set to `None`" + commit: ~ + fixable: false location: row: 7 column: 43 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithoutTimeout: - timeout: ~ + name: RequestWithoutTimeout + body: Probable use of requests call without timeout + commit: ~ + fixable: false location: row: 9 column: 0 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithoutTimeout: - timeout: None + name: RequestWithoutTimeout + body: "Probable use of requests call with timeout set to `None`" + commit: ~ + fixable: false location: row: 10 column: 42 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithoutTimeout: - timeout: ~ + name: RequestWithoutTimeout + body: Probable use of requests call without timeout + commit: ~ + fixable: false location: row: 12 column: 0 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithoutTimeout: - timeout: None + name: RequestWithoutTimeout + body: "Probable use of requests call with timeout set to `None`" + commit: ~ + fixable: false location: row: 13 column: 45 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithoutTimeout: - timeout: ~ + name: RequestWithoutTimeout + body: Probable use of requests call without timeout + commit: ~ + fixable: false location: row: 15 column: 0 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithoutTimeout: - timeout: None + name: RequestWithoutTimeout + body: "Probable use of requests call with timeout set to `None`" + commit: ~ + fixable: false location: row: 16 column: 44 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithoutTimeout: - timeout: ~ + name: RequestWithoutTimeout + body: Probable use of requests call without timeout + commit: ~ + fixable: false location: row: 18 column: 0 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithoutTimeout: - timeout: None + name: RequestWithoutTimeout + body: "Probable use of requests call with timeout set to `None`" + commit: ~ + fixable: false location: row: 19 column: 46 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithoutTimeout: - timeout: ~ + name: RequestWithoutTimeout + body: Probable use of requests call without timeout + commit: ~ + fixable: false location: row: 21 column: 0 @@ -146,8 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithoutTimeout: - timeout: None + name: RequestWithoutTimeout + body: "Probable use of requests call with timeout set to `None`" + commit: ~ + fixable: false location: row: 22 column: 43 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S324_S324.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S324_S324.py.snap index 9e085b2b23..4cff81e670 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S324_S324.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S324_S324.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bandit/mod.rs +source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - HashlibInsecureHashFunction: - string: md5 + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `md5`" + commit: ~ + fixable: false location: row: 7 column: 12 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HashlibInsecureHashFunction: - string: md4 + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `md4`" + commit: ~ + fixable: false location: row: 9 column: 12 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HashlibInsecureHashFunction: - string: md5 + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `md5`" + commit: ~ + fixable: false location: row: 11 column: 17 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HashlibInsecureHashFunction: - string: MD4 + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `MD4`" + commit: ~ + fixable: false location: row: 13 column: 12 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HashlibInsecureHashFunction: - string: sha1 + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `sha1`" + commit: ~ + fixable: false location: row: 15 column: 12 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HashlibInsecureHashFunction: - string: sha1 + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `sha1`" + commit: ~ + fixable: false location: row: 17 column: 12 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HashlibInsecureHashFunction: - string: sha + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `sha`" + commit: ~ + fixable: false location: row: 19 column: 12 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HashlibInsecureHashFunction: - string: SHA + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `SHA`" + commit: ~ + fixable: false location: row: 21 column: 17 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HashlibInsecureHashFunction: - string: sha + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `sha`" + commit: ~ + fixable: false location: row: 23 column: 0 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HashlibInsecureHashFunction: - string: md5 + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `md5`" + commit: ~ + fixable: false location: row: 25 column: 0 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HashlibInsecureHashFunction: - string: sha1 + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `sha1`" + commit: ~ + fixable: false location: row: 27 column: 12 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HashlibInsecureHashFunction: - string: sha1 + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `sha1`" + commit: ~ + fixable: false location: row: 29 column: 0 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HashlibInsecureHashFunction: - string: sha1 + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `sha1`" + commit: ~ + fixable: false location: row: 32 column: 12 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S501_S501.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S501_S501.py.snap index 6b62c4154d..d8d3871916 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S501_S501.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S501_S501.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bandit/mod.rs +source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - RequestWithNoCertValidation: - string: requests + name: RequestWithNoCertValidation + body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 5 column: 53 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: requests + name: RequestWithNoCertValidation + body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 7 column: 54 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: requests + name: RequestWithNoCertValidation + body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 9 column: 53 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: requests + name: RequestWithNoCertValidation + body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 11 column: 56 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: requests + name: RequestWithNoCertValidation + body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 13 column: 55 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: requests + name: RequestWithNoCertValidation + body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 15 column: 57 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: requests + name: RequestWithNoCertValidation + body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 17 column: 54 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: httpx + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 20 column: 49 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: httpx + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 22 column: 38 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: httpx + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 24 column: 42 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: httpx + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 26 column: 39 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: httpx + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 28 column: 39 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: httpx + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 30 column: 38 @@ -146,8 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: httpx + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 32 column: 40 @@ -157,8 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: httpx + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 34 column: 41 @@ -168,8 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: httpx + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 36 column: 41 @@ -179,8 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: httpx + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 38 column: 20 @@ -190,8 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RequestWithNoCertValidation: - string: httpx + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + commit: ~ + fixable: false location: row: 40 column: 25 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S506_S506.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S506_S506.py.snap index d5785f1476..d2e8f564df 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S506_S506.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S506_S506.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bandit/mod.rs +source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - UnsafeYAMLLoad: - loader: ~ + name: UnsafeYAMLLoad + body: "Probable use of unsafe `yaml.load`. Allows instantiation of arbitrary objects. Consider `yaml.safe_load`." + commit: ~ + fixable: false location: row: 10 column: 8 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnsafeYAMLLoad: - loader: Loader + name: UnsafeYAMLLoad + body: "Probable use of unsafe loader `Loader` with `yaml.load`. Allows instantiation of arbitrary objects. Consider `yaml.safe_load`." + commit: ~ + fixable: false location: row: 24 column: 23 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S508_S508.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S508_S508.py.snap index 18e0619a18..1070f4fcb0 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S508_S508.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S508_S508.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bandit/mod.rs +source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - SnmpInsecureVersion: ~ + name: SnmpInsecureVersion + body: The use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able. + commit: ~ + fixable: false location: row: 3 column: 32 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SnmpInsecureVersion: ~ + name: SnmpInsecureVersion + body: The use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able. + commit: ~ + fixable: false location: row: 4 column: 32 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S509_S509.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S509_S509.py.snap index 213a8ebb7d..1e51f63e9c 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S509_S509.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S509_S509.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bandit/mod.rs +source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - SnmpWeakCryptography: ~ + name: SnmpWeakCryptography + body: "You should not use SNMPv3 without encryption. `noAuthNoPriv` & `authNoPriv` is insecure." + commit: ~ + fixable: false location: row: 4 column: 11 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SnmpWeakCryptography: ~ + name: SnmpWeakCryptography + body: "You should not use SNMPv3 without encryption. `noAuthNoPriv` & `authNoPriv` is insecure." + commit: ~ + fixable: false location: row: 5 column: 15 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S608_S608.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S608_S608.py.snap index 8ec14a3511..afa720f2d0 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S608_S608.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S608_S608.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 2 column: 9 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 3 column: 9 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 4 column: 9 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 5 column: 9 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 6 column: 9 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 8 column: 9 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 9 column: 9 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 10 column: 9 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 11 column: 9 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 12 column: 10 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 14 column: 10 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 15 column: 10 @@ -123,7 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 16 column: 10 @@ -133,7 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 17 column: 10 @@ -143,7 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 19 column: 10 @@ -153,7 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 20 column: 10 @@ -163,7 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 21 column: 10 @@ -173,7 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 22 column: 10 @@ -183,7 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 24 column: 10 @@ -193,7 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 25 column: 10 @@ -203,7 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 26 column: 10 @@ -213,7 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 27 column: 10 @@ -223,7 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 28 column: 10 @@ -233,7 +302,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 30 column: 10 @@ -243,7 +315,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 31 column: 10 @@ -253,7 +328,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 32 column: 10 @@ -263,7 +341,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 33 column: 10 @@ -273,7 +354,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 34 column: 10 @@ -283,7 +367,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 36 column: 10 @@ -293,7 +380,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 37 column: 10 @@ -303,7 +393,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 38 column: 10 @@ -313,7 +406,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 39 column: 10 @@ -323,7 +419,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 41 column: 10 @@ -333,7 +432,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 42 column: 10 @@ -343,7 +445,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 43 column: 10 @@ -353,7 +458,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 44 column: 10 @@ -363,7 +471,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 48 column: 11 @@ -373,7 +484,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 55 column: 11 @@ -383,7 +497,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 62 column: 11 @@ -393,7 +510,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 69 column: 11 @@ -403,7 +523,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 77 column: 8 @@ -413,7 +536,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 83 column: 25 @@ -423,7 +549,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 84 column: 25 @@ -433,7 +562,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 85 column: 25 @@ -443,7 +575,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - HardcodedSQLExpression: ~ + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + commit: ~ + fixable: false location: row: 86 column: 29 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S612_S612.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S612_S612.py.snap index f5281465de..3232c33e95 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S612_S612.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S612_S612.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bandit/mod.rs +source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - LoggingConfigInsecureListen: ~ + name: LoggingConfigInsecureListen + body: "Use of insecure `logging.config.listen` detected" + commit: ~ + fixable: false location: row: 3 column: 4 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S701_S701.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S701_S701.py.snap index 7ef4baba90..dbeb509003 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S701_S701.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S701_S701.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bandit/mod.rs +source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- - kind: - Jinja2AutoescapeFalse: - value: true + name: Jinja2AutoescapeFalse + body: "Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function." + commit: ~ + fixable: false location: row: 9 column: 67 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - Jinja2AutoescapeFalse: - value: true + name: Jinja2AutoescapeFalse + body: "Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function." + commit: ~ + fixable: false location: row: 10 column: 44 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - Jinja2AutoescapeFalse: - value: true + name: Jinja2AutoescapeFalse + body: "Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function." + commit: ~ + fixable: false location: row: 13 column: 23 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - Jinja2AutoescapeFalse: - value: false + name: Jinja2AutoescapeFalse + body: "By default, jinja2 sets `autoescape` to `False`. Consider using `autoescape=True` or the `select_autoescape` function to mitigate XSS vulnerabilities." + commit: ~ + fixable: false location: row: 15 column: 0 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - Jinja2AutoescapeFalse: - value: true + name: Jinja2AutoescapeFalse + body: "Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function." + commit: ~ + fixable: false location: row: 29 column: 46 diff --git a/crates/ruff/src/rules/flake8_blind_except/snapshots/ruff__rules__flake8_blind_except__tests__BLE001_BLE.py.snap b/crates/ruff/src/rules/flake8_blind_except/snapshots/ruff__rules__flake8_blind_except__tests__BLE001_BLE.py.snap index 365d60b10b..1860f2c1c2 100644 --- a/crates/ruff/src/rules/flake8_blind_except/snapshots/ruff__rules__flake8_blind_except__tests__BLE001_BLE.py.snap +++ b/crates/ruff/src/rules/flake8_blind_except/snapshots/ruff__rules__flake8_blind_except__tests__BLE001_BLE.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_blind_except/mod.rs +source: crates/ruff/src/rules/flake8_blind_except/mod.rs expression: diagnostics --- - kind: - BlindExcept: - name: BaseException + name: BlindExcept + body: "Do not catch blind exception: `BaseException`" + commit: ~ + fixable: false location: row: 25 column: 7 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlindExcept: - name: Exception + name: BlindExcept + body: "Do not catch blind exception: `Exception`" + commit: ~ + fixable: false location: row: 31 column: 7 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlindExcept: - name: Exception + name: BlindExcept + body: "Do not catch blind exception: `Exception`" + commit: ~ + fixable: false location: row: 42 column: 7 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlindExcept: - name: BaseException + name: BlindExcept + body: "Do not catch blind exception: `BaseException`" + commit: ~ + fixable: false location: row: 45 column: 11 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlindExcept: - name: Exception + name: BlindExcept + body: "Do not catch blind exception: `Exception`" + commit: ~ + fixable: false location: row: 54 column: 7 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlindExcept: - name: Exception + name: BlindExcept + body: "Do not catch blind exception: `Exception`" + commit: ~ + fixable: false location: row: 60 column: 7 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlindExcept: - name: BaseException + name: BlindExcept + body: "Do not catch blind exception: `BaseException`" + commit: ~ + fixable: false location: row: 62 column: 7 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlindExcept: - name: Exception + name: BlindExcept + body: "Do not catch blind exception: `Exception`" + commit: ~ + fixable: false location: row: 69 column: 7 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlindExcept: - name: Exception + name: BlindExcept + body: "Do not catch blind exception: `Exception`" + commit: ~ + fixable: false location: row: 75 column: 7 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlindExcept: - name: Exception + name: BlindExcept + body: "Do not catch blind exception: `Exception`" + commit: ~ + fixable: false location: row: 81 column: 7 diff --git a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT001_FBT.py.snap b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT001_FBT.py.snap index 990bbabbd9..ebde6c6290 100644 --- a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT001_FBT.py.snap +++ b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT001_FBT.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs expression: diagnostics --- - kind: - BooleanPositionalArgInFunctionDefinition: ~ + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + commit: ~ + fixable: false location: row: 4 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BooleanPositionalArgInFunctionDefinition: ~ + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + commit: ~ + fixable: false location: row: 5 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BooleanPositionalArgInFunctionDefinition: ~ + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + commit: ~ + fixable: false location: row: 10 column: 4 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BooleanPositionalArgInFunctionDefinition: ~ + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + commit: ~ + fixable: false location: row: 11 column: 4 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BooleanPositionalArgInFunctionDefinition: ~ + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + commit: ~ + fixable: false location: row: 14 column: 4 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BooleanPositionalArgInFunctionDefinition: ~ + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + commit: ~ + fixable: false location: row: 15 column: 4 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BooleanPositionalArgInFunctionDefinition: ~ + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + commit: ~ + fixable: false location: row: 18 column: 4 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BooleanPositionalArgInFunctionDefinition: ~ + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + commit: ~ + fixable: false location: row: 19 column: 4 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BooleanPositionalArgInFunctionDefinition: ~ + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + commit: ~ + fixable: false location: row: 81 column: 18 diff --git a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT002_FBT.py.snap b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT002_FBT.py.snap index 9f06b696da..f0d59cf6ac 100644 --- a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT002_FBT.py.snap +++ b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT002_FBT.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_boolean_trap/mod.rs +source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs expression: diagnostics --- - kind: - BooleanDefaultValueInFunctionDefinition: ~ + name: BooleanDefaultValueInFunctionDefinition + body: Boolean default value in function definition + commit: ~ + fixable: false location: row: 12 column: 30 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BooleanDefaultValueInFunctionDefinition: ~ + name: BooleanDefaultValueInFunctionDefinition + body: Boolean default value in function definition + commit: ~ + fixable: false location: row: 13 column: 42 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BooleanDefaultValueInFunctionDefinition: ~ + name: BooleanDefaultValueInFunctionDefinition + body: Boolean default value in function definition + commit: ~ + fixable: false location: row: 14 column: 40 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BooleanDefaultValueInFunctionDefinition: ~ + name: BooleanDefaultValueInFunctionDefinition + body: Boolean default value in function definition + commit: ~ + fixable: false location: row: 15 column: 45 diff --git a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap index f53bbff605..610fc2e330 100644 --- a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap +++ b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_boolean_trap/mod.rs +source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs expression: diagnostics --- - kind: - BooleanPositionalValueInFunctionCall: ~ + name: BooleanPositionalValueInFunctionCall + body: Boolean positional value in function call + commit: ~ + fixable: false location: row: 42 column: 10 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BooleanPositionalValueInFunctionCall: ~ + name: BooleanPositionalValueInFunctionCall + body: Boolean positional value in function call + commit: ~ + fixable: false location: row: 57 column: 10 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BooleanPositionalValueInFunctionCall: ~ + name: BooleanPositionalValueInFunctionCall + body: Boolean positional value in function call + commit: ~ + fixable: false location: row: 57 column: 16 diff --git a/crates/ruff/src/rules/flake8_bugbear/rules/assert_false.rs b/crates/ruff/src/rules/flake8_bugbear/rules/assert_false.rs index 9b6d672fd2..a926924a55 100644 --- a/crates/ruff/src/rules/flake8_bugbear/rules/assert_false.rs +++ b/crates/ruff/src/rules/flake8_bugbear/rules/assert_false.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/flake8_bugbear/rules/duplicate_exceptions.rs b/crates/ruff/src/rules/flake8_bugbear/rules/duplicate_exceptions.rs index 1fc2b478e5..6d8bfb584f 100644 --- a/crates/ruff/src/rules/flake8_bugbear/rules/duplicate_exceptions.rs +++ b/crates/ruff/src/rules/flake8_bugbear/rules/duplicate_exceptions.rs @@ -11,7 +11,7 @@ use ruff_python_ast::types::{CallPath, Range}; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::violation::{AlwaysAutofixableViolation, Violation}; #[violation] diff --git a/crates/ruff/src/rules/flake8_bugbear/rules/getattr_with_constant.rs b/crates/ruff/src/rules/flake8_bugbear/rules/getattr_with_constant.rs index 4def8c8ca4..3ce6f78e4b 100644 --- a/crates/ruff/src/rules/flake8_bugbear/rules/getattr_with_constant.rs +++ b/crates/ruff/src/rules/flake8_bugbear/rules/getattr_with_constant.rs @@ -8,7 +8,7 @@ use ruff_python_stdlib::keyword::KWLIST; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/flake8_bugbear/rules/redundant_tuple_in_exception_handler.rs b/crates/ruff/src/rules/flake8_bugbear/rules/redundant_tuple_in_exception_handler.rs index fd6a59ed5d..b50699e41e 100644 --- a/crates/ruff/src/rules/flake8_bugbear/rules/redundant_tuple_in_exception_handler.rs +++ b/crates/ruff/src/rules/flake8_bugbear/rules/redundant_tuple_in_exception_handler.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/flake8_bugbear/rules/setattr_with_constant.rs b/crates/ruff/src/rules/flake8_bugbear/rules/setattr_with_constant.rs index e58d1d1228..2c4b2579d9 100644 --- a/crates/ruff/src/rules/flake8_bugbear/rules/setattr_with_constant.rs +++ b/crates/ruff/src/rules/flake8_bugbear/rules/setattr_with_constant.rs @@ -9,7 +9,7 @@ use ruff_python_stdlib::keyword::KWLIST; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/flake8_bugbear/rules/unused_loop_control_variable.rs b/crates/ruff/src/rules/flake8_bugbear/rules/unused_loop_control_variable.rs index b376f74a01..028d0b4fd5 100644 --- a/crates/ruff/src/rules/flake8_bugbear/rules/unused_loop_control_variable.rs +++ b/crates/ruff/src/rules/flake8_bugbear/rules/unused_loop_control_variable.rs @@ -29,7 +29,7 @@ use ruff_python_ast::{helpers, visitor}; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{AutofixKind, Availability, Violation}; #[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, result_like::BoolLike)] diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B002_B002.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B002_B002.py.snap index e295bc58e0..a03cf22e74 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B002_B002.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B002_B002.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - UnaryPrefixIncrement: ~ + name: UnaryPrefixIncrement + body: Python does not support the unary prefix increment + commit: ~ + fixable: false location: row: 15 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnaryPrefixIncrement: ~ + name: UnaryPrefixIncrement + body: Python does not support the unary prefix increment + commit: ~ + fixable: false location: row: 20 column: 11 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B003_B003.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B003_B003.py.snap index fd7d019cf9..968f9dbaa8 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B003_B003.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B003_B003.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - AssignmentToOsEnviron: ~ + name: AssignmentToOsEnviron + body: "Assigning to `os.environ` doesn't clear the environment" + commit: ~ + fixable: false location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B004_B004.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B004_B004.py.snap index ab280dac6e..f6d787ba1f 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B004_B004.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B004_B004.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - UnreliableCallableCheck: ~ + name: UnreliableCallableCheck + body: "Using `hasattr(x, '__call__')` to test if x is callable is unreliable. Use `callable(x)` for consistent results." + commit: ~ + fixable: false location: row: 3 column: 7 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnreliableCallableCheck: ~ + name: UnreliableCallableCheck + body: "Using `hasattr(x, '__call__')` to test if x is callable is unreliable. Use `callable(x)` for consistent results." + commit: ~ + fixable: false location: row: 5 column: 7 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap index 8948445b17..d9006bb45e 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - StripWithMultiCharacters: ~ + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StripWithMultiCharacters: ~ + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StripWithMultiCharacters: ~ + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StripWithMultiCharacters: ~ + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StripWithMultiCharacters: ~ + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + commit: ~ + fixable: false location: row: 16 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StripWithMultiCharacters: ~ + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + commit: ~ + fixable: false location: row: 19 column: 0 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StripWithMultiCharacters: ~ + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + commit: ~ + fixable: false location: row: 22 column: 0 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StripWithMultiCharacters: ~ + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + commit: ~ + fixable: false location: row: 24 column: 0 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B006_B006_B008.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B006_B006_B008.py.snap index 06c9ab1ee2..f6273ada8d 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B006_B006_B008.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B006_B006_B008.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - MutableArgumentDefault: ~ + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + commit: ~ + fixable: false location: row: 60 column: 24 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MutableArgumentDefault: ~ + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + commit: ~ + fixable: false location: row: 64 column: 29 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MutableArgumentDefault: ~ + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + commit: ~ + fixable: false location: row: 68 column: 19 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MutableArgumentDefault: ~ + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + commit: ~ + fixable: false location: row: 72 column: 19 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MutableArgumentDefault: ~ + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + commit: ~ + fixable: false location: row: 76 column: 31 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MutableArgumentDefault: ~ + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + commit: ~ + fixable: false location: row: 80 column: 25 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MutableArgumentDefault: ~ + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + commit: ~ + fixable: false location: row: 85 column: 45 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MutableArgumentDefault: ~ + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + commit: ~ + fixable: false location: row: 89 column: 45 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MutableArgumentDefault: ~ + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + commit: ~ + fixable: false location: row: 93 column: 44 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MutableArgumentDefault: ~ + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + commit: ~ + fixable: false location: row: 97 column: 32 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MutableArgumentDefault: ~ + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + commit: ~ + fixable: false location: row: 170 column: 19 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MutableArgumentDefault: ~ + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + commit: ~ + fixable: false location: row: 203 column: 26 @@ -123,7 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MutableArgumentDefault: ~ + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + commit: ~ + fixable: false location: row: 204 column: 34 @@ -133,7 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MutableArgumentDefault: ~ + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + commit: ~ + fixable: false location: row: 205 column: 61 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B007_B007.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B007_B007.py.snap index b3463d5d22..e732b941ea 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B007_B007.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B007_B007.py.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - UnusedLoopControlVariable: - name: i - rename: _i - certainty: Certain + name: UnusedLoopControlVariable + body: "Loop control variable `i` not used within loop body" + commit: "Rename unused `i` to `_i`" + fixable: true location: row: 6 column: 4 @@ -16,10 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedLoopControlVariable: - name: k - rename: _k - certainty: Certain + name: UnusedLoopControlVariable + body: "Loop control variable `k` not used within loop body" + commit: "Rename unused `k` to `_k`" + fixable: true location: row: 18 column: 12 @@ -36,10 +36,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - UnusedLoopControlVariable: - name: i - rename: _i - certainty: Certain + name: UnusedLoopControlVariable + body: "Loop control variable `i` not used within loop body" + commit: "Rename unused `i` to `_i`" + fixable: true location: row: 30 column: 4 @@ -49,10 +49,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedLoopControlVariable: - name: k - rename: _k - certainty: Certain + name: UnusedLoopControlVariable + body: "Loop control variable `k` not used within loop body" + commit: "Rename unused `k` to `_k`" + fixable: true location: row: 30 column: 12 @@ -69,10 +69,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - UnusedLoopControlVariable: - name: bar - rename: _bar - certainty: Uncertain + name: UnusedLoopControlVariable + body: "Loop control variable `bar` may not be used within loop body" + commit: ~ + fixable: false location: row: 34 column: 9 @@ -82,10 +82,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedLoopControlVariable: - name: bar - rename: _bar - certainty: Uncertain + name: UnusedLoopControlVariable + body: "Loop control variable `bar` may not be used within loop body" + commit: ~ + fixable: false location: row: 38 column: 9 @@ -95,10 +95,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedLoopControlVariable: - name: bar - rename: _bar - certainty: Uncertain + name: UnusedLoopControlVariable + body: "Loop control variable `bar` may not be used within loop body" + commit: ~ + fixable: false location: row: 42 column: 9 @@ -108,10 +108,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedLoopControlVariable: - name: bar - rename: _bar - certainty: Uncertain + name: UnusedLoopControlVariable + body: "Loop control variable `bar` may not be used within loop body" + commit: ~ + fixable: false location: row: 46 column: 9 @@ -121,10 +121,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedLoopControlVariable: - name: bar - rename: _bar - certainty: Certain + name: UnusedLoopControlVariable + body: "Loop control variable `bar` not used within loop body" + commit: "Rename unused `bar` to `_bar`" + fixable: true location: row: 52 column: 13 @@ -141,10 +141,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - UnusedLoopControlVariable: - name: bar - rename: _bar - certainty: Certain + name: UnusedLoopControlVariable + body: "Loop control variable `bar` not used within loop body" + commit: "Rename unused `bar` to `_bar`" + fixable: true location: row: 59 column: 13 @@ -154,10 +154,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedLoopControlVariable: - name: bar - rename: _bar - certainty: Certain + name: UnusedLoopControlVariable + body: "Loop control variable `bar` not used within loop body" + commit: "Rename unused `bar` to `_bar`" + fixable: true location: row: 68 column: 13 @@ -174,10 +174,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - UnusedLoopControlVariable: - name: bar - rename: _bar - certainty: Certain + name: UnusedLoopControlVariable + body: "Loop control variable `bar` not used within loop body" + commit: "Rename unused `bar` to `_bar`" + fixable: true location: row: 77 column: 13 @@ -194,10 +194,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - UnusedLoopControlVariable: - name: line_ - rename: ~ - certainty: Certain + name: UnusedLoopControlVariable + body: "Loop control variable `line_` not used within loop body" + commit: ~ + fixable: false location: row: 87 column: 4 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B008_B006_B008.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B008_B006_B008.py.snap index 2662647931..01e362d40a 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B008_B006_B008.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B008_B006_B008.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - FunctionCallArgumentDefault: - name: range + name: FunctionCallArgumentDefault + body: "Do not perform function call `range` in argument defaults" + commit: ~ + fixable: false location: row: 85 column: 60 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionCallArgumentDefault: - name: range + name: FunctionCallArgumentDefault + body: "Do not perform function call `range` in argument defaults" + commit: ~ + fixable: false location: row: 89 column: 63 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionCallArgumentDefault: - name: range + name: FunctionCallArgumentDefault + body: "Do not perform function call `range` in argument defaults" + commit: ~ + fixable: false location: row: 93 column: 59 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionCallArgumentDefault: - name: time.time + name: FunctionCallArgumentDefault + body: "Do not perform function call `time.time` in argument defaults" + commit: ~ + fixable: false location: row: 109 column: 38 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionCallArgumentDefault: - name: dt.datetime.now + name: FunctionCallArgumentDefault + body: "Do not perform function call `dt.datetime.now` in argument defaults" + commit: ~ + fixable: false location: row: 113 column: 11 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionCallArgumentDefault: - name: dt.timedelta + name: FunctionCallArgumentDefault + body: "Do not perform function call `dt.timedelta` in argument defaults" + commit: ~ + fixable: false location: row: 113 column: 31 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionCallArgumentDefault: - name: ~ + name: FunctionCallArgumentDefault + body: Do not perform function call in argument defaults + commit: ~ + fixable: false location: row: 117 column: 29 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionCallArgumentDefault: - name: float + name: FunctionCallArgumentDefault + body: "Do not perform function call `float` in argument defaults" + commit: ~ + fixable: false location: row: 155 column: 33 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionCallArgumentDefault: - name: float + name: FunctionCallArgumentDefault + body: "Do not perform function call `float` in argument defaults" + commit: ~ + fixable: false location: row: 160 column: 29 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionCallArgumentDefault: - name: float + name: FunctionCallArgumentDefault + body: "Do not perform function call `float` in argument defaults" + commit: ~ + fixable: false location: row: 164 column: 44 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionCallArgumentDefault: - name: float + name: FunctionCallArgumentDefault + body: "Do not perform function call `float` in argument defaults" + commit: ~ + fixable: false location: row: 170 column: 20 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionCallArgumentDefault: - name: dt.datetime.now + name: FunctionCallArgumentDefault + body: "Do not perform function call `dt.datetime.now` in argument defaults" + commit: ~ + fixable: false location: row: 170 column: 30 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionCallArgumentDefault: - name: map + name: FunctionCallArgumentDefault + body: "Do not perform function call `map` in argument defaults" + commit: ~ + fixable: false location: row: 176 column: 21 @@ -146,8 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionCallArgumentDefault: - name: random.randint + name: FunctionCallArgumentDefault + body: "Do not perform function call `random.randint` in argument defaults" + commit: ~ + fixable: false location: row: 181 column: 18 @@ -157,8 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionCallArgumentDefault: - name: dt.datetime.now + name: FunctionCallArgumentDefault + body: "Do not perform function call `dt.datetime.now` in argument defaults" + commit: ~ + fixable: false location: row: 181 column: 36 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B009_B009_B010.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B009_B009_B010.py.snap index 648690c2e3..347881cb27 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B009_B009_B010.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B009_B009_B010.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - GetAttrWithConstant: ~ + name: GetAttrWithConstant + body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." + commit: "Replace `getattr` with attribute access" + fixable: true location: row: 19 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - GetAttrWithConstant: ~ + name: GetAttrWithConstant + body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." + commit: "Replace `getattr` with attribute access" + fixable: true location: row: 20 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - GetAttrWithConstant: ~ + name: GetAttrWithConstant + body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." + commit: "Replace `getattr` with attribute access" + fixable: true location: row: 21 column: 0 @@ -54,7 +63,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - GetAttrWithConstant: ~ + name: GetAttrWithConstant + body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." + commit: "Replace `getattr` with attribute access" + fixable: true location: row: 22 column: 0 @@ -71,7 +83,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - GetAttrWithConstant: ~ + name: GetAttrWithConstant + body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." + commit: "Replace `getattr` with attribute access" + fixable: true location: row: 23 column: 0 @@ -88,7 +103,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - GetAttrWithConstant: ~ + name: GetAttrWithConstant + body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." + commit: "Replace `getattr` with attribute access" + fixable: true location: row: 24 column: 14 @@ -105,7 +123,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - GetAttrWithConstant: ~ + name: GetAttrWithConstant + body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." + commit: "Replace `getattr` with attribute access" + fixable: true location: row: 25 column: 3 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B010_B009_B010.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B010_B009_B010.py.snap index 9c750f369c..2286381fb8 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B010_B009_B010.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B010_B009_B010.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - SetAttrWithConstant: ~ + name: SetAttrWithConstant + body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." + commit: "Replace `setattr` with assignment" + fixable: true location: row: 40 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 25 parent: ~ - kind: - SetAttrWithConstant: ~ + name: SetAttrWithConstant + body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." + commit: "Replace `setattr` with assignment" + fixable: true location: row: 41 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - SetAttrWithConstant: ~ + name: SetAttrWithConstant + body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." + commit: "Replace `setattr` with assignment" + fixable: true location: row: 42 column: 0 @@ -54,7 +63,10 @@ expression: diagnostics column: 32 parent: ~ - kind: - SetAttrWithConstant: ~ + name: SetAttrWithConstant + body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." + commit: "Replace `setattr` with assignment" + fixable: true location: row: 43 column: 0 @@ -71,7 +83,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - SetAttrWithConstant: ~ + name: SetAttrWithConstant + body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." + commit: "Replace `setattr` with assignment" + fixable: true location: row: 44 column: 0 @@ -88,7 +103,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - SetAttrWithConstant: ~ + name: SetAttrWithConstant + body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." + commit: "Replace `setattr` with assignment" + fixable: true location: row: 45 column: 0 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B011_B011.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B011_B011.py.snap index e6d1d8b5a7..102f29f921 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B011_B011.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B011_B011.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - AssertFalse: ~ + name: AssertFalse + body: "Do not `assert False` (`python -O` removes these calls), raise `AssertionError()`" + commit: "Replace `assert False`" + fixable: true location: row: 8 column: 7 @@ -20,7 +23,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - AssertFalse: ~ + name: AssertFalse + body: "Do not `assert False` (`python -O` removes these calls), raise `AssertionError()`" + commit: "Replace `assert False`" + fixable: true location: row: 10 column: 7 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B012_B012.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B012_B012.py.snap index 9b87a721c9..11b1fc7dad 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B012_B012.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B012_B012.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - JumpStatementInFinally: - name: return + name: JumpStatementInFinally + body: "`return` inside `finally` blocks cause exceptions to be silenced" + commit: ~ + fixable: false location: row: 5 column: 8 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - JumpStatementInFinally: - name: return + name: JumpStatementInFinally + body: "`return` inside `finally` blocks cause exceptions to be silenced" + commit: ~ + fixable: false location: row: 13 column: 12 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - JumpStatementInFinally: - name: return + name: JumpStatementInFinally + body: "`return` inside `finally` blocks cause exceptions to be silenced" + commit: ~ + fixable: false location: row: 21 column: 12 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - JumpStatementInFinally: - name: return + name: JumpStatementInFinally + body: "`return` inside `finally` blocks cause exceptions to be silenced" + commit: ~ + fixable: false location: row: 31 column: 12 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - JumpStatementInFinally: - name: return + name: JumpStatementInFinally + body: "`return` inside `finally` blocks cause exceptions to be silenced" + commit: ~ + fixable: false location: row: 44 column: 20 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - JumpStatementInFinally: - name: break + name: JumpStatementInFinally + body: "`break` inside `finally` blocks cause exceptions to be silenced" + commit: ~ + fixable: false location: row: 66 column: 12 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - JumpStatementInFinally: - name: continue + name: JumpStatementInFinally + body: "`continue` inside `finally` blocks cause exceptions to be silenced" + commit: ~ + fixable: false location: row: 78 column: 12 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - JumpStatementInFinally: - name: return + name: JumpStatementInFinally + body: "`return` inside `finally` blocks cause exceptions to be silenced" + commit: ~ + fixable: false location: row: 94 column: 12 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - JumpStatementInFinally: - name: continue + name: JumpStatementInFinally + body: "`continue` inside `finally` blocks cause exceptions to be silenced" + commit: ~ + fixable: false location: row: 101 column: 8 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - JumpStatementInFinally: - name: break + name: JumpStatementInFinally + body: "`break` inside `finally` blocks cause exceptions to be silenced" + commit: ~ + fixable: false location: row: 107 column: 8 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - JumpStatementInFinally: - name: break + name: JumpStatementInFinally + body: "`break` inside `finally` blocks cause exceptions to be silenced" + commit: ~ + fixable: false location: row: 118 column: 16 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B013_B013.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B013_B013.py.snap index b6af0ef89a..363633ad18 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B013_B013.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B013_B013.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - RedundantTupleInExceptionHandler: - name: ValueError + name: RedundantTupleInExceptionHandler + body: "A length-one tuple literal is redundant. Write `except ValueError` instead of `except (ValueError,)`." + commit: "Replace with `except ValueError`" + fixable: true location: row: 3 column: 7 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B014_B014.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B014_B014.py.snap index 161431f36d..dd10329965 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B014_B014.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B014_B014.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - DuplicateHandlerException: - names: - - OSError + name: DuplicateHandlerException + body: "Exception handler with duplicate exception: `OSError`" + commit: De-duplicate exceptions + fixable: true location: row: 17 column: 7 @@ -22,9 +23,10 @@ expression: diagnostics column: 25 parent: ~ - kind: - DuplicateHandlerException: - names: - - MyError + name: DuplicateHandlerException + body: "Exception handler with duplicate exception: `MyError`" + commit: De-duplicate exceptions + fixable: true location: row: 28 column: 7 @@ -41,9 +43,10 @@ expression: diagnostics column: 25 parent: ~ - kind: - DuplicateHandlerException: - names: - - re.error + name: DuplicateHandlerException + body: "Exception handler with duplicate exception: `re.error`" + commit: De-duplicate exceptions + fixable: true location: row: 49 column: 7 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B015_B015.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B015_B015.py.snap index 634d77ed9b..728eb5f660 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B015_B015.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B015_B015.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - UselessComparison: ~ + name: UselessComparison + body: "Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it." + commit: ~ + fixable: false location: row: 3 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessComparison: ~ + name: UselessComparison + body: "Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it." + commit: ~ + fixable: false location: row: 7 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessComparison: ~ + name: UselessComparison + body: "Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it." + commit: ~ + fixable: false location: row: 17 column: 4 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessComparison: ~ + name: UselessComparison + body: "Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it." + commit: ~ + fixable: false location: row: 24 column: 4 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B016_B016.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B016_B016.py.snap index 2f9985433b..c863c69dce 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B016_B016.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B016_B016.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - CannotRaiseLiteral: ~ + name: CannotRaiseLiteral + body: Cannot raise a literal. Did you intend to return it or raise an Exception? + commit: ~ + fixable: false location: row: 6 column: 6 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CannotRaiseLiteral: ~ + name: CannotRaiseLiteral + body: Cannot raise a literal. Did you intend to return it or raise an Exception? + commit: ~ + fixable: false location: row: 7 column: 6 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CannotRaiseLiteral: ~ + name: CannotRaiseLiteral + body: Cannot raise a literal. Did you intend to return it or raise an Exception? + commit: ~ + fixable: false location: row: 8 column: 6 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B017_B017.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B017_B017.py.snap index 182e81c2c3..133f610db2 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B017_B017.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B017_B017.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - AssertRaisesException: ~ + name: AssertRaisesException + body: "`assertRaises(Exception)` should be considered evil" + commit: ~ + fixable: false location: row: 22 column: 8 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B018_B018.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B018_B018.py.snap index 24c8e5222c..aad477fe14 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B018_B018.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B018_B018.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 11 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 12 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 13 column: 4 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 14 column: 4 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 15 column: 4 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 16 column: 4 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 17 column: 4 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 18 column: 4 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 19 column: 4 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 20 column: 4 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 24 column: 4 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 27 column: 4 @@ -123,7 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 39 column: 4 @@ -133,7 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 40 column: 4 @@ -143,7 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 41 column: 4 @@ -153,7 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 42 column: 4 @@ -163,7 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 43 column: 4 @@ -173,7 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 44 column: 4 @@ -183,7 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 45 column: 4 @@ -193,7 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 46 column: 4 @@ -203,7 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 47 column: 4 @@ -213,7 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 48 column: 4 @@ -223,7 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 52 column: 4 @@ -233,7 +302,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessExpression: ~ + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + commit: ~ + fixable: false location: row: 55 column: 4 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B019_B019.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B019_B019.py.snap index 739166baad..75d63e9bf2 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B019_B019.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B019_B019.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - CachedInstanceMethod: ~ + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + commit: ~ + fixable: false location: row: 78 column: 5 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CachedInstanceMethod: ~ + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + commit: ~ + fixable: false location: row: 82 column: 5 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CachedInstanceMethod: ~ + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + commit: ~ + fixable: false location: row: 86 column: 5 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CachedInstanceMethod: ~ + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + commit: ~ + fixable: false location: row: 90 column: 5 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CachedInstanceMethod: ~ + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + commit: ~ + fixable: false location: row: 94 column: 5 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CachedInstanceMethod: ~ + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + commit: ~ + fixable: false location: row: 98 column: 5 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CachedInstanceMethod: ~ + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + commit: ~ + fixable: false location: row: 102 column: 5 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CachedInstanceMethod: ~ + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + commit: ~ + fixable: false location: row: 106 column: 5 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B020_B020.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B020_B020.py.snap index 21f2132875..acbe3283ea 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B020_B020.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B020_B020.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - LoopVariableOverridesIterator: - name: items + name: LoopVariableOverridesIterator + body: "Loop control variable `items` overrides iterable it iterates" + commit: ~ + fixable: false location: row: 8 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LoopVariableOverridesIterator: - name: values + name: LoopVariableOverridesIterator + body: "Loop control variable `values` overrides iterable it iterates" + commit: ~ + fixable: false location: row: 21 column: 9 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LoopVariableOverridesIterator: - name: vars + name: LoopVariableOverridesIterator + body: "Loop control variable `vars` overrides iterable it iterates" + commit: ~ + fixable: false location: row: 36 column: 4 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B021_B021.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B021_B021.py.snap index e8055f94da..e15b86e0e5 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B021_B021.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B021_B021.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - FStringDocstring: ~ + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + commit: ~ + fixable: false location: row: 1 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FStringDocstring: ~ + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + commit: ~ + fixable: false location: row: 14 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FStringDocstring: ~ + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + commit: ~ + fixable: false location: row: 22 column: 4 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FStringDocstring: ~ + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + commit: ~ + fixable: false location: row: 30 column: 4 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FStringDocstring: ~ + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + commit: ~ + fixable: false location: row: 38 column: 4 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FStringDocstring: ~ + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + commit: ~ + fixable: false location: row: 46 column: 4 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FStringDocstring: ~ + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + commit: ~ + fixable: false location: row: 54 column: 4 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FStringDocstring: ~ + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + commit: ~ + fixable: false location: row: 62 column: 4 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FStringDocstring: ~ + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + commit: ~ + fixable: false location: row: 70 column: 4 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FStringDocstring: ~ + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + commit: ~ + fixable: false location: row: 74 column: 4 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B022_B022.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B022_B022.py.snap index e8aff5f85d..21e9d02695 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B022_B022.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B022_B022.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - UselessContextlibSuppress: ~ + name: UselessContextlibSuppress + body: "No arguments passed to `contextlib.suppress`. No exceptions will be suppressed and therefore this context manager is redundant" + commit: ~ + fixable: false location: row: 9 column: 5 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessContextlibSuppress: ~ + name: UselessContextlibSuppress + body: "No arguments passed to `contextlib.suppress`. No exceptions will be suppressed and therefore this context manager is redundant" + commit: ~ + fixable: false location: row: 12 column: 5 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B023_B023.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B023_B023.py.snap index af8d95be10..ff6190e22c 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B023_B023.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B023_B023.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - FunctionUsesLoopVariable: - name: x + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + commit: ~ + fixable: false location: row: 12 column: 29 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: y + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `y`" + commit: ~ + fixable: false location: row: 13 column: 29 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: x + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + commit: ~ + fixable: false location: row: 16 column: 15 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: x + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + commit: ~ + fixable: false location: row: 28 column: 18 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: x + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + commit: ~ + fixable: false location: row: 29 column: 18 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: x + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + commit: ~ + fixable: false location: row: 30 column: 18 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: x + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + commit: ~ + fixable: false location: row: 31 column: 21 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: x + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + commit: ~ + fixable: false location: row: 40 column: 33 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: x + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + commit: ~ + fixable: false location: row: 42 column: 13 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: a + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `a`" + commit: ~ + fixable: false location: row: 50 column: 29 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: a_ + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `a_`" + commit: ~ + fixable: false location: row: 51 column: 29 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: b + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `b`" + commit: ~ + fixable: false location: row: 52 column: 29 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: c + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `c`" + commit: ~ + fixable: false location: row: 53 column: 29 @@ -146,8 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: j + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `j`" + commit: ~ + fixable: false location: row: 61 column: 16 @@ -157,8 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: k + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `k`" + commit: ~ + fixable: false location: row: 61 column: 20 @@ -168,8 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: l + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `l`" + commit: ~ + fixable: false location: row: 68 column: 9 @@ -179,8 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: i + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `i`" + commit: ~ + fixable: false location: row: 82 column: 15 @@ -190,8 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: x + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + commit: ~ + fixable: false location: row: 117 column: 23 @@ -201,8 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: x + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + commit: ~ + fixable: false location: row: 118 column: 26 @@ -212,8 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: x + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + commit: ~ + fixable: false location: row: 119 column: 36 @@ -223,8 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: x + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + commit: ~ + fixable: false location: row: 120 column: 37 @@ -234,8 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: x + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + commit: ~ + fixable: false location: row: 121 column: 36 @@ -245,8 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: name + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `name`" + commit: ~ + fixable: false location: row: 171 column: 28 @@ -256,8 +302,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctionUsesLoopVariable: - name: i + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `i`" + commit: ~ + fixable: false location: row: 174 column: 28 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B024_B024.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B024_B024.py.snap index 6eaa71a04f..73bbc378e8 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B024_B024.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B024_B024.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - AbstractBaseClassWithoutAbstractMethod: - name: Base_1 + name: AbstractBaseClassWithoutAbstractMethod + body: "`Base_1` is an abstract base class, but it has no abstract methods" + commit: ~ + fixable: false location: row: 18 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AbstractBaseClassWithoutAbstractMethod: - name: MetaBase_1 + name: AbstractBaseClassWithoutAbstractMethod + body: "`MetaBase_1` is an abstract base class, but it has no abstract methods" + commit: ~ + fixable: false location: row: 71 column: 0 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AbstractBaseClassWithoutAbstractMethod: - name: abc_Base_1 + name: AbstractBaseClassWithoutAbstractMethod + body: "`abc_Base_1` is an abstract base class, but it has no abstract methods" + commit: ~ + fixable: false location: row: 82 column: 0 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AbstractBaseClassWithoutAbstractMethod: - name: abc_Base_2 + name: AbstractBaseClassWithoutAbstractMethod + body: "`abc_Base_2` is an abstract base class, but it has no abstract methods" + commit: ~ + fixable: false location: row: 87 column: 0 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AbstractBaseClassWithoutAbstractMethod: - name: notabc_Base_1 + name: AbstractBaseClassWithoutAbstractMethod + body: "`notabc_Base_1` is an abstract base class, but it has no abstract methods" + commit: ~ + fixable: false location: row: 92 column: 0 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AbstractBaseClassWithoutAbstractMethod: - name: abc_set_class_variable_4 + name: AbstractBaseClassWithoutAbstractMethod + body: "`abc_set_class_variable_4` is an abstract base class, but it has no abstract methods" + commit: ~ + fixable: false location: row: 141 column: 0 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B025_B025.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B025_B025.py.snap index feed769670..4bf9bf0a5b 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B025_B025.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B025_B025.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - DuplicateTryBlockException: - name: ValueError + name: DuplicateTryBlockException + body: "try-except block with duplicate exception `ValueError`" + commit: ~ + fixable: false location: row: 19 column: 7 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DuplicateTryBlockException: - name: pickle.PickleError + name: DuplicateTryBlockException + body: "try-except block with duplicate exception `pickle.PickleError`" + commit: ~ + fixable: false location: row: 28 column: 7 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DuplicateTryBlockException: - name: ValueError + name: DuplicateTryBlockException + body: "try-except block with duplicate exception `ValueError`" + commit: ~ + fixable: false location: row: 35 column: 7 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DuplicateTryBlockException: - name: TypeError + name: DuplicateTryBlockException + body: "try-except block with duplicate exception `TypeError`" + commit: ~ + fixable: false location: row: 37 column: 17 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B026_B026.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B026_B026.py.snap index b0364bd6b9..e82967f7bc 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B026_B026.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B026_B026.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - StarArgUnpackingAfterKeywordArg: ~ + name: StarArgUnpackingAfterKeywordArg + body: Star-arg unpacking after a keyword argument is strongly discouraged + commit: ~ + fixable: false location: row: 16 column: 15 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StarArgUnpackingAfterKeywordArg: ~ + name: StarArgUnpackingAfterKeywordArg + body: Star-arg unpacking after a keyword argument is strongly discouraged + commit: ~ + fixable: false location: row: 17 column: 15 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StarArgUnpackingAfterKeywordArg: ~ + name: StarArgUnpackingAfterKeywordArg + body: Star-arg unpacking after a keyword argument is strongly discouraged + commit: ~ + fixable: false location: row: 18 column: 26 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StarArgUnpackingAfterKeywordArg: ~ + name: StarArgUnpackingAfterKeywordArg + body: Star-arg unpacking after a keyword argument is strongly discouraged + commit: ~ + fixable: false location: row: 19 column: 37 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StarArgUnpackingAfterKeywordArg: ~ + name: StarArgUnpackingAfterKeywordArg + body: Star-arg unpacking after a keyword argument is strongly discouraged + commit: ~ + fixable: false location: row: 20 column: 15 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StarArgUnpackingAfterKeywordArg: ~ + name: StarArgUnpackingAfterKeywordArg + body: Star-arg unpacking after a keyword argument is strongly discouraged + commit: ~ + fixable: false location: row: 20 column: 25 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StarArgUnpackingAfterKeywordArg: ~ + name: StarArgUnpackingAfterKeywordArg + body: Star-arg unpacking after a keyword argument is strongly discouraged + commit: ~ + fixable: false location: row: 21 column: 25 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.py.snap index 9ed1ae1f63..335bc4d994 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - EmptyMethodWithoutAbstractDecorator: - name: AbstractClass.empty_1 + name: EmptyMethodWithoutAbstractDecorator + body: "`AbstractClass.empty_1` is an empty method in an abstract base class, but has no abstract decorator" + commit: ~ + fixable: false location: row: 13 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - EmptyMethodWithoutAbstractDecorator: - name: AbstractClass.empty_2 + name: EmptyMethodWithoutAbstractDecorator + body: "`AbstractClass.empty_2` is an empty method in an abstract base class, but has no abstract decorator" + commit: ~ + fixable: false location: row: 16 column: 4 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - EmptyMethodWithoutAbstractDecorator: - name: AbstractClass.empty_3 + name: EmptyMethodWithoutAbstractDecorator + body: "`AbstractClass.empty_3` is an empty method in an abstract base class, but has no abstract decorator" + commit: ~ + fixable: false location: row: 19 column: 4 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - EmptyMethodWithoutAbstractDecorator: - name: AbstractClass.empty_4 + name: EmptyMethodWithoutAbstractDecorator + body: "`AbstractClass.empty_4` is an empty method in an abstract base class, but has no abstract decorator" + commit: ~ + fixable: false location: row: 23 column: 4 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B029_B029.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B029_B029.py.snap index d7949e900e..ed909cfdc2 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B029_B029.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B029_B029.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - ExceptWithEmptyTuple: ~ + name: ExceptWithEmptyTuple + body: "Using except (): with an empty tuple does not handle/catch anything. Add exceptions to handle." + commit: ~ + fixable: false location: row: 8 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ExceptWithEmptyTuple: ~ + name: ExceptWithEmptyTuple + body: "Using except (): with an empty tuple does not handle/catch anything. Add exceptions to handle." + commit: ~ + fixable: false location: row: 13 column: 0 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B032_B032.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B032_B032.py.snap index 558164a925..ce983b42da 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B032_B032.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B032_B032.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - UnintentionalTypeAnnotation: ~ + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnintentionalTypeAnnotation: ~ + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnintentionalTypeAnnotation: ~ + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + commit: ~ + fixable: false location: row: 12 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnintentionalTypeAnnotation: ~ + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnintentionalTypeAnnotation: ~ + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + commit: ~ + fixable: false location: row: 16 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnintentionalTypeAnnotation: ~ + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + commit: ~ + fixable: false location: row: 17 column: 0 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnintentionalTypeAnnotation: ~ + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + commit: ~ + fixable: false location: row: 18 column: 0 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnintentionalTypeAnnotation: ~ + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + commit: ~ + fixable: false location: row: 19 column: 0 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B904_B904.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B904_B904.py.snap index e8a026c422..5cf2e4b1db 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B904_B904.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B904_B904.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - RaiseWithoutFromInsideExcept: ~ + name: RaiseWithoutFromInsideExcept + body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" + commit: ~ + fixable: false location: row: 10 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaiseWithoutFromInsideExcept: ~ + name: RaiseWithoutFromInsideExcept + body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" + commit: ~ + fixable: false location: row: 11 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaiseWithoutFromInsideExcept: ~ + name: RaiseWithoutFromInsideExcept + body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" + commit: ~ + fixable: false location: row: 16 column: 4 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaiseWithoutFromInsideExcept: ~ + name: RaiseWithoutFromInsideExcept + body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" + commit: ~ + fixable: false location: row: 62 column: 8 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaiseWithoutFromInsideExcept: ~ + name: RaiseWithoutFromInsideExcept + body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" + commit: ~ + fixable: false location: row: 64 column: 8 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaiseWithoutFromInsideExcept: ~ + name: RaiseWithoutFromInsideExcept + body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" + commit: ~ + fixable: false location: row: 72 column: 12 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B905_B905.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B905_B905.py.snap index 6e4a08ba7d..625c44c8d5 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B905_B905.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B905_B905.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - ZipWithoutExplicitStrict: ~ + name: ZipWithoutExplicitStrict + body: "`zip()` without an explicit `strict=` parameter" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ZipWithoutExplicitStrict: ~ + name: ZipWithoutExplicitStrict + body: "`zip()` without an explicit `strict=` parameter" + commit: ~ + fixable: false location: row: 2 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ZipWithoutExplicitStrict: ~ + name: ZipWithoutExplicitStrict + body: "`zip()` without an explicit `strict=` parameter" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ZipWithoutExplicitStrict: ~ + name: ZipWithoutExplicitStrict + body: "`zip()` without an explicit `strict=` parameter" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ZipWithoutExplicitStrict: ~ + name: ZipWithoutExplicitStrict + body: "`zip()` without an explicit `strict=` parameter" + commit: ~ + fixable: false location: row: 4 column: 15 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ZipWithoutExplicitStrict: ~ + name: ZipWithoutExplicitStrict + body: "`zip()` without an explicit `strict=` parameter" + commit: ~ + fixable: false location: row: 5 column: 4 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ZipWithoutExplicitStrict: ~ + name: ZipWithoutExplicitStrict + body: "`zip()` without an explicit `strict=` parameter" + commit: ~ + fixable: false location: row: 6 column: 0 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__extend_immutable_calls.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__extend_immutable_calls.snap index cc171b18f5..2aa219bd28 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__extend_immutable_calls.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__extend_immutable_calls.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_bugbear/mod.rs +source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- - kind: - FunctionCallArgumentDefault: - name: Depends + name: FunctionCallArgumentDefault + body: "Do not perform function call `Depends` in argument defaults" + commit: ~ + fixable: false location: row: 19 column: 50 diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py.snap index b9706cdfb9..05719a0516 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_builtins/mod.rs +source: crates/ruff/src/rules/flake8_builtins/mod.rs expression: diagnostics --- - kind: - BuiltinVariableShadowing: - name: sum + name: BuiltinVariableShadowing + body: "Variable `sum` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: int + name: BuiltinVariableShadowing + body: "Variable `int` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 2 column: 0 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: dir + name: BuiltinVariableShadowing + body: "Variable `dir` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: print + name: BuiltinVariableShadowing + body: "Variable `print` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: copyright + name: BuiltinVariableShadowing + body: "Variable `copyright` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: complex + name: BuiltinVariableShadowing + body: "Variable `complex` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 7 column: 1 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: float + name: BuiltinVariableShadowing + body: "Variable `float` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 8 column: 0 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: object + name: BuiltinVariableShadowing + body: "Variable `object` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 8 column: 8 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: min + name: BuiltinVariableShadowing + body: "Variable `min` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: max + name: BuiltinVariableShadowing + body: "Variable `max` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 9 column: 5 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: id + name: BuiltinVariableShadowing + body: "Variable `id` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 11 column: 0 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: bytes + name: BuiltinVariableShadowing + body: "Variable `bytes` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: slice + name: BuiltinVariableShadowing + body: "Variable `slice` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 16 column: 0 @@ -146,8 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: ValueError + name: BuiltinVariableShadowing + body: "Variable `ValueError` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 21 column: 0 @@ -157,8 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: memoryview + name: BuiltinVariableShadowing + body: "Variable `memoryview` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 24 column: 4 @@ -168,8 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: bytearray + name: BuiltinVariableShadowing + body: "Variable `bytearray` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 24 column: 17 @@ -179,8 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: str + name: BuiltinVariableShadowing + body: "Variable `str` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 27 column: 21 @@ -190,8 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: all + name: BuiltinVariableShadowing + body: "Variable `all` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 27 column: 44 @@ -201,8 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: any + name: BuiltinVariableShadowing + body: "Variable `any` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 27 column: 49 @@ -212,8 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: sum + name: BuiltinVariableShadowing + body: "Variable `sum` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 30 column: 7 diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap index dd70120b87..6646eb8992 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_builtins/mod.rs +source: crates/ruff/src/rules/flake8_builtins/mod.rs expression: diagnostics --- - kind: - BuiltinVariableShadowing: - name: sum + name: BuiltinVariableShadowing + body: "Variable `sum` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: int + name: BuiltinVariableShadowing + body: "Variable `int` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 2 column: 0 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: print + name: BuiltinVariableShadowing + body: "Variable `print` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: copyright + name: BuiltinVariableShadowing + body: "Variable `copyright` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: complex + name: BuiltinVariableShadowing + body: "Variable `complex` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 7 column: 1 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: float + name: BuiltinVariableShadowing + body: "Variable `float` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 8 column: 0 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: object + name: BuiltinVariableShadowing + body: "Variable `object` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 8 column: 8 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: min + name: BuiltinVariableShadowing + body: "Variable `min` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: max + name: BuiltinVariableShadowing + body: "Variable `max` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 9 column: 5 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: bytes + name: BuiltinVariableShadowing + body: "Variable `bytes` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: slice + name: BuiltinVariableShadowing + body: "Variable `slice` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 16 column: 0 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: ValueError + name: BuiltinVariableShadowing + body: "Variable `ValueError` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 21 column: 0 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: memoryview + name: BuiltinVariableShadowing + body: "Variable `memoryview` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 24 column: 4 @@ -146,8 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: bytearray + name: BuiltinVariableShadowing + body: "Variable `bytearray` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 24 column: 17 @@ -157,8 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: str + name: BuiltinVariableShadowing + body: "Variable `str` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 27 column: 21 @@ -168,8 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: all + name: BuiltinVariableShadowing + body: "Variable `all` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 27 column: 44 @@ -179,8 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: any + name: BuiltinVariableShadowing + body: "Variable `any` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 27 column: 49 @@ -190,8 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinVariableShadowing: - name: sum + name: BuiltinVariableShadowing + body: "Variable `sum` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 30 column: 7 diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py.snap index 46f2d99482..3294f2b15f 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_builtins/mod.rs +source: crates/ruff/src/rules/flake8_builtins/mod.rs expression: diagnostics --- - kind: - BuiltinArgumentShadowing: - name: str + name: BuiltinArgumentShadowing + body: "Argument `str` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 1 column: 10 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinArgumentShadowing: - name: type + name: BuiltinArgumentShadowing + body: "Argument `type` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 1 column: 18 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinArgumentShadowing: - name: complex + name: BuiltinArgumentShadowing + body: "Argument `complex` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 1 column: 25 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinArgumentShadowing: - name: Exception + name: BuiltinArgumentShadowing + body: "Argument `Exception` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 1 column: 34 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinArgumentShadowing: - name: getattr + name: BuiltinArgumentShadowing + body: "Argument `getattr` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 1 column: 47 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinArgumentShadowing: - name: bytes + name: BuiltinArgumentShadowing + body: "Argument `bytes` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 5 column: 16 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinArgumentShadowing: - name: id + name: BuiltinArgumentShadowing + body: "Argument `id` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 8 column: 16 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinArgumentShadowing: - name: dir + name: BuiltinArgumentShadowing + body: "Argument `dir` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 8 column: 20 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinArgumentShadowing: - name: float + name: BuiltinArgumentShadowing + body: "Argument `float` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 11 column: 15 diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py_builtins_ignorelist.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py_builtins_ignorelist.snap index 49cbe5341d..13de6c3596 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py_builtins_ignorelist.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py_builtins_ignorelist.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_builtins/mod.rs +source: crates/ruff/src/rules/flake8_builtins/mod.rs expression: diagnostics --- - kind: - BuiltinArgumentShadowing: - name: str + name: BuiltinArgumentShadowing + body: "Argument `str` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 1 column: 10 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinArgumentShadowing: - name: type + name: BuiltinArgumentShadowing + body: "Argument `type` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 1 column: 18 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinArgumentShadowing: - name: complex + name: BuiltinArgumentShadowing + body: "Argument `complex` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 1 column: 25 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinArgumentShadowing: - name: Exception + name: BuiltinArgumentShadowing + body: "Argument `Exception` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 1 column: 34 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinArgumentShadowing: - name: getattr + name: BuiltinArgumentShadowing + body: "Argument `getattr` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 1 column: 47 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinArgumentShadowing: - name: bytes + name: BuiltinArgumentShadowing + body: "Argument `bytes` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 5 column: 16 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinArgumentShadowing: - name: float + name: BuiltinArgumentShadowing + body: "Argument `float` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 11 column: 15 diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py.snap index 7a0abcdf8d..8d0e18dc67 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_builtins/mod.rs +source: crates/ruff/src/rules/flake8_builtins/mod.rs expression: diagnostics --- - kind: - BuiltinAttributeShadowing: - name: ImportError + name: BuiltinAttributeShadowing + body: "Class attribute `ImportError` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 2 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinAttributeShadowing: - name: id + name: BuiltinAttributeShadowing + body: "Class attribute `id` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 3 column: 4 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinAttributeShadowing: - name: dir + name: BuiltinAttributeShadowing + body: "Class attribute `dir` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 4 column: 4 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinAttributeShadowing: - name: str + name: BuiltinAttributeShadowing + body: "Class attribute `str` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 11 column: 4 diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap index 7b5b3dc1a4..ed2dfea3e8 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_builtins/mod.rs +source: crates/ruff/src/rules/flake8_builtins/mod.rs expression: diagnostics --- - kind: - BuiltinAttributeShadowing: - name: ImportError + name: BuiltinAttributeShadowing + body: "Class attribute `ImportError` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 2 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BuiltinAttributeShadowing: - name: str + name: BuiltinAttributeShadowing + body: "Class attribute `str` is shadowing a python builtin" + commit: ~ + fixable: false location: row: 11 column: 4 diff --git a/crates/ruff/src/rules/flake8_commas/snapshots/ruff__rules__flake8_commas__tests__COM81.py.snap b/crates/ruff/src/rules/flake8_commas/snapshots/ruff__rules__flake8_commas__tests__COM81.py.snap index 862c49b61b..47bb0efc26 100644 --- a/crates/ruff/src/rules/flake8_commas/snapshots/ruff__rules__flake8_commas__tests__COM81.py.snap +++ b/crates/ruff/src/rules/flake8_commas/snapshots/ruff__rules__flake8_commas__tests__COM81.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs expression: diagnostics --- - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 4 column: 17 @@ -20,7 +23,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 10 column: 5 @@ -37,7 +43,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 16 column: 5 @@ -54,7 +63,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 23 column: 5 @@ -71,7 +83,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - TrailingCommaOnBareTupleProhibited: ~ + name: TrailingCommaOnBareTupleProhibited + body: Trailing comma on bare tuple prohibited + commit: ~ + fixable: false location: row: 36 column: 7 @@ -81,7 +96,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TrailingCommaOnBareTupleProhibited: ~ + name: TrailingCommaOnBareTupleProhibited + body: Trailing comma on bare tuple prohibited + commit: ~ + fixable: false location: row: 38 column: 18 @@ -91,7 +109,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TrailingCommaOnBareTupleProhibited: ~ + name: TrailingCommaOnBareTupleProhibited + body: Trailing comma on bare tuple prohibited + commit: ~ + fixable: false location: row: 45 column: 7 @@ -101,7 +122,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TrailingCommaOnBareTupleProhibited: ~ + name: TrailingCommaOnBareTupleProhibited + body: Trailing comma on bare tuple prohibited + commit: ~ + fixable: false location: row: 49 column: 9 @@ -111,7 +135,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TrailingCommaOnBareTupleProhibited: ~ + name: TrailingCommaOnBareTupleProhibited + body: Trailing comma on bare tuple prohibited + commit: ~ + fixable: false location: row: 56 column: 31 @@ -121,7 +148,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TrailingCommaOnBareTupleProhibited: ~ + name: TrailingCommaOnBareTupleProhibited + body: Trailing comma on bare tuple prohibited + commit: ~ + fixable: false location: row: 58 column: 25 @@ -131,7 +161,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TrailingCommaOnBareTupleProhibited: ~ + name: TrailingCommaOnBareTupleProhibited + body: Trailing comma on bare tuple prohibited + commit: ~ + fixable: false location: row: 61 column: 16 @@ -141,7 +174,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 70 column: 7 @@ -158,7 +194,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 78 column: 7 @@ -175,7 +214,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 86 column: 7 @@ -192,7 +234,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 152 column: 5 @@ -209,7 +254,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 158 column: 10 @@ -226,7 +274,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 293 column: 14 @@ -243,7 +294,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 304 column: 13 @@ -260,7 +314,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 310 column: 13 @@ -277,7 +334,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 316 column: 9 @@ -294,7 +354,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 322 column: 14 @@ -311,7 +374,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 368 column: 14 @@ -328,7 +394,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 375 column: 14 @@ -345,7 +414,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 404 column: 14 @@ -362,7 +434,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 432 column: 14 @@ -379,7 +454,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - TrailingCommaProhibited: ~ + name: TrailingCommaProhibited + body: Trailing comma prohibited + commit: Remove trailing comma + fixable: true location: row: 485 column: 20 @@ -396,7 +474,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - TrailingCommaProhibited: ~ + name: TrailingCommaProhibited + body: Trailing comma prohibited + commit: Remove trailing comma + fixable: true location: row: 487 column: 12 @@ -413,7 +494,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - TrailingCommaProhibited: ~ + name: TrailingCommaProhibited + body: Trailing comma prohibited + commit: Remove trailing comma + fixable: true location: row: 489 column: 17 @@ -430,7 +514,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - TrailingCommaProhibited: ~ + name: TrailingCommaProhibited + body: Trailing comma prohibited + commit: Remove trailing comma + fixable: true location: row: 494 column: 5 @@ -447,7 +534,10 @@ expression: diagnostics column: 6 parent: ~ - kind: - TrailingCommaProhibited: ~ + name: TrailingCommaProhibited + body: Trailing comma prohibited + commit: Remove trailing comma + fixable: true location: row: 496 column: 20 @@ -464,7 +554,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - TrailingCommaProhibited: ~ + name: TrailingCommaProhibited + body: Trailing comma prohibited + commit: Remove trailing comma + fixable: true location: row: 498 column: 12 @@ -481,7 +574,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - TrailingCommaProhibited: ~ + name: TrailingCommaProhibited + body: Trailing comma prohibited + commit: Remove trailing comma + fixable: true location: row: 500 column: 17 @@ -498,7 +594,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - TrailingCommaProhibited: ~ + name: TrailingCommaProhibited + body: Trailing comma prohibited + commit: Remove trailing comma + fixable: true location: row: 505 column: 5 @@ -515,7 +614,10 @@ expression: diagnostics column: 6 parent: ~ - kind: - TrailingCommaProhibited: ~ + name: TrailingCommaProhibited + body: Trailing comma prohibited + commit: Remove trailing comma + fixable: true location: row: 511 column: 9 @@ -532,7 +634,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - TrailingCommaProhibited: ~ + name: TrailingCommaProhibited + body: Trailing comma prohibited + commit: Remove trailing comma + fixable: true location: row: 513 column: 8 @@ -549,7 +654,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 519 column: 12 @@ -566,7 +674,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 526 column: 9 @@ -583,7 +694,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 534 column: 15 @@ -600,7 +714,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 541 column: 12 @@ -617,7 +734,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 547 column: 23 @@ -634,7 +754,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 554 column: 14 @@ -651,7 +774,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 561 column: 12 @@ -668,7 +794,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 565 column: 12 @@ -685,7 +814,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 573 column: 9 @@ -702,7 +834,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 577 column: 9 @@ -719,7 +854,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 583 column: 9 @@ -736,7 +874,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 590 column: 12 @@ -753,7 +894,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 598 column: 14 @@ -770,7 +914,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 627 column: 19 @@ -787,7 +934,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - TrailingCommaMissing: ~ + name: TrailingCommaMissing + body: Trailing comma missing + commit: Add trailing comma + fixable: true location: row: 632 column: 41 diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_call_around_sorted.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_call_around_sorted.rs index e797d4d6ee..8769eed5bf 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_call_around_sorted.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_call_around_sorted.rs @@ -5,7 +5,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_collection_call.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_collection_call.rs index eee09aadc0..a3e1e95183 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_collection_call.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_collection_call.rs @@ -5,7 +5,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::rules::flake8_comprehensions::settings::Settings; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_comprehension.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_comprehension.rs index c414607ef0..e003f8eb6d 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_comprehension.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_comprehension.rs @@ -5,7 +5,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_double_cast_or_process.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_double_cast_or_process.rs index 7bd3b92790..7d59bdb93b 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_double_cast_or_process.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_double_cast_or_process.rs @@ -4,7 +4,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_generator_dict.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_generator_dict.rs index abcf5b873a..dd602fdb00 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_generator_dict.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_generator_dict.rs @@ -5,7 +5,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_generator_list.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_generator_list.rs index 32fabaa922..a63692943e 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_generator_list.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_generator_list.rs @@ -5,7 +5,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_generator_set.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_generator_set.rs index dca6ebf285..2ef961d030 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_generator_set.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_generator_set.rs @@ -5,7 +5,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_list_call.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_list_call.rs index 8c169cca82..1f05f65bd2 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_list_call.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_list_call.rs @@ -5,7 +5,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_list_comprehension_dict.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_list_comprehension_dict.rs index 91b1b05a86..9996a8df8a 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_list_comprehension_dict.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_list_comprehension_dict.rs @@ -5,7 +5,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_list_comprehension_set.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_list_comprehension_set.rs index 0255bc8e4c..6d7c226f5d 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_list_comprehension_set.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_list_comprehension_set.rs @@ -5,7 +5,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_dict.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_dict.rs index 0d9f6947e8..63e1d90351 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_dict.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_dict.rs @@ -5,7 +5,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_set.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_set.rs index e823ee03ef..18dc2b2d38 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_set.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_set.rs @@ -5,7 +5,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_within_list_call.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_within_list_call.rs index 693bd182f6..f1341f365d 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_within_list_call.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_within_list_call.rs @@ -5,7 +5,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_within_tuple_call.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_within_tuple_call.rs index 62d8f80f34..919ca287c0 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_within_tuple_call.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_literal_within_tuple_call.rs @@ -5,7 +5,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_map.rs b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_map.rs index d9d2fb4da7..f0fdd0bf88 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_map.rs +++ b/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_map.rs @@ -5,7 +5,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_comprehensions::fixes; use crate::violation::{AutofixKind, Availability, Violation}; diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C400_C400.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C400_C400.py.snap index 37a0a8864b..93be4f7137 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C400_C400.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C400_C400.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryGeneratorList: ~ + name: UnnecessaryGeneratorList + body: "Unnecessary generator (rewrite as a `list` comprehension)" + commit: "Rewrite as a `list` comprehension" + fixable: true location: row: 1 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - UnnecessaryGeneratorList: ~ + name: UnnecessaryGeneratorList + body: "Unnecessary generator (rewrite as a `list` comprehension)" + commit: "Rewrite as a `list` comprehension" + fixable: true location: row: 2 column: 4 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C401_C401.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C401_C401.py.snap index 0c9910e087..1a88401d72 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C401_C401.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C401_C401.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryGeneratorSet: ~ + name: UnnecessaryGeneratorSet + body: "Unnecessary generator (rewrite as a `set` comprehension)" + commit: "Rewrite as a `set` comprehension" + fixable: true location: row: 1 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - UnnecessaryGeneratorSet: ~ + name: UnnecessaryGeneratorSet + body: "Unnecessary generator (rewrite as a `set` comprehension)" + commit: "Rewrite as a `set` comprehension" + fixable: true location: row: 2 column: 4 @@ -37,7 +43,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UnnecessaryGeneratorSet: ~ + name: UnnecessaryGeneratorSet + body: "Unnecessary generator (rewrite as a `set` comprehension)" + commit: "Rewrite as a `set` comprehension" + fixable: true location: row: 5 column: 7 @@ -54,7 +63,10 @@ expression: diagnostics column: 48 parent: ~ - kind: - UnnecessaryGeneratorSet: ~ + name: UnnecessaryGeneratorSet + body: "Unnecessary generator (rewrite as a `set` comprehension)" + commit: "Rewrite as a `set` comprehension" + fixable: true location: row: 6 column: 16 @@ -71,7 +83,10 @@ expression: diagnostics column: 57 parent: ~ - kind: - UnnecessaryGeneratorSet: ~ + name: UnnecessaryGeneratorSet + body: "Unnecessary generator (rewrite as a `set` comprehension)" + commit: "Rewrite as a `set` comprehension" + fixable: true location: row: 7 column: 15 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C402_C402.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C402_C402.py.snap index 2a73071d71..1823443e41 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C402_C402.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C402_C402.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryGeneratorDict: ~ + name: UnnecessaryGeneratorDict + body: "Unnecessary generator (rewrite as a `dict` comprehension)" + commit: "Rewrite as a `dict` comprehension" + fixable: true location: row: 1 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - UnnecessaryGeneratorDict: ~ + name: UnnecessaryGeneratorDict + body: "Unnecessary generator (rewrite as a `dict` comprehension)" + commit: "Rewrite as a `dict` comprehension" + fixable: true location: row: 2 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UnnecessaryGeneratorDict: ~ + name: UnnecessaryGeneratorDict + body: "Unnecessary generator (rewrite as a `dict` comprehension)" + commit: "Rewrite as a `dict` comprehension" + fixable: true location: row: 6 column: 7 @@ -54,7 +63,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - UnnecessaryGeneratorDict: ~ + name: UnnecessaryGeneratorDict + body: "Unnecessary generator (rewrite as a `dict` comprehension)" + commit: "Rewrite as a `dict` comprehension" + fixable: true location: row: 7 column: 15 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C403_C403.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C403_C403.py.snap index 4ad110879b..b8b1033d92 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C403_C403.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C403_C403.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryListComprehensionSet: ~ + name: UnnecessaryListComprehensionSet + body: "Unnecessary `list` comprehension (rewrite as a `set` comprehension)" + commit: "Rewrite as a `set` comprehension" + fixable: true location: row: 1 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - UnnecessaryListComprehensionSet: ~ + name: UnnecessaryListComprehensionSet + body: "Unnecessary `list` comprehension (rewrite as a `set` comprehension)" + commit: "Rewrite as a `set` comprehension" + fixable: true location: row: 2 column: 4 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C404_C404.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C404_C404.py.snap index 6664a36872..7ae315382b 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C404_C404.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C404_C404.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryListComprehensionDict: ~ + name: UnnecessaryListComprehensionDict + body: "Unnecessary `list` comprehension (rewrite as a `dict` comprehension)" + commit: "Rewrite as a `dict` comprehension" + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C405_C405.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C405_C405.py.snap index fee51e7eb0..53489e6192 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C405_C405.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C405_C405.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryLiteralSet: - obj_type: list + name: UnnecessaryLiteralSet + body: "Unnecessary `list` literal (rewrite as a `set` literal)" + commit: "Rewrite as a `set` literal" + fixable: true location: row: 1 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - UnnecessaryLiteralSet: - obj_type: tuple + name: UnnecessaryLiteralSet + body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" + commit: "Rewrite as a `set` literal" + fixable: true location: row: 2 column: 0 @@ -39,8 +43,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - UnnecessaryLiteralSet: - obj_type: list + name: UnnecessaryLiteralSet + body: "Unnecessary `list` literal (rewrite as a `set` literal)" + commit: "Rewrite as a `set` literal" + fixable: true location: row: 3 column: 0 @@ -57,8 +63,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - UnnecessaryLiteralSet: - obj_type: tuple + name: UnnecessaryLiteralSet + body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" + commit: "Rewrite as a `set` literal" + fixable: true location: row: 4 column: 0 @@ -75,8 +83,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - UnnecessaryLiteralSet: - obj_type: tuple + name: UnnecessaryLiteralSet + body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" + commit: "Rewrite as a `set` literal" + fixable: true location: row: 6 column: 0 @@ -93,8 +103,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - UnnecessaryLiteralSet: - obj_type: tuple + name: UnnecessaryLiteralSet + body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" + commit: "Rewrite as a `set` literal" + fixable: true location: row: 7 column: 0 @@ -111,8 +123,10 @@ expression: diagnostics column: 2 parent: ~ - kind: - UnnecessaryLiteralSet: - obj_type: list + name: UnnecessaryLiteralSet + body: "Unnecessary `list` literal (rewrite as a `set` literal)" + commit: "Rewrite as a `set` literal" + fixable: true location: row: 10 column: 0 @@ -129,8 +143,10 @@ expression: diagnostics column: 2 parent: ~ - kind: - UnnecessaryLiteralSet: - obj_type: tuple + name: UnnecessaryLiteralSet + body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" + commit: "Rewrite as a `set` literal" + fixable: true location: row: 13 column: 0 @@ -147,8 +163,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UnnecessaryLiteralSet: - obj_type: list + name: UnnecessaryLiteralSet + body: "Unnecessary `list` literal (rewrite as a `set` literal)" + commit: "Rewrite as a `set` literal" + fixable: true location: row: 16 column: 0 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C406_C406.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C406_C406.py.snap index 5f11c835fa..ecb624fb52 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C406_C406.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C406_C406.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryLiteralDict: - obj_type: list + name: UnnecessaryLiteralDict + body: "Unnecessary `list` literal (rewrite as a `dict` literal)" + commit: "Rewrite as a `dict` literal" + fixable: true location: row: 1 column: 5 @@ -21,8 +23,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - UnnecessaryLiteralDict: - obj_type: tuple + name: UnnecessaryLiteralDict + body: "Unnecessary `tuple` literal (rewrite as a `dict` literal)" + commit: "Rewrite as a `dict` literal" + fixable: true location: row: 2 column: 5 @@ -39,8 +43,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - UnnecessaryLiteralDict: - obj_type: list + name: UnnecessaryLiteralDict + body: "Unnecessary `list` literal (rewrite as a `dict` literal)" + commit: "Rewrite as a `dict` literal" + fixable: true location: row: 3 column: 5 @@ -57,8 +63,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - UnnecessaryLiteralDict: - obj_type: tuple + name: UnnecessaryLiteralDict + body: "Unnecessary `tuple` literal (rewrite as a `dict` literal)" + commit: "Rewrite as a `dict` literal" + fixable: true location: row: 4 column: 5 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py.snap index d433c7ef4c..7f35bd0e3f 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryCollectionCall: - obj_type: tuple + name: UnnecessaryCollectionCall + body: "Unnecessary `tuple` call (rewrite as a literal)" + commit: Rewrite as a literal + fixable: true location: row: 1 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - UnnecessaryCollectionCall: - obj_type: list + name: UnnecessaryCollectionCall + body: "Unnecessary `list` call (rewrite as a literal)" + commit: Rewrite as a literal + fixable: true location: row: 2 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - UnnecessaryCollectionCall: - obj_type: dict + name: UnnecessaryCollectionCall + body: "Unnecessary `dict` call (rewrite as a literal)" + commit: Rewrite as a literal + fixable: true location: row: 3 column: 5 @@ -57,8 +63,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - UnnecessaryCollectionCall: - obj_type: dict + name: UnnecessaryCollectionCall + body: "Unnecessary `dict` call (rewrite as a literal)" + commit: Rewrite as a literal + fixable: true location: row: 4 column: 5 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap index 825be173f4..8794284575 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryCollectionCall: - obj_type: tuple + name: UnnecessaryCollectionCall + body: "Unnecessary `tuple` call (rewrite as a literal)" + commit: Rewrite as a literal + fixable: true location: row: 1 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - UnnecessaryCollectionCall: - obj_type: list + name: UnnecessaryCollectionCall + body: "Unnecessary `list` call (rewrite as a literal)" + commit: Rewrite as a literal + fixable: true location: row: 2 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - UnnecessaryCollectionCall: - obj_type: dict + name: UnnecessaryCollectionCall + body: "Unnecessary `dict` call (rewrite as a literal)" + commit: Rewrite as a literal + fixable: true location: row: 3 column: 5 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C409_C409.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C409_C409.py.snap index aed3ca187c..807f0c2641 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C409_C409.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C409_C409.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryLiteralWithinTupleCall: - literal: list + name: UnnecessaryLiteralWithinTupleCall + body: "Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal)" + commit: "Rewrite as a `tuple` literal" + fixable: true location: row: 1 column: 5 @@ -21,8 +23,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - UnnecessaryLiteralWithinTupleCall: - literal: list + name: UnnecessaryLiteralWithinTupleCall + body: "Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal)" + commit: "Rewrite as a `tuple` literal" + fixable: true location: row: 2 column: 5 @@ -39,8 +43,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - UnnecessaryLiteralWithinTupleCall: - literal: tuple + name: UnnecessaryLiteralWithinTupleCall + body: "Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`)" + commit: "Remove outer `tuple` call" + fixable: true location: row: 3 column: 5 @@ -57,8 +63,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - UnnecessaryLiteralWithinTupleCall: - literal: list + name: UnnecessaryLiteralWithinTupleCall + body: "Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal)" + commit: "Rewrite as a `tuple` literal" + fixable: true location: row: 4 column: 5 @@ -75,8 +83,10 @@ expression: diagnostics column: 2 parent: ~ - kind: - UnnecessaryLiteralWithinTupleCall: - literal: tuple + name: UnnecessaryLiteralWithinTupleCall + body: "Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`)" + commit: "Remove outer `tuple` call" + fixable: true location: row: 8 column: 5 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C410_C410.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C410_C410.py.snap index 89693b036b..6f0efaef72 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C410_C410.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C410_C410.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryLiteralWithinListCall: - literal: list + name: UnnecessaryLiteralWithinListCall + body: "Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`)" + commit: "Remove outer `list` call" + fixable: true location: row: 1 column: 5 @@ -21,8 +23,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - UnnecessaryLiteralWithinListCall: - literal: tuple + name: UnnecessaryLiteralWithinListCall + body: "Unnecessary `tuple` literal passed to `list()` (rewrite as a `list` literal)" + commit: "Rewrite as a `list` literal" + fixable: true location: row: 2 column: 5 @@ -39,8 +43,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - UnnecessaryLiteralWithinListCall: - literal: list + name: UnnecessaryLiteralWithinListCall + body: "Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`)" + commit: "Remove outer `list` call" + fixable: true location: row: 3 column: 5 @@ -57,8 +63,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - UnnecessaryLiteralWithinListCall: - literal: tuple + name: UnnecessaryLiteralWithinListCall + body: "Unnecessary `tuple` literal passed to `list()` (rewrite as a `list` literal)" + commit: "Rewrite as a `list` literal" + fixable: true location: row: 4 column: 5 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C411_C411.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C411_C411.py.snap index 1b1d0fe136..7ebbc3ced1 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C411_C411.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C411_C411.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryListCall: ~ + name: UnnecessaryListCall + body: "Unnecessary `list` call (remove the outer call to `list()`)" + commit: "Remove outer `list` call" + fixable: true location: row: 2 column: 0 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C413_C413.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C413_C413.py.snap index 8809cf5713..cddb924cd0 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C413_C413.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C413_C413.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryCallAroundSorted: - func: list + name: UnnecessaryCallAroundSorted + body: "Unnecessary `list` call around `sorted()`" + commit: "Remove unnecessary `list` call" + fixable: true location: row: 3 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - UnnecessaryCallAroundSorted: - func: reversed + name: UnnecessaryCallAroundSorted + body: "Unnecessary `reversed` call around `sorted()`" + commit: "Remove unnecessary `reversed` call" + fixable: true location: row: 4 column: 0 @@ -39,8 +43,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - UnnecessaryCallAroundSorted: - func: reversed + name: UnnecessaryCallAroundSorted + body: "Unnecessary `reversed` call around `sorted()`" + commit: "Remove unnecessary `reversed` call" + fixable: true location: row: 5 column: 0 @@ -57,8 +63,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - UnnecessaryCallAroundSorted: - func: reversed + name: UnnecessaryCallAroundSorted + body: "Unnecessary `reversed` call around `sorted()`" + commit: "Remove unnecessary `reversed` call" + fixable: true location: row: 6 column: 0 @@ -75,8 +83,10 @@ expression: diagnostics column: 33 parent: ~ - kind: - UnnecessaryCallAroundSorted: - func: reversed + name: UnnecessaryCallAroundSorted + body: "Unnecessary `reversed` call around `sorted()`" + commit: "Remove unnecessary `reversed` call" + fixable: true location: row: 7 column: 0 @@ -93,8 +103,10 @@ expression: diagnostics column: 50 parent: ~ - kind: - UnnecessaryCallAroundSorted: - func: reversed + name: UnnecessaryCallAroundSorted + body: "Unnecessary `reversed` call around `sorted()`" + commit: "Remove unnecessary `reversed` call" + fixable: true location: row: 8 column: 0 @@ -111,8 +123,10 @@ expression: diagnostics column: 50 parent: ~ - kind: - UnnecessaryCallAroundSorted: - func: reversed + name: UnnecessaryCallAroundSorted + body: "Unnecessary `reversed` call around `sorted()`" + commit: "Remove unnecessary `reversed` call" + fixable: true location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C414_C414.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C414_C414.py.snap index 77eee25598..be53f69801 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C414_C414.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C414_C414.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryDoubleCastOrProcess: - inner: list - outer: list + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `list` call within `list()`" + commit: "Remove the inner `list` call" + fixable: true location: row: 2 column: 0 @@ -22,9 +23,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - UnnecessaryDoubleCastOrProcess: - inner: tuple - outer: list + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `tuple` call within `list()`" + commit: "Remove the inner `tuple` call" + fixable: true location: row: 3 column: 0 @@ -41,9 +43,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - UnnecessaryDoubleCastOrProcess: - inner: list - outer: tuple + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `list` call within `tuple()`" + commit: "Remove the inner `list` call" + fixable: true location: row: 4 column: 0 @@ -60,9 +63,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - UnnecessaryDoubleCastOrProcess: - inner: tuple - outer: tuple + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `tuple` call within `tuple()`" + commit: "Remove the inner `tuple` call" + fixable: true location: row: 5 column: 0 @@ -79,9 +83,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - UnnecessaryDoubleCastOrProcess: - inner: set - outer: set + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `set` call within `set()`" + commit: "Remove the inner `set` call" + fixable: true location: row: 6 column: 0 @@ -98,9 +103,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - UnnecessaryDoubleCastOrProcess: - inner: list - outer: set + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `list` call within `set()`" + commit: "Remove the inner `list` call" + fixable: true location: row: 7 column: 0 @@ -117,9 +123,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - UnnecessaryDoubleCastOrProcess: - inner: tuple - outer: set + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `tuple` call within `set()`" + commit: "Remove the inner `tuple` call" + fixable: true location: row: 8 column: 0 @@ -136,9 +143,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - UnnecessaryDoubleCastOrProcess: - inner: sorted - outer: set + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `sorted` call within `set()`" + commit: "Remove the inner `sorted` call" + fixable: true location: row: 9 column: 0 @@ -155,9 +163,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - UnnecessaryDoubleCastOrProcess: - inner: reversed - outer: set + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `reversed` call within `set()`" + commit: "Remove the inner `reversed` call" + fixable: true location: row: 10 column: 0 @@ -174,9 +183,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - UnnecessaryDoubleCastOrProcess: - inner: list - outer: sorted + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `list` call within `sorted()`" + commit: "Remove the inner `list` call" + fixable: true location: row: 11 column: 0 @@ -193,9 +203,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - UnnecessaryDoubleCastOrProcess: - inner: tuple - outer: sorted + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `tuple` call within `sorted()`" + commit: "Remove the inner `tuple` call" + fixable: true location: row: 12 column: 0 @@ -212,9 +223,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - UnnecessaryDoubleCastOrProcess: - inner: sorted - outer: sorted + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `sorted` call within `sorted()`" + commit: "Remove the inner `sorted` call" + fixable: true location: row: 13 column: 0 @@ -231,9 +243,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - UnnecessaryDoubleCastOrProcess: - inner: reversed - outer: sorted + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `reversed` call within `sorted()`" + commit: "Remove the inner `reversed` call" + fixable: true location: row: 14 column: 0 @@ -250,9 +263,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - UnnecessaryDoubleCastOrProcess: - inner: list - outer: tuple + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `list` call within `tuple()`" + commit: "Remove the inner `list` call" + fixable: true location: row: 15 column: 0 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C415_C415.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C415_C415.py.snap index 291abadfbd..4abd12d44c 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C415_C415.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C415_C415.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_comprehensions/mod.rs +source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessarySubscriptReversal: - func: set + name: UnnecessarySubscriptReversal + body: "Unnecessary subscript reversal of iterable within `set()`" + commit: ~ + fixable: false location: row: 2 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessarySubscriptReversal: - func: reversed + name: UnnecessarySubscriptReversal + body: "Unnecessary subscript reversal of iterable within `reversed()`" + commit: ~ + fixable: false location: row: 3 column: 4 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessarySubscriptReversal: - func: sorted + name: UnnecessarySubscriptReversal + body: "Unnecessary subscript reversal of iterable within `sorted()`" + commit: ~ + fixable: false location: row: 4 column: 4 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessarySubscriptReversal: - func: sorted + name: UnnecessarySubscriptReversal + body: "Unnecessary subscript reversal of iterable within `sorted()`" + commit: ~ + fixable: false location: row: 5 column: 4 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C416_C416.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C416_C416.py.snap index 235cd61d04..b22a05f388 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C416_C416.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C416_C416.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryComprehension: - obj_type: list + name: UnnecessaryComprehension + body: "Unnecessary `list` comprehension (rewrite using `list()`)" + commit: "Rewrite using `list()`" + fixable: true location: row: 2 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - UnnecessaryComprehension: - obj_type: set + name: UnnecessaryComprehension + body: "Unnecessary `set` comprehension (rewrite using `set()`)" + commit: "Rewrite using `set()`" + fixable: true location: row: 3 column: 0 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C417_C417.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C417_C417.py.snap index 2db00e3057..85f6fd2879 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C417_C417.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C417_C417.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- - kind: - UnnecessaryMap: - obj_type: generator + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + commit: "Replace `map` using a generator expression" + fixable: true location: row: 3 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - UnnecessaryMap: - obj_type: generator + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + commit: "Replace `map` using a generator expression" + fixable: true location: row: 4 column: 0 @@ -39,8 +43,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - UnnecessaryMap: - obj_type: list + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a `list` comprehension)" + commit: "Replace `map` using a `list` comprehension" + fixable: true location: row: 5 column: 0 @@ -57,8 +63,10 @@ expression: diagnostics column: 32 parent: ~ - kind: - UnnecessaryMap: - obj_type: set + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a `set` comprehension)" + commit: "Replace `map` using a `set` comprehension" + fixable: true location: row: 6 column: 0 @@ -75,8 +83,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - UnnecessaryMap: - obj_type: dict + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a `dict` comprehension)" + commit: "Replace `map` using a `dict` comprehension" + fixable: true location: row: 7 column: 0 @@ -93,8 +103,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - UnnecessaryMap: - obj_type: generator + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + commit: "Replace `map` using a generator expression" + fixable: true location: row: 8 column: 0 @@ -111,8 +123,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - UnnecessaryMap: - obj_type: generator + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + commit: "Replace `map` using a generator expression" + fixable: true location: row: 9 column: 0 @@ -129,8 +143,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - UnnecessaryMap: - obj_type: generator + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + commit: "Replace `map` using a generator expression" + fixable: true location: row: 10 column: 12 @@ -147,8 +163,10 @@ expression: diagnostics column: 63 parent: ~ - kind: - UnnecessaryMap: - obj_type: generator + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + commit: "Replace `map` using a generator expression" + fixable: true location: row: 11 column: 4 @@ -165,8 +183,10 @@ expression: diagnostics column: 44 parent: ~ - kind: - UnnecessaryMap: - obj_type: generator + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + commit: "Replace `map` using a generator expression" + fixable: true location: row: 12 column: 13 @@ -183,8 +203,10 @@ expression: diagnostics column: 35 parent: ~ - kind: - UnnecessaryMap: - obj_type: set + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a `set` comprehension)" + commit: "Replace `map` using a `set` comprehension" + fixable: true location: row: 15 column: 7 @@ -201,8 +223,10 @@ expression: diagnostics column: 43 parent: ~ - kind: - UnnecessaryMap: - obj_type: dict + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a `dict` comprehension)" + commit: "Replace `map` using a `dict` comprehension" + fixable: true location: row: 16 column: 7 @@ -219,8 +243,10 @@ expression: diagnostics column: 43 parent: ~ - kind: - UnnecessaryMap: - obj_type: generator + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + commit: "Replace `map` using a generator expression" + fixable: true location: row: 21 column: 0 diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ001_DTZ001.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ001_DTZ001.py.snap index 0d7ffcf92e..dd8e52af48 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ001_DTZ001.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ001_DTZ001.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_datetimez/mod.rs +source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- - kind: - CallDatetimeWithoutTzinfo: ~ + name: CallDatetimeWithoutTzinfo + body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeWithoutTzinfo: ~ + name: CallDatetimeWithoutTzinfo + body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeWithoutTzinfo: ~ + name: CallDatetimeWithoutTzinfo + body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeWithoutTzinfo: ~ + name: CallDatetimeWithoutTzinfo + body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" + commit: ~ + fixable: false location: row: 16 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeWithoutTzinfo: ~ + name: CallDatetimeWithoutTzinfo + body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" + commit: ~ + fixable: false location: row: 21 column: 0 diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ002_DTZ002.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ002_DTZ002.py.snap index 8975b480c4..5f27f6498b 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ002_DTZ002.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ002_DTZ002.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_datetimez/mod.rs +source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- - kind: - CallDatetimeToday: ~ + name: CallDatetimeToday + body: "The use of `datetime.datetime.today()` is not allowed, use `datetime.datetime.now(tz=)` instead" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeToday: ~ + name: CallDatetimeToday + body: "The use of `datetime.datetime.today()` is not allowed, use `datetime.datetime.now(tz=)` instead" + commit: ~ + fixable: false location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ003_DTZ003.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ003_DTZ003.py.snap index 2d2d2d7e2e..136f14ae67 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ003_DTZ003.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ003_DTZ003.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_datetimez/mod.rs +source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- - kind: - CallDatetimeUtcnow: ~ + name: CallDatetimeUtcnow + body: "The use of `datetime.datetime.utcnow()` is not allowed, use `datetime.datetime.now(tz=)` instead" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeUtcnow: ~ + name: CallDatetimeUtcnow + body: "The use of `datetime.datetime.utcnow()` is not allowed, use `datetime.datetime.now(tz=)` instead" + commit: ~ + fixable: false location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ004_DTZ004.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ004_DTZ004.py.snap index 6be0863ac8..c139f5aebe 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ004_DTZ004.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ004_DTZ004.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_datetimez/mod.rs +source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- - kind: - CallDatetimeUtcfromtimestamp: ~ + name: CallDatetimeUtcfromtimestamp + body: "The use of `datetime.datetime.utcfromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=)` instead" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeUtcfromtimestamp: ~ + name: CallDatetimeUtcfromtimestamp + body: "The use of `datetime.datetime.utcfromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=)` instead" + commit: ~ + fixable: false location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ005_DTZ005.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ005_DTZ005.py.snap index 0074f17114..d4207ab3ca 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ005_DTZ005.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ005_DTZ005.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_datetimez/mod.rs +source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- - kind: - CallDatetimeNowWithoutTzinfo: ~ + name: CallDatetimeNowWithoutTzinfo + body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeNowWithoutTzinfo: ~ + name: CallDatetimeNowWithoutTzinfo + body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeNowWithoutTzinfo: ~ + name: CallDatetimeNowWithoutTzinfo + body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeNowWithoutTzinfo: ~ + name: CallDatetimeNowWithoutTzinfo + body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeNowWithoutTzinfo: ~ + name: CallDatetimeNowWithoutTzinfo + body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" + commit: ~ + fixable: false location: row: 18 column: 0 diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ006_DTZ006.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ006_DTZ006.py.snap index 15d33082e9..845bfc6de9 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ006_DTZ006.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ006_DTZ006.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_datetimez/mod.rs +source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- - kind: - CallDatetimeFromtimestamp: ~ + name: CallDatetimeFromtimestamp + body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeFromtimestamp: ~ + name: CallDatetimeFromtimestamp + body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeFromtimestamp: ~ + name: CallDatetimeFromtimestamp + body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeFromtimestamp: ~ + name: CallDatetimeFromtimestamp + body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeFromtimestamp: ~ + name: CallDatetimeFromtimestamp + body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" + commit: ~ + fixable: false location: row: 18 column: 0 diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ007_DTZ007.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ007_DTZ007.py.snap index 7fc195959a..b29c5de0fd 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ007_DTZ007.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ007_DTZ007.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_datetimez/mod.rs +source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- - kind: - CallDatetimeStrptimeWithoutZone: ~ + name: CallDatetimeStrptimeWithoutZone + body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeStrptimeWithoutZone: ~ + name: CallDatetimeStrptimeWithoutZone + body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeStrptimeWithoutZone: ~ + name: CallDatetimeStrptimeWithoutZone + body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeStrptimeWithoutZone: ~ + name: CallDatetimeStrptimeWithoutZone + body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDatetimeStrptimeWithoutZone: ~ + name: CallDatetimeStrptimeWithoutZone + body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" + commit: ~ + fixable: false location: row: 35 column: 0 diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap index ed70ecb990..c07646e56c 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_datetimez/mod.rs +source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- - kind: - CallDateToday: ~ + name: CallDateToday + body: "The use of `datetime.date.today()` is not allowed, use `datetime.datetime.now(tz=).date()` instead" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDateToday: ~ + name: CallDateToday + body: "The use of `datetime.date.today()` is not allowed, use `datetime.datetime.now(tz=).date()` instead" + commit: ~ + fixable: false location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap index 39b891db17..847a8ca950 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_datetimez/mod.rs +source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- - kind: - CallDateFromtimestamp: ~ + name: CallDateFromtimestamp + body: "The use of `datetime.date.fromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=).date()` instead" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CallDateFromtimestamp: ~ + name: CallDateFromtimestamp + body: "The use of `datetime.date.fromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=).date()` instead" + commit: ~ + fixable: false location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/flake8_debugger/snapshots/ruff__rules__flake8_debugger__tests__T100_T100.py.snap b/crates/ruff/src/rules/flake8_debugger/snapshots/ruff__rules__flake8_debugger__tests__T100_T100.py.snap index f1cbd8ce6f..973315dac3 100644 --- a/crates/ruff/src/rules/flake8_debugger/snapshots/ruff__rules__flake8_debugger__tests__T100_T100.py.snap +++ b/crates/ruff/src/rules/flake8_debugger/snapshots/ruff__rules__flake8_debugger__tests__T100_T100.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/flake8_debugger/mod.rs +source: crates/ruff/src/rules/flake8_debugger/mod.rs expression: diagnostics --- - kind: - Debugger: - using_type: - Call: breakpoint + name: Debugger + body: "Trace found: `breakpoint` used" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - Debugger: - using_type: - Import: pdb + name: Debugger + body: "Import for `pdb` found" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - Debugger: - using_type: - Import: builtins.breakpoint + name: Debugger + body: "Import for `builtins.breakpoint` found" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - Debugger: - using_type: - Import: pdb.set_trace + name: Debugger + body: "Import for `pdb.set_trace` found" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - Debugger: - using_type: - Import: celery.contrib.rdb.set_trace + name: Debugger + body: "Import for `celery.contrib.rdb.set_trace` found" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - Debugger: - using_type: - Import: celery.contrib.rdb + name: Debugger + body: "Import for `celery.contrib.rdb` found" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -75,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - Debugger: - using_type: - Call: builtins.breakpoint + name: Debugger + body: "Trace found: `builtins.breakpoint` used" + commit: ~ + fixable: false location: row: 11 column: 0 @@ -87,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - Debugger: - using_type: - Call: pdb.set_trace + name: Debugger + body: "Trace found: `pdb.set_trace` used" + commit: ~ + fixable: false location: row: 12 column: 0 @@ -99,9 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - Debugger: - using_type: - Call: celery.contrib.rdb.set_trace + name: Debugger + body: "Trace found: `celery.contrib.rdb.set_trace` used" + commit: ~ + fixable: false location: row: 13 column: 0 diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ001_DJ001.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ001_DJ001.py.snap index be1120b31c..d0611e26e9 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ001_DJ001.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ001_DJ001.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_django/mod.rs expression: diagnostics --- - kind: - NullableModelStringField: - field_name: CharField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as CharField" + commit: ~ + fixable: false location: row: 7 column: 16 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: TextField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as TextField" + commit: ~ + fixable: false location: row: 8 column: 16 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: SlugField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as SlugField" + commit: ~ + fixable: false location: row: 9 column: 16 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: EmailField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as EmailField" + commit: ~ + fixable: false location: row: 10 column: 17 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: FilePathField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as FilePathField" + commit: ~ + fixable: false location: row: 11 column: 20 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: URLField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as URLField" + commit: ~ + fixable: false location: row: 12 column: 15 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: CharField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as CharField" + commit: ~ + fixable: false location: row: 16 column: 16 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: CharField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as CharField" + commit: ~ + fixable: false location: row: 17 column: 16 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: SlugField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as SlugField" + commit: ~ + fixable: false location: row: 18 column: 16 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: EmailField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as EmailField" + commit: ~ + fixable: false location: row: 19 column: 17 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: FilePathField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as FilePathField" + commit: ~ + fixable: false location: row: 20 column: 20 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: URLField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as URLField" + commit: ~ + fixable: false location: row: 21 column: 15 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: CharField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as CharField" + commit: ~ + fixable: false location: row: 25 column: 16 @@ -146,8 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: CharField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as CharField" + commit: ~ + fixable: false location: row: 26 column: 16 @@ -157,8 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: SlugField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as SlugField" + commit: ~ + fixable: false location: row: 27 column: 16 @@ -168,8 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: EmailField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as EmailField" + commit: ~ + fixable: false location: row: 28 column: 17 @@ -179,8 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: FilePathField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as FilePathField" + commit: ~ + fixable: false location: row: 29 column: 20 @@ -190,8 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NullableModelStringField: - field_name: URLField + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as URLField" + commit: ~ + fixable: false location: row: 30 column: 15 diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ003_DJ003.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ003_DJ003.py.snap index 62fea871d2..d0cf9453b0 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ003_DJ003.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ003_DJ003.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_django/mod.rs expression: diagnostics --- - kind: - LocalsInRenderFunction: ~ + name: LocalsInRenderFunction + body: "Avoid passing `locals()` as context to a `render` function" + commit: ~ + fixable: false location: row: 5 column: 41 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LocalsInRenderFunction: ~ + name: LocalsInRenderFunction + body: "Avoid passing `locals()` as context to a `render` function" + commit: ~ + fixable: false location: row: 9 column: 49 @@ -22,3 +28,4 @@ expression: diagnostics column: 57 fix: ~ parent: ~ + diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ006_DJ006.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ006_DJ006.py.snap index 122236d2b8..3b20e7f755 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ006_DJ006.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ006_DJ006.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_django/mod.rs expression: diagnostics --- - kind: - ExcludeWithModelForm: ~ + name: ExcludeWithModelForm + body: "Do not use `exclude` with `ModelForm`, use `fields` instead" + commit: ~ + fixable: false location: row: 6 column: 8 @@ -12,3 +15,4 @@ expression: diagnostics column: 15 fix: ~ parent: ~ + diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ007_DJ007.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ007_DJ007.py.snap index 5d37a7b395..2e4eb99e4b 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ007_DJ007.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ007_DJ007.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_django/mod.rs expression: diagnostics --- - kind: - AllWithModelForm: ~ + name: AllWithModelForm + body: "Do not use `__all__` with `ModelForm`, use `fields` instead" + commit: ~ + fixable: false location: row: 6 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AllWithModelForm: ~ + name: AllWithModelForm + body: "Do not use `__all__` with `ModelForm`, use `fields` instead" + commit: ~ + fixable: false location: row: 11 column: 8 @@ -22,3 +28,4 @@ expression: diagnostics column: 27 fix: ~ parent: ~ + diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ008_DJ008.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ008_DJ008.py.snap index 245d4b612c..4e99614a92 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ008_DJ008.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ008_DJ008.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_django/mod.rs expression: diagnostics --- - kind: - ModelWithoutDunderStr: ~ + name: ModelWithoutDunderStr + body: "Model does not define `__str__` method" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ModelWithoutDunderStr: ~ + name: ModelWithoutDunderStr + body: "Model does not define `__str__` method" + commit: ~ + fixable: false location: row: 21 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ModelWithoutDunderStr: ~ + name: ModelWithoutDunderStr + body: "Model does not define `__str__` method" + commit: ~ + fixable: false location: row: 36 column: 0 diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ013_DJ013.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ013_DJ013.py.snap index ef8712d036..14fee8d4ec 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ013_DJ013.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ013_DJ013.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_django/mod.rs expression: diagnostics --- - kind: - NonLeadingReceiverDecorator: ~ + name: NonLeadingReceiverDecorator + body: "`@receiver` decorator must be on top of all the other decorators" + commit: ~ + fixable: false location: row: 15 column: 1 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NonLeadingReceiverDecorator: ~ + name: NonLeadingReceiverDecorator + body: "`@receiver` decorator must be on top of all the other decorators" + commit: ~ + fixable: false location: row: 35 column: 1 diff --git a/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__custom.snap b/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__custom.snap index 055fc67adf..9e05e1cfc4 100644 --- a/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__custom.snap +++ b/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__custom.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_errmsg/mod.rs +source: crates/ruff/src/rules/flake8_errmsg/mod.rs expression: diagnostics --- - kind: - RawStringInException: ~ + name: RawStringInException + body: "Exception must not use a string literal, assign to variable first" + commit: ~ + fixable: false location: row: 5 column: 23 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FStringInException: ~ + name: FStringInException + body: "Exception must not use an f-string literal, assign to variable first" + commit: ~ + fixable: false location: row: 14 column: 23 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DotFormatInException: ~ + name: DotFormatInException + body: "Exception must not use a `.format()` string directly, assign to variable first" + commit: ~ + fixable: false location: row: 18 column: 23 diff --git a/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__defaults.snap b/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__defaults.snap index c236364f85..82f93804c5 100644 --- a/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__defaults.snap +++ b/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__defaults.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_errmsg/mod.rs +source: crates/ruff/src/rules/flake8_errmsg/mod.rs expression: diagnostics --- - kind: - RawStringInException: ~ + name: RawStringInException + body: "Exception must not use a string literal, assign to variable first" + commit: ~ + fixable: false location: row: 5 column: 23 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RawStringInException: ~ + name: RawStringInException + body: "Exception must not use a string literal, assign to variable first" + commit: ~ + fixable: false location: row: 9 column: 23 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FStringInException: ~ + name: FStringInException + body: "Exception must not use an f-string literal, assign to variable first" + commit: ~ + fixable: false location: row: 14 column: 23 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DotFormatInException: ~ + name: DotFormatInException + body: "Exception must not use a `.format()` string directly, assign to variable first" + commit: ~ + fixable: false location: row: 18 column: 23 diff --git a/crates/ruff/src/rules/flake8_executable/rules/shebang_missing.rs b/crates/ruff/src/rules/flake8_executable/rules/shebang_missing.rs index 774a7c5d3c..25552822f6 100644 --- a/crates/ruff/src/rules/flake8_executable/rules/shebang_missing.rs +++ b/crates/ruff/src/rules/flake8_executable/rules/shebang_missing.rs @@ -5,7 +5,7 @@ use std::path::Path; use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; #[cfg(target_family = "unix")] use crate::rules::flake8_executable::helpers::is_executable; use crate::violation::Violation; diff --git a/crates/ruff/src/rules/flake8_executable/rules/shebang_not_executable.rs b/crates/ruff/src/rules/flake8_executable/rules/shebang_not_executable.rs index 9a0657cd8e..c810126d3a 100644 --- a/crates/ruff/src/rules/flake8_executable/rules/shebang_not_executable.rs +++ b/crates/ruff/src/rules/flake8_executable/rules/shebang_not_executable.rs @@ -7,7 +7,7 @@ use rustpython_parser::ast::Location; use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; #[cfg(target_family = "unix")] use crate::rules::flake8_executable::helpers::is_executable; use crate::rules::flake8_executable::helpers::ShebangDirective; diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_1.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_1.py.snap index 7fe4020fdb..5fd1c729fd 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_1.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_1.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_executable/mod.rs +source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- - kind: - ShebangNotExecutable: ~ + name: ShebangNotExecutable + body: Shebang is present but file is not executable + commit: ~ + fixable: false location: row: 1 column: 2 diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_1.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_1.py.snap index 8874a32d9c..8cf89f5385 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_1.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_1.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_executable/mod.rs +source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- - kind: - ShebangMissingExecutableFile: ~ + name: ShebangMissingExecutableFile + body: The file is executable but no shebang is present + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE003.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE003.py.snap index 90fe17f19d..31e0032d67 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE003.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE003.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_executable/mod.rs +source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- - kind: - ShebangPython: ~ + name: ShebangPython + body: "Shebang should contain `python`" + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_1.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_1.py.snap index fdf671dd78..cdf8ab50ac 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_1.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_1.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- - kind: - ShebangWhitespace: ~ + name: ShebangWhitespace + body: Avoid whitespace before shebang + commit: Remove whitespace before shebang + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_3.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_3.py.snap index 8874a32d9c..8cf89f5385 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_3.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_3.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_executable/mod.rs +source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- - kind: - ShebangMissingExecutableFile: ~ + name: ShebangMissingExecutableFile + body: The file is executable but no shebang is present + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_1.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_1.py.snap index e35ba41b71..a284beb33d 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_1.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_1.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_executable/mod.rs +source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- - kind: - ShebangNewline: ~ + name: ShebangNewline + body: Shebang should be at the beginning of the file + commit: ~ + fixable: false location: row: 3 column: 2 diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_2.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_2.py.snap index e656a585e5..82949a6986 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_2.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_2.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_executable/mod.rs +source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- - kind: - ShebangNewline: ~ + name: ShebangNewline + body: Shebang should be at the beginning of the file + commit: ~ + fixable: false location: row: 4 column: 2 diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_3.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_3.py.snap index 8376a57da4..213db029c3 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_3.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_3.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_executable/mod.rs +source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- - kind: - ShebangNewline: ~ + name: ShebangNewline + body: Shebang should be at the beginning of the file + commit: ~ + fixable: false location: row: 6 column: 2 diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap index a5e902f29e..cc7641131b 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_implicit_str_concat/mod.rs +source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs expression: diagnostics --- - kind: - SingleLineImplicitStringConcatenation: ~ + name: SingleLineImplicitStringConcatenation + body: Implicitly concatenated string literals on one line + commit: ~ + fixable: false location: row: 1 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SingleLineImplicitStringConcatenation: ~ + name: SingleLineImplicitStringConcatenation + body: Implicitly concatenated string literals on one line + commit: ~ + fixable: false location: row: 1 column: 8 diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap index 21e7dea892..36598d5959 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_implicit_str_concat/mod.rs +source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs expression: diagnostics --- - kind: - MultiLineImplicitStringConcatenation: ~ + name: MultiLineImplicitStringConcatenation + body: Implicitly concatenated string literals over multiple lines + commit: ~ + fixable: false location: row: 5 column: 4 diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap index bba9bd722e..25e1e06a77 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_implicit_str_concat/mod.rs +source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs expression: diagnostics --- - kind: - ExplicitStringConcatenation: ~ + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + commit: ~ + fixable: false location: row: 3 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ExplicitStringConcatenation: ~ + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + commit: ~ + fixable: false location: row: 9 column: 2 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ExplicitStringConcatenation: ~ + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + commit: ~ + fixable: false location: row: 14 column: 2 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ExplicitStringConcatenation: ~ + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + commit: ~ + fixable: false location: row: 19 column: 2 diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap index a5e902f29e..cc7641131b 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_implicit_str_concat/mod.rs +source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs expression: diagnostics --- - kind: - SingleLineImplicitStringConcatenation: ~ + name: SingleLineImplicitStringConcatenation + body: Implicitly concatenated string literals on one line + commit: ~ + fixable: false location: row: 1 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SingleLineImplicitStringConcatenation: ~ + name: SingleLineImplicitStringConcatenation + body: Implicitly concatenated string literals on one line + commit: ~ + fixable: false location: row: 1 column: 8 diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap index 5813e9ee87..56c81f00c0 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_implicit_str_concat/mod.rs +source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs expression: diagnostics --- - kind: - MultiLineImplicitStringConcatenation: ~ + name: MultiLineImplicitStringConcatenation + body: Implicitly concatenated string literals over multiple lines + commit: ~ + fixable: false location: row: 5 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiLineImplicitStringConcatenation: ~ + name: MultiLineImplicitStringConcatenation + body: Implicitly concatenated string literals over multiple lines + commit: ~ + fixable: false location: row: 24 column: 2 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiLineImplicitStringConcatenation: ~ + name: MultiLineImplicitStringConcatenation + body: Implicitly concatenated string literals over multiple lines + commit: ~ + fixable: false location: row: 29 column: 2 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiLineImplicitStringConcatenation: ~ + name: MultiLineImplicitStringConcatenation + body: Implicitly concatenated string literals over multiple lines + commit: ~ + fixable: false location: row: 34 column: 2 diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC003_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC003_ISC.py.snap index bba9bd722e..25e1e06a77 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC003_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC003_ISC.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_implicit_str_concat/mod.rs +source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs expression: diagnostics --- - kind: - ExplicitStringConcatenation: ~ + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + commit: ~ + fixable: false location: row: 3 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ExplicitStringConcatenation: ~ + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + commit: ~ + fixable: false location: row: 9 column: 2 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ExplicitStringConcatenation: ~ + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + commit: ~ + fixable: false location: row: 14 column: 2 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ExplicitStringConcatenation: ~ + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + commit: ~ + fixable: false location: row: 19 column: 2 diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__custom.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__custom.snap index 0e5ee50705..3496f8cda4 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__custom.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__custom.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs expression: diagnostics --- - kind: - UnconventionalImportAlias: - - altair - - alt + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - dask.array - - da + name: UnconventionalImportAlias + body: "`dask.array` should be imported as `da`" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - dask.dataframe - - dd + name: UnconventionalImportAlias + body: "`dask.dataframe` should be imported as `dd`" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - matplotlib.pyplot - - plt + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - numpy - - np + name: UnconventionalImportAlias + body: "`numpy` should be imported as `np`" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - pandas - - pd + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + commit: ~ + fixable: false location: row: 8 column: 0 @@ -75,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - seaborn - - sns + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -87,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - tensorflow - - tf + name: UnconventionalImportAlias + body: "`tensorflow` should be imported as `tf`" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -99,9 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - holoviews - - hv + name: UnconventionalImportAlias + body: "`holoviews` should be imported as `hv`" + commit: ~ + fixable: false location: row: 11 column: 0 @@ -111,9 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - panel - - pn + name: UnconventionalImportAlias + body: "`panel` should be imported as `pn`" + commit: ~ + fixable: false location: row: 12 column: 0 @@ -123,9 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - plotly.express - - px + name: UnconventionalImportAlias + body: "`plotly.express` should be imported as `px`" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -135,9 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - matplotlib - - mpl + name: UnconventionalImportAlias + body: "`matplotlib` should be imported as `mpl`" + commit: ~ + fixable: false location: row: 14 column: 0 @@ -147,9 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - polars - - pl + name: UnconventionalImportAlias + body: "`polars` should be imported as `pl`" + commit: ~ + fixable: false location: row: 15 column: 0 @@ -159,9 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - pyarrow - - pa + name: UnconventionalImportAlias + body: "`pyarrow` should be imported as `pa`" + commit: ~ + fixable: false location: row: 16 column: 0 @@ -171,9 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - altair - - alt + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + commit: ~ + fixable: false location: row: 18 column: 0 @@ -183,9 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - matplotlib.pyplot - - plt + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + commit: ~ + fixable: false location: row: 19 column: 0 @@ -195,9 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - dask.array - - da + name: UnconventionalImportAlias + body: "`dask.array` should be imported as `da`" + commit: ~ + fixable: false location: row: 20 column: 0 @@ -207,9 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - dask.dataframe - - dd + name: UnconventionalImportAlias + body: "`dask.dataframe` should be imported as `dd`" + commit: ~ + fixable: false location: row: 21 column: 0 @@ -219,9 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - numpy - - np + name: UnconventionalImportAlias + body: "`numpy` should be imported as `np`" + commit: ~ + fixable: false location: row: 22 column: 0 @@ -231,9 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - pandas - - pd + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + commit: ~ + fixable: false location: row: 23 column: 0 @@ -243,9 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - seaborn - - sns + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + commit: ~ + fixable: false location: row: 24 column: 0 @@ -255,9 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - tensorflow - - tf + name: UnconventionalImportAlias + body: "`tensorflow` should be imported as `tf`" + commit: ~ + fixable: false location: row: 25 column: 0 @@ -267,9 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - holoviews - - hv + name: UnconventionalImportAlias + body: "`holoviews` should be imported as `hv`" + commit: ~ + fixable: false location: row: 26 column: 0 @@ -279,9 +302,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - panel - - pn + name: UnconventionalImportAlias + body: "`panel` should be imported as `pn`" + commit: ~ + fixable: false location: row: 27 column: 0 @@ -291,9 +315,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - plotly.express - - px + name: UnconventionalImportAlias + body: "`plotly.express` should be imported as `px`" + commit: ~ + fixable: false location: row: 28 column: 0 @@ -303,9 +328,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - matplotlib - - mpl + name: UnconventionalImportAlias + body: "`matplotlib` should be imported as `mpl`" + commit: ~ + fixable: false location: row: 29 column: 0 @@ -315,9 +341,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - polars - - pl + name: UnconventionalImportAlias + body: "`polars` should be imported as `pl`" + commit: ~ + fixable: false location: row: 30 column: 0 @@ -327,9 +354,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - pyarrow - - pa + name: UnconventionalImportAlias + body: "`pyarrow` should be imported as `pa`" + commit: ~ + fixable: false location: row: 31 column: 0 diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__defaults.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__defaults.snap index 94710720cd..6c7a109e71 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__defaults.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__defaults.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs expression: diagnostics --- - kind: - UnconventionalImportAlias: - - altair - - alt + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - matplotlib.pyplot - - plt + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - numpy - - np + name: UnconventionalImportAlias + body: "`numpy` should be imported as `np`" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - pandas - - pd + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - seaborn - - sns + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - altair - - alt + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -75,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - matplotlib.pyplot - - plt + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -87,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - numpy - - np + name: UnconventionalImportAlias + body: "`numpy` should be imported as `np`" + commit: ~ + fixable: false location: row: 11 column: 0 @@ -99,9 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - pandas - - pd + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + commit: ~ + fixable: false location: row: 12 column: 0 @@ -111,9 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - seaborn - - sns + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + commit: ~ + fixable: false location: row: 13 column: 0 diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__from_imports.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__from_imports.snap index d6f30972e2..f9f3fb8641 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__from_imports.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__from_imports.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs expression: diagnostics --- - kind: - UnconventionalImportAlias: - - xml.dom.minidom - - md + name: UnconventionalImportAlias + body: "`xml.dom.minidom` should be imported as `md`" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - xml.dom.minidom - - md + name: UnconventionalImportAlias + body: "`xml.dom.minidom` should be imported as `md`" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - xml.dom.minidom - - md + name: UnconventionalImportAlias + body: "`xml.dom.minidom` should be imported as `md`" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - xml.dom.minidom - - md + name: UnconventionalImportAlias + body: "`xml.dom.minidom` should be imported as `md`" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - xml.dom.minidom.parseString - - pstr + name: UnconventionalImportAlias + body: "`xml.dom.minidom.parseString` should be imported as `pstr`" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - xml.dom.minidom.parseString - - pstr + name: UnconventionalImportAlias + body: "`xml.dom.minidom.parseString` should be imported as `pstr`" + commit: ~ + fixable: false location: row: 8 column: 0 @@ -75,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - xml.dom.minidom.parseString - - pstr + name: UnconventionalImportAlias + body: "`xml.dom.minidom.parseString` should be imported as `pstr`" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -87,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - xml.dom.minidom.parseString - - pstr + name: UnconventionalImportAlias + body: "`xml.dom.minidom.parseString` should be imported as `pstr`" + commit: ~ + fixable: false location: row: 10 column: 0 diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__override_default.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__override_default.snap index 5084e6dae4..9546a11a69 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__override_default.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__override_default.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs expression: diagnostics --- - kind: - UnconventionalImportAlias: - - altair - - alt + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - matplotlib.pyplot - - plt + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - numpy - - nmp + name: UnconventionalImportAlias + body: "`numpy` should be imported as `nmp`" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - pandas - - pd + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - seaborn - - sns + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - altair - - alt + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -75,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - matplotlib.pyplot - - plt + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -87,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - numpy - - nmp + name: UnconventionalImportAlias + body: "`numpy` should be imported as `nmp`" + commit: ~ + fixable: false location: row: 11 column: 0 @@ -99,9 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - pandas - - pd + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + commit: ~ + fixable: false location: row: 12 column: 0 @@ -111,9 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - seaborn - - sns + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + commit: ~ + fixable: false location: row: 13 column: 0 diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__remove_default.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__remove_default.snap index a5d59ceff1..4495ec2547 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__remove_default.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__remove_default.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs expression: diagnostics --- - kind: - UnconventionalImportAlias: - - altair - - alt + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - matplotlib.pyplot - - plt + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - pandas - - pd + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - seaborn - - sns + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - altair - - alt + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - matplotlib.pyplot - - plt + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -75,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - pandas - - pd + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + commit: ~ + fixable: false location: row: 12 column: 0 @@ -87,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnconventionalImportAlias: - - seaborn - - sns + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + commit: ~ + fixable: false location: row: 13 column: 0 diff --git a/crates/ruff/src/rules/flake8_logging_format/rules.rs b/crates/ruff/src/rules/flake8_logging_format/rules.rs index f08feef200..b9f9b47c20 100644 --- a/crates/ruff/src/rules/flake8_logging_format/rules.rs +++ b/crates/ruff/src/rules/flake8_logging_format/rules.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::rules::flake8_logging_format::violations::{ LoggingExcInfo, LoggingExtraAttrClash, LoggingFString, LoggingPercentFormat, LoggingRedundantExcInfo, LoggingStringConcat, LoggingStringFormat, LoggingWarn, diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G001.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G001.py.snap index c9bf425b68..1d8c3c6297 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G001.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G001.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_logging_format/mod.rs +source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- - kind: - LoggingStringFormat: ~ + name: LoggingStringFormat + body: "Logging statement uses `string.format()`" + commit: ~ + fixable: false location: row: 3 column: 13 diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G002.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G002.py.snap index 17354d07bf..5a24d6ac68 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G002.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G002.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_logging_format/mod.rs +source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- - kind: - LoggingPercentFormat: ~ + name: LoggingPercentFormat + body: "Logging statement uses `%`" + commit: ~ + fixable: false location: row: 3 column: 13 diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G003.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G003.py.snap index 913bb55d16..cc9773aa40 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G003.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G003.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_logging_format/mod.rs +source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- - kind: - LoggingStringConcat: ~ + name: LoggingStringConcat + body: "Logging statement uses `+`" + commit: ~ + fixable: false location: row: 3 column: 13 diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G004.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G004.py.snap index 7968690402..f1e7f48a6a 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G004.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G004.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_logging_format/mod.rs +source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- - kind: - LoggingFString: ~ + name: LoggingFString + body: Logging statement uses f-string + commit: ~ + fixable: false location: row: 4 column: 13 diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G010.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G010.py.snap index 07d7a4c499..2da9e3bb4e 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G010.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G010.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_logging_format/mod.rs +source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- - kind: - LoggingWarn: ~ + name: LoggingWarn + body: "Logging statement uses `warn` instead of `warning`" + commit: "Convert to `warn`" + fixable: true location: row: 3 column: 8 diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_1.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_1.py.snap index 3386ab2ee2..2fa6ab2be1 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_1.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_1.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_logging_format/mod.rs +source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- - kind: - LoggingExtraAttrClash: name + name: LoggingExtraAttrClash + body: "Logging statement uses an extra field that clashes with a LogRecord field: `name`" + commit: ~ + fixable: false location: row: 6 column: 8 diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_2.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_2.py.snap index 81f578136e..5db7dd35b8 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_2.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_2.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_logging_format/mod.rs +source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- - kind: - LoggingExtraAttrClash: name + name: LoggingExtraAttrClash + body: "Logging statement uses an extra field that clashes with a LogRecord field: `name`" + commit: ~ + fixable: false location: row: 6 column: 8 diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G201.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G201.py.snap index 06c7c2c4d0..6a4274b22d 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G201.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G201.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_logging_format/mod.rs +source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- - kind: - LoggingExcInfo: ~ + name: LoggingExcInfo + body: "Logging `.exception(...)` should be used instead of `.error(..., exc_info=True)`" + commit: ~ + fixable: false location: row: 8 column: 12 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LoggingExcInfo: ~ + name: LoggingExcInfo + body: "Logging `.exception(...)` should be used instead of `.error(..., exc_info=True)`" + commit: ~ + fixable: false location: row: 13 column: 12 diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G202.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G202.py.snap index 454822d197..02efaebd48 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G202.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G202.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_logging_format/mod.rs +source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- - kind: - LoggingRedundantExcInfo: ~ + name: LoggingRedundantExcInfo + body: "Logging statement has redundant `exc_info`" + commit: ~ + fixable: false location: row: 8 column: 37 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LoggingRedundantExcInfo: ~ + name: LoggingRedundantExcInfo + body: "Logging statement has redundant `exc_info`" + commit: ~ + fixable: false location: row: 13 column: 37 diff --git a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_empty.snap b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_empty.snap index 9d70d2f5eb..52ea67ed46 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_empty.snap +++ b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_empty.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_no_pep420/mod.rs expression: diagnostics --- - kind: - ImplicitNamespacePackage: - filename: "./resources/test/fixtures/flake8_no_pep420/test_fail_empty/example.py" + name: ImplicitNamespacePackage + body: "File `./resources/test/fixtures/flake8_no_pep420/test_fail_empty/example.py` is part of an implicit namespace package. Add an `__init__.py`." + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_nonempty.snap b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_nonempty.snap index 5283b87f2d..bb7d69b8eb 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_nonempty.snap +++ b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_nonempty.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_no_pep420/mod.rs expression: diagnostics --- - kind: - ImplicitNamespacePackage: - filename: "./resources/test/fixtures/flake8_no_pep420/test_fail_nonempty/example.py" + name: ImplicitNamespacePackage + body: "File `./resources/test/fixtures/flake8_no_pep420/test_fail_nonempty/example.py` is part of an implicit namespace package. Add an `__init__.py`." + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_shebang.snap b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_shebang.snap index 045403c811..4f08354eb6 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_shebang.snap +++ b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_shebang.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_no_pep420/mod.rs expression: diagnostics --- - kind: - ImplicitNamespacePackage: - filename: "./resources/test/fixtures/flake8_no_pep420/test_fail_shebang/example.py" + name: ImplicitNamespacePackage + body: "File `./resources/test/fixtures/flake8_no_pep420/test_fail_shebang/example.py` is part of an implicit namespace package. Add an `__init__.py`." + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/flake8_pie/rules.rs b/crates/ruff/src/rules/flake8_pie/rules.rs index 655892f276..04428d4be7 100644 --- a/crates/ruff/src/rules/flake8_pie/rules.rs +++ b/crates/ruff/src/rules/flake8_pie/rules.rs @@ -13,7 +13,7 @@ use crate::autofix::helpers::delete_stmt; use crate::checkers::ast::Checker; use crate::fix::Fix; use crate::message::Location; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{AlwaysAutofixableViolation, Violation}; use super::fixes; diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE790_PIE790.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE790_PIE790.py.snap index f2268bd3f6..54f58cd4d4 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE790_PIE790.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE790_PIE790.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 4 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 9 column: 4 @@ -37,7 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 14 column: 4 @@ -54,7 +63,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 21 column: 4 @@ -71,7 +83,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 28 column: 4 @@ -88,7 +103,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 35 column: 4 @@ -105,7 +123,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 42 column: 4 @@ -122,7 +143,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 50 column: 4 @@ -139,7 +163,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 58 column: 4 @@ -156,7 +183,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 65 column: 4 @@ -173,7 +203,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 74 column: 4 @@ -190,7 +223,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 79 column: 4 @@ -207,7 +243,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 83 column: 4 @@ -224,7 +263,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 87 column: 4 @@ -241,7 +283,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 92 column: 4 @@ -258,7 +303,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 96 column: 4 @@ -275,7 +323,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryPass: ~ + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + commit: "Remove unnecessary `pass`" + fixable: true location: row: 101 column: 4 diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE794_PIE794.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE794_PIE794.py.snap index bab8b64b2e..6704f52f05 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE794_PIE794.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE794_PIE794.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- - kind: - DupeClassFieldDefinitions: name + name: DupeClassFieldDefinitions + body: "Class field `name` is defined multiple times" + commit: "Remove duplicate field definition for `name`" + fixable: true location: row: 4 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DupeClassFieldDefinitions: name + name: DupeClassFieldDefinitions + body: "Class field `name` is defined multiple times" + commit: "Remove duplicate field definition for `name`" + fixable: true location: row: 13 column: 4 @@ -37,7 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DupeClassFieldDefinitions: bar + name: DupeClassFieldDefinitions + body: "Class field `bar` is defined multiple times" + commit: "Remove duplicate field definition for `bar`" + fixable: true location: row: 23 column: 4 @@ -54,7 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DupeClassFieldDefinitions: bar + name: DupeClassFieldDefinitions + body: "Class field `bar` is defined multiple times" + commit: "Remove duplicate field definition for `bar`" + fixable: true location: row: 40 column: 4 diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE796_PIE796.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE796_PIE796.py.snap index 8e3df7a0ae..ebbf217710 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE796_PIE796.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE796_PIE796.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_pie/mod.rs +source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- - kind: - PreferUniqueEnums: - value: "\"B\"" + name: PreferUniqueEnums + body: "Enum contains duplicate value: `\"B\"`" + commit: ~ + fixable: false location: row: 8 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferUniqueEnums: - value: "2" + name: PreferUniqueEnums + body: "Enum contains duplicate value: `2`" + commit: ~ + fixable: false location: row: 14 column: 4 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferUniqueEnums: - value: "\"2\"" + name: PreferUniqueEnums + body: "Enum contains duplicate value: `\"2\"`" + commit: ~ + fixable: false location: row: 20 column: 4 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferUniqueEnums: - value: "2.5" + name: PreferUniqueEnums + body: "Enum contains duplicate value: `2.5`" + commit: ~ + fixable: false location: row: 26 column: 4 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferUniqueEnums: - value: "False" + name: PreferUniqueEnums + body: "Enum contains duplicate value: `False`" + commit: ~ + fixable: false location: row: 33 column: 4 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferUniqueEnums: - value: None + name: PreferUniqueEnums + body: "Enum contains duplicate value: `None`" + commit: ~ + fixable: false location: row: 40 column: 4 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferUniqueEnums: - value: "2" + name: PreferUniqueEnums + body: "Enum contains duplicate value: `2`" + commit: ~ + fixable: false location: row: 54 column: 4 diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE800_PIE800.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE800_PIE800.py.snap index f5517f4003..65c24ecd77 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE800_PIE800.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE800_PIE800.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- - kind: - UnnecessarySpread: ~ + name: UnnecessarySpread + body: "Unnecessary spread `**`" + commit: ~ + fixable: false location: row: 1 column: 13 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessarySpread: ~ + name: UnnecessarySpread + body: "Unnecessary spread `**`" + commit: ~ + fixable: false location: row: 3 column: 14 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessarySpread: ~ + name: UnnecessarySpread + body: "Unnecessary spread `**`" + commit: ~ + fixable: false location: row: 5 column: 10 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessarySpread: ~ + name: UnnecessarySpread + body: "Unnecessary spread `**`" + commit: ~ + fixable: false location: row: 7 column: 18 diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE802_PIE802.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE802_PIE802.py.snap index 62363bcf13..dcbc3b7990 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE802_PIE802.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE802_PIE802.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- - kind: - UnnecessaryComprehensionAnyAll: ~ + name: UnnecessaryComprehensionAnyAll + body: Unnecessary list comprehension. + commit: Remove unnecessary list comprehension + fixable: true location: row: 9 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - UnnecessaryComprehensionAnyAll: ~ + name: UnnecessaryComprehensionAnyAll + body: Unnecessary list comprehension. + commit: Remove unnecessary list comprehension + fixable: true location: row: 10 column: 4 diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE804_PIE804.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE804_PIE804.py.snap index 2834085f7c..db406d90b8 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE804_PIE804.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE804_PIE804.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- - kind: - UnnecessaryDictKwargs: ~ + name: UnnecessaryDictKwargs + body: "Unnecessary `dict` kwargs" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessaryDictKwargs: ~ + name: UnnecessaryDictKwargs + body: "Unnecessary `dict` kwargs" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessaryDictKwargs: ~ + name: UnnecessaryDictKwargs + body: "Unnecessary `dict` kwargs" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessaryDictKwargs: ~ + name: UnnecessaryDictKwargs + body: "Unnecessary `dict` kwargs" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessaryDictKwargs: ~ + name: UnnecessaryDictKwargs + body: "Unnecessary `dict` kwargs" + commit: ~ + fixable: false location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE807_PIE807.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE807_PIE807.py.snap index f573980234..ffb7d4e680 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE807_PIE807.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE807_PIE807.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- - kind: - PreferListBuiltin: ~ + name: PreferListBuiltin + body: "Prefer `list` over useless lambda" + commit: "Replace with `list`" + fixable: true location: row: 3 column: 43 @@ -20,7 +23,10 @@ expression: diagnostics column: 53 parent: ~ - kind: - PreferListBuiltin: ~ + name: PreferListBuiltin + body: "Prefer `list` over useless lambda" + commit: "Replace with `list`" + fixable: true location: row: 7 column: 35 @@ -37,7 +43,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - PreferListBuiltin: ~ + name: PreferListBuiltin + body: "Prefer `list` over useless lambda" + commit: "Replace with `list`" + fixable: true location: row: 11 column: 27 diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE810_PIE810.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE810_PIE810.py.snap index 465ecd0d1b..3c8192e5e4 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE810_PIE810.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE810_PIE810.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- - kind: - SingleStartsEndsWith: - attr: startswith + name: SingleStartsEndsWith + body: "Call `startswith` once with a `tuple`" + commit: ~ + fixable: false location: row: 2 column: 25 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SingleStartsEndsWith: - attr: endswith + name: SingleStartsEndsWith + body: "Call `endswith` once with a `tuple`" + commit: ~ + fixable: false location: row: 4 column: 23 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SingleStartsEndsWith: - attr: startswith + name: SingleStartsEndsWith + body: "Call `startswith` once with a `tuple`" + commit: ~ + fixable: false location: row: 6 column: 23 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SingleStartsEndsWith: - attr: startswith + name: SingleStartsEndsWith + body: "Call `startswith` once with a `tuple`" + commit: ~ + fixable: false location: row: 8 column: 23 diff --git a/crates/ruff/src/rules/flake8_print/rules/print_call.rs b/crates/ruff/src/rules/flake8_print/rules/print_call.rs index fdd0e42700..4b9094e359 100644 --- a/crates/ruff/src/rules/flake8_print/rules/print_call.rs +++ b/crates/ruff/src/rules/flake8_print/rules/print_call.rs @@ -5,7 +5,7 @@ use ruff_python_ast::helpers::is_const_none; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::Violation; #[violation] diff --git a/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T201_T201.py.snap b/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T201_T201.py.snap index f971a93225..d6e33a9517 100644 --- a/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T201_T201.py.snap +++ b/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T201_T201.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_print/mod.rs expression: diagnostics --- - kind: - PrintFound: ~ + name: PrintFound + body: "`print` found" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrintFound: ~ + name: PrintFound + body: "`print` found" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrintFound: ~ + name: PrintFound + body: "`print` found" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrintFound: ~ + name: PrintFound + body: "`print` found" + commit: ~ + fixable: false location: row: 7 column: 0 diff --git a/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T203_T203.py.snap b/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T203_T203.py.snap index f177fd7ae4..7e2bbf03d8 100644 --- a/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T203_T203.py.snap +++ b/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T203_T203.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_print/mod.rs expression: diagnostics --- - kind: - PPrintFound: ~ + name: PPrintFound + body: "`pprint` found" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PPrintFound: ~ + name: PPrintFound + body: "`pprint` found" + commit: ~ + fixable: false location: row: 7 column: 0 diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.pyi.snap index 4e7e410b38..e72402dda0 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.pyi.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- - kind: - PrefixTypeParams: - kind: TypeVar + name: PrefixTypeParams + body: "Name of private `TypeVar` must start with `_`" + commit: ~ + fixable: false location: row: 3 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrefixTypeParams: - kind: TypeVarTuple + name: PrefixTypeParams + body: "Name of private `TypeVarTuple` must start with `_`" + commit: ~ + fixable: false location: row: 5 column: 9 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrefixTypeParams: - kind: ParamSpec + name: PrefixTypeParams + body: "Name of private `ParamSpec` must start with `_`" + commit: ~ + fixable: false location: row: 7 column: 4 diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap index 95de308401..47ebfb4151 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- - kind: - BadVersionInfoComparison: ~ + name: BadVersionInfoComparison + body: "Use `<` or `>=` for version info comparisons" + commit: ~ + fixable: false location: row: 8 column: 3 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadVersionInfoComparison: ~ + name: BadVersionInfoComparison + body: "Use `<` or `>=` for version info comparisons" + commit: ~ + fixable: false location: row: 10 column: 3 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadVersionInfoComparison: ~ + name: BadVersionInfoComparison + body: "Use `<` or `>=` for version info comparisons" + commit: ~ + fixable: false location: row: 12 column: 3 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadVersionInfoComparison: ~ + name: BadVersionInfoComparison + body: "Use `<` or `>=` for version info comparisons" + commit: ~ + fixable: false location: row: 14 column: 3 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadVersionInfoComparison: ~ + name: BadVersionInfoComparison + body: "Use `<` or `>=` for version info comparisons" + commit: ~ + fixable: false location: row: 16 column: 3 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadVersionInfoComparison: ~ + name: BadVersionInfoComparison + body: "Use `<` or `>=` for version info comparisons" + commit: ~ + fixable: false location: row: 18 column: 3 diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap index 255271d6f9..7f2805d328 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- - kind: - UnrecognizedPlatformCheck: ~ + name: UnrecognizedPlatformCheck + body: "Unrecognized `sys.platform` check" + commit: ~ + fixable: false location: row: 7 column: 3 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnrecognizedPlatformCheck: ~ + name: UnrecognizedPlatformCheck + body: "Unrecognized `sys.platform` check" + commit: ~ + fixable: false location: row: 9 column: 3 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnrecognizedPlatformCheck: ~ + name: UnrecognizedPlatformCheck + body: "Unrecognized `sys.platform` check" + commit: ~ + fixable: false location: row: 11 column: 3 diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.pyi.snap index 8fe25a41cb..d7c25fb078 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.pyi.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- - kind: - UnrecognizedPlatformName: - platform: linus + name: UnrecognizedPlatformName + body: "Unrecognized platform `linus`" + commit: ~ + fixable: false location: row: 3 column: 19 diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap index fa5be660aa..3e96bab00b 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- - kind: - PassStatementStubBody: ~ + name: PassStatementStubBody + body: "Empty body should contain `...`, not `pass`" + commit: ~ + fixable: false location: row: 3 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PassStatementStubBody: ~ + name: PassStatementStubBody + body: "Empty body should contain `...`, not `pass`" + commit: ~ + fixable: false location: row: 8 column: 4 diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap index 5f2d1566ee..bfe9e0b2a1 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- - kind: - NonEmptyStubBody: ~ + name: NonEmptyStubBody + body: "Function body must contain only `...`" + commit: ~ + fixable: false location: row: 6 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NonEmptyStubBody: ~ + name: NonEmptyStubBody + body: "Function body must contain only `...`" + commit: ~ + fixable: false location: row: 9 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NonEmptyStubBody: ~ + name: NonEmptyStubBody + body: "Function body must contain only `...`" + commit: ~ + fixable: false location: row: 12 column: 4 diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap index ca23c73648..91e86b7214 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- - kind: - TypedArgumentSimpleDefaults: ~ + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + commit: ~ + fixable: false location: row: 3 column: 13 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypedArgumentSimpleDefaults: ~ + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + commit: ~ + fixable: false location: row: 9 column: 8 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypedArgumentSimpleDefaults: ~ + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + commit: ~ + fixable: false location: row: 18 column: 8 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypedArgumentSimpleDefaults: ~ + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + commit: ~ + fixable: false location: row: 27 column: 8 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypedArgumentSimpleDefaults: ~ + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + commit: ~ + fixable: false location: row: 36 column: 8 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypedArgumentSimpleDefaults: ~ + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + commit: ~ + fixable: false location: row: 41 column: 13 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypedArgumentSimpleDefaults: ~ + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + commit: ~ + fixable: false location: row: 45 column: 13 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypedArgumentSimpleDefaults: ~ + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + commit: ~ + fixable: false location: row: 49 column: 16 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypedArgumentSimpleDefaults: ~ + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + commit: ~ + fixable: false location: row: 53 column: 13 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypedArgumentSimpleDefaults: ~ + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + commit: ~ + fixable: false location: row: 57 column: 17 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypedArgumentSimpleDefaults: ~ + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + commit: ~ + fixable: false location: row: 61 column: 17 diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap index 7b6f9d4637..15f2eb9ac2 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- - kind: - ArgumentSimpleDefaults: ~ + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + commit: ~ + fixable: false location: row: 3 column: 6 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ArgumentSimpleDefaults: ~ + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + commit: ~ + fixable: false location: row: 7 column: 6 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ArgumentSimpleDefaults: ~ + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + commit: ~ + fixable: false location: row: 14 column: 6 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ArgumentSimpleDefaults: ~ + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + commit: ~ + fixable: false location: row: 21 column: 6 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ArgumentSimpleDefaults: ~ + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + commit: ~ + fixable: false location: row: 27 column: 10 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ArgumentSimpleDefaults: ~ + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + commit: ~ + fixable: false location: row: 29 column: 6 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ArgumentSimpleDefaults: ~ + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + commit: ~ + fixable: false location: row: 32 column: 6 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ArgumentSimpleDefaults: ~ + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + commit: ~ + fixable: false location: row: 35 column: 6 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ArgumentSimpleDefaults: ~ + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + commit: ~ + fixable: false location: row: 38 column: 6 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ArgumentSimpleDefaults: ~ + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + commit: ~ + fixable: false location: row: 41 column: 6 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ArgumentSimpleDefaults: ~ + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + commit: ~ + fixable: false location: row: 44 column: 6 diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.pyi.snap index 1eb3a86645..bd4472d802 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.pyi.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- - kind: - DocstringInStub: ~ + name: DocstringInStub + body: Docstrings should not be included in stubs + commit: ~ + fixable: false location: row: 1 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DocstringInStub: ~ + name: DocstringInStub + body: Docstrings should not be included in stubs + commit: ~ + fixable: false location: row: 4 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DocstringInStub: ~ + name: DocstringInStub + body: Docstrings should not be included in stubs + commit: ~ + fixable: false location: row: 7 column: 4 diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.pyi.snap index eb65887508..8c60008f30 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.pyi.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- - kind: - TypeCommentInStub: ~ + name: TypeCommentInStub + body: "Don't use type comments in stub file" + commit: ~ + fixable: false location: row: 6 column: 21 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeCommentInStub: ~ + name: TypeCommentInStub + body: "Don't use type comments in stub file" + commit: ~ + fixable: false location: row: 7 column: 21 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeCommentInStub: ~ + name: TypeCommentInStub + body: "Don't use type comments in stub file" + commit: ~ + fixable: false location: row: 8 column: 21 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeCommentInStub: ~ + name: TypeCommentInStub + body: "Don't use type comments in stub file" + commit: ~ + fixable: false location: row: 9 column: 21 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeCommentInStub: ~ + name: TypeCommentInStub + body: "Don't use type comments in stub file" + commit: ~ + fixable: false location: row: 10 column: 19 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeCommentInStub: ~ + name: TypeCommentInStub + body: "Don't use type comments in stub file" + commit: ~ + fixable: false location: row: 11 column: 19 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeCommentInStub: ~ + name: TypeCommentInStub + body: "Don't use type comments in stub file" + commit: ~ + fixable: false location: row: 14 column: 11 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeCommentInStub: ~ + name: TypeCommentInStub + body: "Don't use type comments in stub file" + commit: ~ + fixable: false location: row: 15 column: 10 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeCommentInStub: ~ + name: TypeCommentInStub + body: "Don't use type comments in stub file" + commit: ~ + fixable: false location: row: 19 column: 28 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeCommentInStub: ~ + name: TypeCommentInStub + body: "Don't use type comments in stub file" + commit: ~ + fixable: false location: row: 29 column: 21 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeCommentInStub: ~ + name: TypeCommentInStub + body: "Don't use type comments in stub file" + commit: ~ + fixable: false location: row: 32 column: 25 diff --git a/crates/ruff/src/rules/flake8_pytest_style/rules/assertion.rs b/crates/ruff/src/rules/flake8_pytest_style/rules/assertion.rs index 9b97c42e72..31f98ef84e 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/rules/assertion.rs +++ b/crates/ruff/src/rules/flake8_pytest_style/rules/assertion.rs @@ -20,7 +20,7 @@ use ruff_python_ast::{visitor, whitespace}; use crate::checkers::ast::Checker; use crate::cst::matchers::match_module; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{AutofixKind, Availability, Violation}; use super::helpers::is_falsy_constant; diff --git a/crates/ruff/src/rules/flake8_pytest_style/rules/fixture.rs b/crates/ruff/src/rules/flake8_pytest_style/rules/fixture.rs index c5ed5f9d5a..923900e28f 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/rules/fixture.rs +++ b/crates/ruff/src/rules/flake8_pytest_style/rules/fixture.rs @@ -12,7 +12,7 @@ use ruff_python_ast::visitor::Visitor; use crate::autofix::helpers::remove_argument; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::violation::{AlwaysAutofixableViolation, Violation}; use super::helpers::{ diff --git a/crates/ruff/src/rules/flake8_pytest_style/rules/marks.rs b/crates/ruff/src/rules/flake8_pytest_style/rules/marks.rs index 4b628995b4..20ac4fceb8 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/rules/marks.rs +++ b/crates/ruff/src/rules/flake8_pytest_style/rules/marks.rs @@ -5,7 +5,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::violation::AlwaysAutofixableViolation; use super::helpers::{get_mark_decorators, get_mark_name}; diff --git a/crates/ruff/src/rules/flake8_pytest_style/rules/parametrize.rs b/crates/ruff/src/rules/flake8_pytest_style/rules/parametrize.rs index 8784f147d0..3c076ec31b 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/rules/parametrize.rs +++ b/crates/ruff/src/rules/flake8_pytest_style/rules/parametrize.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::violation::{AlwaysAutofixableViolation, Violation}; use super::super::types; diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_default.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_default.snap index e00d4c9ac7..034e736351 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_default.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_default.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - IncorrectFixtureParenthesesStyle: - expected_parens: () - actual_parens: "" + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture()` over `@pytest.fixture`" + commit: Add/remove parentheses + fixable: true location: row: 9 column: 1 @@ -22,9 +23,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - IncorrectFixtureParenthesesStyle: - expected_parens: () - actual_parens: "" + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture()` over `@pytest.fixture`" + commit: Add/remove parentheses + fixable: true location: row: 34 column: 1 @@ -41,9 +43,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - IncorrectFixtureParenthesesStyle: - expected_parens: () - actual_parens: "" + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture()` over `@pytest.fixture`" + commit: Add/remove parentheses + fixable: true location: row: 59 column: 1 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_no_parentheses.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_no_parentheses.snap index 8e342ed9e0..f76e56c48d 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_no_parentheses.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_no_parentheses.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - IncorrectFixtureParenthesesStyle: - expected_parens: "" - actual_parens: () + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture` over `@pytest.fixture()`" + commit: Add/remove parentheses + fixable: true location: row: 14 column: 1 @@ -22,9 +23,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - IncorrectFixtureParenthesesStyle: - expected_parens: "" - actual_parens: () + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture` over `@pytest.fixture()`" + commit: Add/remove parentheses + fixable: true location: row: 24 column: 1 @@ -41,9 +43,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - IncorrectFixtureParenthesesStyle: - expected_parens: "" - actual_parens: () + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture` over `@pytest.fixture()`" + commit: Add/remove parentheses + fixable: true location: row: 39 column: 1 @@ -60,9 +63,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - IncorrectFixtureParenthesesStyle: - expected_parens: "" - actual_parens: () + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture` over `@pytest.fixture()`" + commit: Add/remove parentheses + fixable: true location: row: 49 column: 1 @@ -79,9 +83,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - IncorrectFixtureParenthesesStyle: - expected_parens: "" - actual_parens: () + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture` over `@pytest.fixture()`" + commit: Add/remove parentheses + fixable: true location: row: 64 column: 1 @@ -98,9 +103,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - IncorrectFixtureParenthesesStyle: - expected_parens: "" - actual_parens: () + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture` over `@pytest.fixture()`" + commit: Add/remove parentheses + fixable: true location: row: 74 column: 1 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT002.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT002.snap index e0d63d940d..454f6f3de3 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT002.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT002.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - FixturePositionalArgs: - function: my_fixture + name: FixturePositionalArgs + body: "Configuration for fixture `my_fixture` specified via positional args, use kwargs" + commit: ~ + fixable: false location: row: 14 column: 1 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FixturePositionalArgs: - function: my_fixture + name: FixturePositionalArgs + body: "Configuration for fixture `my_fixture` specified via positional args, use kwargs" + commit: ~ + fixable: false location: row: 19 column: 1 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT003.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT003.snap index be469688c5..c0ed02eb7b 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT003.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT003.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - ExtraneousScopeFunction: ~ + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + commit: "Remove implied `scope` argument" + fixable: true location: row: 14 column: 16 @@ -20,7 +23,10 @@ expression: diagnostics column: 32 parent: ~ - kind: - ExtraneousScopeFunction: ~ + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + commit: "Remove implied `scope` argument" + fixable: true location: row: 19 column: 16 @@ -37,7 +43,10 @@ expression: diagnostics column: 34 parent: ~ - kind: - ExtraneousScopeFunction: ~ + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + commit: "Remove implied `scope` argument" + fixable: true location: row: 24 column: 35 @@ -54,7 +63,10 @@ expression: diagnostics column: 51 parent: ~ - kind: - ExtraneousScopeFunction: ~ + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + commit: "Remove implied `scope` argument" + fixable: true location: row: 29 column: 35 @@ -71,7 +83,10 @@ expression: diagnostics column: 53 parent: ~ - kind: - ExtraneousScopeFunction: ~ + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + commit: "Remove implied `scope` argument" + fixable: true location: row: 37 column: 30 @@ -88,7 +103,10 @@ expression: diagnostics column: 46 parent: ~ - kind: - ExtraneousScopeFunction: ~ + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + commit: "Remove implied `scope` argument" + fixable: true location: row: 43 column: 4 @@ -105,7 +123,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - ExtraneousScopeFunction: ~ + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + commit: "Remove implied `scope` argument" + fixable: true location: row: 52 column: 4 @@ -122,7 +143,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - ExtraneousScopeFunction: ~ + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + commit: "Remove implied `scope` argument" + fixable: true location: row: 66 column: 4 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT004.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT004.snap index e05e01995b..71a72717bc 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT004.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT004.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - MissingFixtureNameUnderscore: - function: patch_something + name: MissingFixtureNameUnderscore + body: "Fixture `patch_something` does not return anything, add leading underscore" + commit: ~ + fixable: false location: row: 51 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingFixtureNameUnderscore: - function: activate_context + name: MissingFixtureNameUnderscore + body: "Fixture `activate_context` does not return anything, add leading underscore" + commit: ~ + fixable: false location: row: 56 column: 0 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT005.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT005.snap index 1a9b9a4210..58963be5d2 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT005.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT005.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - IncorrectFixtureNameUnderscore: - function: _my_fixture + name: IncorrectFixtureNameUnderscore + body: "Fixture `_my_fixture` returns a value, remove leading underscore" + commit: ~ + fixable: false location: row: 41 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IncorrectFixtureNameUnderscore: - function: _activate_context + name: IncorrectFixtureNameUnderscore + body: "Fixture `_activate_context` returns a value, remove leading underscore" + commit: ~ + fixable: false location: row: 46 column: 0 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IncorrectFixtureNameUnderscore: - function: _activate_context + name: IncorrectFixtureNameUnderscore + body: "Fixture `_activate_context` returns a value, remove leading underscore" + commit: ~ + fixable: false location: row: 52 column: 0 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_csv.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_csv.snap index 6c31c725b3..64d0021de8 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_csv.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_csv.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - ParametrizeNamesWrongType: - expected: csv + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + commit: "Use a `csv` for parameter names" + fixable: true location: row: 24 column: 25 @@ -21,8 +23,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: csv + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + commit: "Use a `csv` for parameter names" + fixable: true location: row: 29 column: 25 @@ -39,8 +43,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: csv + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + commit: "Use a `csv` for parameter names" + fixable: true location: row: 34 column: 25 @@ -57,8 +63,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: csv + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + commit: "Use a `csv` for parameter names" + fixable: true location: row: 39 column: 25 @@ -75,8 +83,10 @@ expression: diagnostics column: 35 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: csv + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + commit: "Use a `csv` for parameter names" + fixable: true location: row: 44 column: 25 @@ -86,8 +96,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeNamesWrongType: - expected: csv + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + commit: "Use a `csv` for parameter names" + fixable: true location: row: 49 column: 25 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_default.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_default.snap index 4d14964a77..cdef98d134 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_default.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_default.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - ParametrizeNamesWrongType: - expected: tuple + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" + commit: "Use a `tuple` for parameter names" + fixable: true location: row: 9 column: 25 @@ -21,8 +23,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: tuple + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" + commit: "Use a `tuple` for parameter names" + fixable: true location: row: 14 column: 25 @@ -39,8 +43,10 @@ expression: diagnostics column: 56 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: tuple + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" + commit: "Use a `tuple` for parameter names" + fixable: true location: row: 19 column: 25 @@ -57,8 +63,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: csv + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + commit: "Use a `csv` for parameter names" + fixable: true location: row: 29 column: 25 @@ -75,8 +83,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: tuple + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" + commit: "Use a `tuple` for parameter names" + fixable: true location: row: 34 column: 25 @@ -93,8 +103,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: csv + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + commit: "Use a `csv` for parameter names" + fixable: true location: row: 39 column: 25 @@ -111,8 +123,10 @@ expression: diagnostics column: 35 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: tuple + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" + commit: "Use a `tuple` for parameter names" + fixable: true location: row: 44 column: 25 @@ -129,8 +143,10 @@ expression: diagnostics column: 50 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: tuple + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" + commit: "Use a `tuple` for parameter names" + fixable: true location: row: 49 column: 25 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_list.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_list.snap index df945edded..ec3513ac97 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_list.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_list.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - ParametrizeNamesWrongType: - expected: list + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `list`" + commit: "Use a `list` for parameter names" + fixable: true location: row: 9 column: 25 @@ -21,8 +23,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: list + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `list`" + commit: "Use a `list` for parameter names" + fixable: true location: row: 14 column: 25 @@ -39,8 +43,10 @@ expression: diagnostics column: 56 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: list + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `list`" + commit: "Use a `list` for parameter names" + fixable: true location: row: 19 column: 25 @@ -57,8 +63,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: list + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `list`" + commit: "Use a `list` for parameter names" + fixable: true location: row: 24 column: 25 @@ -75,8 +83,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: csv + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + commit: "Use a `csv` for parameter names" + fixable: true location: row: 29 column: 25 @@ -93,8 +103,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - ParametrizeNamesWrongType: - expected: csv + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + commit: "Use a `csv` for parameter names" + fixable: true location: row: 39 column: 25 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_lists.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_lists.snap index ddf693b88d..29ac21229d 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_lists.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_lists.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - ParametrizeValuesWrongType: - values: list - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + commit: ~ + fixable: false location: row: 4 column: 34 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + commit: ~ + fixable: false location: row: 11 column: 4 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + commit: ~ + fixable: false location: row: 12 column: 8 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + commit: ~ + fixable: false location: row: 13 column: 8 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + commit: ~ + fixable: false location: row: 22 column: 4 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + commit: ~ + fixable: false location: row: 39 column: 8 @@ -75,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + commit: ~ + fixable: false location: row: 40 column: 8 @@ -87,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + commit: ~ + fixable: false location: row: 81 column: 37 @@ -99,9 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + commit: ~ + fixable: false location: row: 81 column: 38 @@ -111,9 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + commit: ~ + fixable: false location: row: 81 column: 46 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_tuples.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_tuples.snap index 02c9c826b9..5710ccd7ec 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_tuples.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_tuples.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - ParametrizeValuesWrongType: - values: list - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + commit: ~ + fixable: false location: row: 4 column: 34 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + commit: ~ + fixable: false location: row: 11 column: 4 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + commit: ~ + fixable: false location: row: 22 column: 4 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + commit: ~ + fixable: false location: row: 23 column: 8 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + commit: ~ + fixable: false location: row: 24 column: 8 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + commit: ~ + fixable: false location: row: 50 column: 8 @@ -75,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + commit: ~ + fixable: false location: row: 51 column: 8 @@ -87,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + commit: ~ + fixable: false location: row: 61 column: 8 @@ -99,9 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + commit: ~ + fixable: false location: row: 62 column: 8 @@ -111,9 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: list - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + commit: ~ + fixable: false location: row: 81 column: 37 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_lists.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_lists.snap index 1e4428c7d3..6b43a2fcd8 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_lists.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_lists.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - ParametrizeValuesWrongType: - values: tuple - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + commit: ~ + fixable: false location: row: 12 column: 8 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + commit: ~ + fixable: false location: row: 13 column: 8 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + commit: ~ + fixable: false location: row: 31 column: 34 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + commit: ~ + fixable: false location: row: 38 column: 4 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + commit: ~ + fixable: false location: row: 39 column: 8 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + commit: ~ + fixable: false location: row: 40 column: 8 @@ -75,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + commit: ~ + fixable: false location: row: 49 column: 4 @@ -87,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + commit: ~ + fixable: false location: row: 60 column: 4 @@ -99,9 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + commit: ~ + fixable: false location: row: 71 column: 4 @@ -111,9 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + commit: ~ + fixable: false location: row: 80 column: 30 @@ -123,9 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + commit: ~ + fixable: false location: row: 81 column: 38 @@ -135,9 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: list + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + commit: ~ + fixable: false location: row: 81 column: 46 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_tuples.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_tuples.snap index ca0cef9196..fd2df75716 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_tuples.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_tuples.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - ParametrizeValuesWrongType: - values: tuple - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + commit: ~ + fixable: false location: row: 23 column: 8 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + commit: ~ + fixable: false location: row: 24 column: 8 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + commit: ~ + fixable: false location: row: 31 column: 34 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + commit: ~ + fixable: false location: row: 38 column: 4 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + commit: ~ + fixable: false location: row: 49 column: 4 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + commit: ~ + fixable: false location: row: 50 column: 8 @@ -75,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + commit: ~ + fixable: false location: row: 51 column: 8 @@ -87,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + commit: ~ + fixable: false location: row: 60 column: 4 @@ -99,9 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + commit: ~ + fixable: false location: row: 61 column: 8 @@ -111,9 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + commit: ~ + fixable: false location: row: 62 column: 8 @@ -123,9 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + commit: ~ + fixable: false location: row: 71 column: 4 @@ -135,9 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ParametrizeValuesWrongType: - values: tuple - row: tuple + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + commit: ~ + fixable: false location: row: 80 column: 30 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT008.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT008.snap index ba30b25889..2a2b4c83d5 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT008.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT008.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - PatchWithLambda: ~ + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + commit: ~ + fixable: false location: row: 35 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PatchWithLambda: ~ + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + commit: ~ + fixable: false location: row: 36 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PatchWithLambda: ~ + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + commit: ~ + fixable: false location: row: 37 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PatchWithLambda: ~ + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + commit: ~ + fixable: false location: row: 38 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PatchWithLambda: ~ + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + commit: ~ + fixable: false location: row: 40 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PatchWithLambda: ~ + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + commit: ~ + fixable: false location: row: 41 column: 0 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PatchWithLambda: ~ + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + commit: ~ + fixable: false location: row: 42 column: 0 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PatchWithLambda: ~ + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + commit: ~ + fixable: false location: row: 43 column: 0 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PatchWithLambda: ~ + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + commit: ~ + fixable: false location: row: 45 column: 0 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PatchWithLambda: ~ + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + commit: ~ + fixable: false location: row: 46 column: 0 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PatchWithLambda: ~ + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + commit: ~ + fixable: false location: row: 47 column: 0 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PatchWithLambda: ~ + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + commit: ~ + fixable: false location: row: 48 column: 0 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT009.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT009.snap index 9389e991fa..d61790f5eb 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT009.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT009.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - UnittestAssertion: - assertion: assertTrue - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + commit: "Replace `assertTrue(...)` with `assert ...`" + fixable: true location: row: 11 column: 8 @@ -22,9 +23,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - UnittestAssertion: - assertion: assertTrue - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + commit: "Replace `assertTrue(...)` with `assert ...`" + fixable: true location: row: 12 column: 8 @@ -41,9 +43,10 @@ expression: diagnostics column: 34 parent: ~ - kind: - UnittestAssertion: - assertion: assertTrue - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + commit: "Replace `assertTrue(...)` with `assert ...`" + fixable: true location: row: 13 column: 8 @@ -60,9 +63,10 @@ expression: diagnostics column: 34 parent: ~ - kind: - UnittestAssertion: - assertion: assertTrue - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + commit: "Replace `assertTrue(...)` with `assert ...`" + fixable: true location: row: 14 column: 8 @@ -79,9 +83,10 @@ expression: diagnostics column: 43 parent: ~ - kind: - UnittestAssertion: - assertion: assertTrue - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + commit: "Replace `assertTrue(...)` with `assert ...`" + fixable: true location: row: 15 column: 8 @@ -98,9 +103,10 @@ expression: diagnostics column: 43 parent: ~ - kind: - UnittestAssertion: - assertion: assertTrue - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + commit: "Replace `assertTrue(...)` with `assert ...`" + fixable: true location: row: 16 column: 8 @@ -110,9 +116,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnittestAssertion: - assertion: assertTrue - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + commit: "Replace `assertTrue(...)` with `assert ...`" + fixable: true location: row: 17 column: 8 @@ -122,9 +129,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnittestAssertion: - assertion: assertTrue - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + commit: "Replace `assertTrue(...)` with `assert ...`" + fixable: true location: row: 18 column: 8 @@ -134,9 +142,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnittestAssertion: - assertion: assertTrue - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + commit: "Replace `assertTrue(...)` with `assert ...`" + fixable: true location: row: 19 column: 8 @@ -146,9 +155,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnittestAssertion: - assertion: assertIsNotNone - fixable: false + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIsNotNone`" + commit: ~ + fixable: false location: row: 21 column: 12 @@ -158,9 +168,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnittestAssertion: - assertion: assertIsNone - fixable: false + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIsNone`" + commit: ~ + fixable: false location: row: 23 column: 17 @@ -170,9 +181,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnittestAssertion: - assertion: assertEqual - fixable: false + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertEqual`" + commit: ~ + fixable: false location: row: 25 column: 15 @@ -182,9 +194,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnittestAssertion: - assertion: assertFalse - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertFalse`" + commit: "Replace `assertFalse(...)` with `assert ...`" + fixable: true location: row: 28 column: 8 @@ -201,9 +214,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - UnittestAssertion: - assertion: assertEqual - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertEqual`" + commit: "Replace `assertEqual(...)` with `assert ...`" + fixable: true location: row: 31 column: 8 @@ -220,9 +234,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - UnittestAssertion: - assertion: assertNotEqual - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertNotEqual`" + commit: "Replace `assertNotEqual(...)` with `assert ...`" + fixable: true location: row: 34 column: 8 @@ -239,9 +254,10 @@ expression: diagnostics column: 33 parent: ~ - kind: - UnittestAssertion: - assertion: assertGreater - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertGreater`" + commit: "Replace `assertGreater(...)` with `assert ...`" + fixable: true location: row: 37 column: 8 @@ -258,9 +274,10 @@ expression: diagnostics column: 32 parent: ~ - kind: - UnittestAssertion: - assertion: assertGreaterEqual - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertGreaterEqual`" + commit: "Replace `assertGreaterEqual(...)` with `assert ...`" + fixable: true location: row: 40 column: 8 @@ -277,9 +294,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - UnittestAssertion: - assertion: assertLess - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertLess`" + commit: "Replace `assertLess(...)` with `assert ...`" + fixable: true location: row: 43 column: 8 @@ -296,9 +314,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - UnittestAssertion: - assertion: assertLessEqual - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertLessEqual`" + commit: "Replace `assertLessEqual(...)` with `assert ...`" + fixable: true location: row: 46 column: 8 @@ -315,9 +334,10 @@ expression: diagnostics column: 34 parent: ~ - kind: - UnittestAssertion: - assertion: assertIn - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIn`" + commit: "Replace `assertIn(...)` with `assert ...`" + fixable: true location: row: 49 column: 8 @@ -334,9 +354,10 @@ expression: diagnostics column: 32 parent: ~ - kind: - UnittestAssertion: - assertion: assertNotIn - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertNotIn`" + commit: "Replace `assertNotIn(...)` with `assert ...`" + fixable: true location: row: 52 column: 8 @@ -353,9 +374,10 @@ expression: diagnostics column: 35 parent: ~ - kind: - UnittestAssertion: - assertion: assertIsNone - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIsNone`" + commit: "Replace `assertIsNone(...)` with `assert ...`" + fixable: true location: row: 55 column: 8 @@ -372,9 +394,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - UnittestAssertion: - assertion: assertIsNotNone - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIsNotNone`" + commit: "Replace `assertIsNotNone(...)` with `assert ...`" + fixable: true location: row: 58 column: 8 @@ -391,9 +414,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - UnittestAssertion: - assertion: assertIs - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIs`" + commit: "Replace `assertIs(...)` with `assert ...`" + fixable: true location: row: 61 column: 8 @@ -410,9 +434,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - UnittestAssertion: - assertion: assertIsNot - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIsNot`" + commit: "Replace `assertIsNot(...)` with `assert ...`" + fixable: true location: row: 64 column: 8 @@ -429,9 +454,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - UnittestAssertion: - assertion: assertIsInstance - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIsInstance`" + commit: "Replace `assertIsInstance(...)` with `assert ...`" + fixable: true location: row: 67 column: 8 @@ -448,9 +474,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - UnittestAssertion: - assertion: assertNotIsInstance - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertNotIsInstance`" + commit: "Replace `assertNotIsInstance(...)` with `assert ...`" + fixable: true location: row: 70 column: 8 @@ -467,9 +494,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - UnittestAssertion: - assertion: assertRegex - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertRegex`" + commit: "Replace `assertRegex(...)` with `assert ...`" + fixable: true location: row: 73 column: 8 @@ -486,9 +514,10 @@ expression: diagnostics column: 39 parent: ~ - kind: - UnittestAssertion: - assertion: assertNotRegex - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertNotRegex`" + commit: "Replace `assertNotRegex(...)` with `assert ...`" + fixable: true location: row: 76 column: 8 @@ -505,9 +534,10 @@ expression: diagnostics column: 42 parent: ~ - kind: - UnittestAssertion: - assertion: assertRegexpMatches - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertRegexpMatches`" + commit: "Replace `assertRegexpMatches(...)` with `assert ...`" + fixable: true location: row: 79 column: 8 @@ -524,9 +554,10 @@ expression: diagnostics column: 47 parent: ~ - kind: - UnittestAssertion: - assertion: assertNotRegex - fixable: true + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertNotRegex`" + commit: "Replace `assertNotRegex(...)` with `assert ...`" + fixable: true location: row: 82 column: 8 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT010.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT010.snap index 268aed1f3d..2128254b4e 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT010.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT010.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - RaisesWithoutException: ~ + name: RaisesWithoutException + body: "set the expected exception in `pytest.raises()`" + commit: ~ + fixable: false location: row: 5 column: 9 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_default.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_default.snap index 0655ea0e8a..b3bd880242 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_default.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_default.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - RaisesTooBroad: - exception: ValueError + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + commit: ~ + fixable: false location: row: 17 column: 23 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesTooBroad: - exception: socket.error + name: RaisesTooBroad + body: "`pytest.raises(socket.error)` is too broad, set the `match` parameter or use a more specific exception" + commit: ~ + fixable: false location: row: 20 column: 23 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesTooBroad: - exception: ValueError + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + commit: ~ + fixable: false location: row: 25 column: 23 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesTooBroad: - exception: ValueError + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + commit: ~ + fixable: false location: row: 28 column: 23 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesTooBroad: - exception: ValueError + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + commit: ~ + fixable: false location: row: 31 column: 23 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_extend_broad_exceptions.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_extend_broad_exceptions.snap index ab16182655..9a9a6e462e 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_extend_broad_exceptions.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_extend_broad_exceptions.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - RaisesTooBroad: - exception: ZeroDivisionError + name: RaisesTooBroad + body: "`pytest.raises(ZeroDivisionError)` is too broad, set the `match` parameter or use a more specific exception" + commit: ~ + fixable: false location: row: 12 column: 23 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesTooBroad: - exception: ValueError + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + commit: ~ + fixable: false location: row: 17 column: 23 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesTooBroad: - exception: socket.error + name: RaisesTooBroad + body: "`pytest.raises(socket.error)` is too broad, set the `match` parameter or use a more specific exception" + commit: ~ + fixable: false location: row: 20 column: 23 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesTooBroad: - exception: ValueError + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + commit: ~ + fixable: false location: row: 25 column: 23 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesTooBroad: - exception: ValueError + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + commit: ~ + fixable: false location: row: 28 column: 23 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesTooBroad: - exception: ValueError + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + commit: ~ + fixable: false location: row: 31 column: 23 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_replace_broad_exceptions.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_replace_broad_exceptions.snap index 6ef607f0fc..2fb04340c6 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_replace_broad_exceptions.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_replace_broad_exceptions.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - RaisesTooBroad: - exception: ZeroDivisionError + name: RaisesTooBroad + body: "`pytest.raises(ZeroDivisionError)` is too broad, set the `match` parameter or use a more specific exception" + commit: ~ + fixable: false location: row: 12 column: 23 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT012.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT012.snap index dbe51a0f0f..0a6f90be53 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT012.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT012.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - RaisesWithMultipleStatements: ~ + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + commit: ~ + fixable: false location: row: 28 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesWithMultipleStatements: ~ + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + commit: ~ + fixable: false location: row: 34 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesWithMultipleStatements: ~ + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + commit: ~ + fixable: false location: row: 38 column: 4 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesWithMultipleStatements: ~ + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + commit: ~ + fixable: false location: row: 42 column: 4 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesWithMultipleStatements: ~ + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + commit: ~ + fixable: false location: row: 46 column: 4 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesWithMultipleStatements: ~ + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + commit: ~ + fixable: false location: row: 50 column: 4 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesWithMultipleStatements: ~ + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + commit: ~ + fixable: false location: row: 54 column: 4 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaisesWithMultipleStatements: ~ + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + commit: ~ + fixable: false location: row: 60 column: 4 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT013.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT013.snap index 57e0eac25d..471bcaa7ca 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT013.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT013.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - IncorrectPytestImport: ~ + name: IncorrectPytestImport + body: "Found incorrect import of pytest, use simple `import pytest` instead" + commit: ~ + fixable: false location: row: 11 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IncorrectPytestImport: ~ + name: IncorrectPytestImport + body: "Found incorrect import of pytest, use simple `import pytest` instead" + commit: ~ + fixable: false location: row: 12 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IncorrectPytestImport: ~ + name: IncorrectPytestImport + body: "Found incorrect import of pytest, use simple `import pytest` instead" + commit: ~ + fixable: false location: row: 13 column: 0 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT015.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT015.snap index ebcd1391f4..813f324d03 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT015.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT015.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 9 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 10 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 11 column: 4 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 12 column: 4 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 13 column: 4 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 14 column: 4 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 15 column: 4 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 16 column: 4 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 17 column: 4 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 18 column: 4 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 19 column: 4 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 20 column: 4 @@ -123,7 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 21 column: 4 @@ -133,7 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 22 column: 4 @@ -143,7 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 23 column: 4 @@ -153,7 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 24 column: 4 @@ -163,7 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertAlwaysFalse: ~ + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + commit: ~ + fixable: false location: row: 25 column: 4 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT016.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT016.snap index 5ad429f651..fbad15aa49 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT016.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT016.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - FailWithoutMessage: ~ + name: FailWithoutMessage + body: "No message passed to `pytest.fail()`" + commit: ~ + fixable: false location: row: 13 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FailWithoutMessage: ~ + name: FailWithoutMessage + body: "No message passed to `pytest.fail()`" + commit: ~ + fixable: false location: row: 14 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FailWithoutMessage: ~ + name: FailWithoutMessage + body: "No message passed to `pytest.fail()`" + commit: ~ + fixable: false location: row: 15 column: 4 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FailWithoutMessage: ~ + name: FailWithoutMessage + body: "No message passed to `pytest.fail()`" + commit: ~ + fixable: false location: row: 16 column: 4 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FailWithoutMessage: ~ + name: FailWithoutMessage + body: "No message passed to `pytest.fail()`" + commit: ~ + fixable: false location: row: 17 column: 4 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT017.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT017.snap index fbdd7e96bc..c28d042fb1 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT017.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT017.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - AssertInExcept: - name: e + name: AssertInExcept + body: "Found assertion on exception `e` in `except` block, use `pytest.raises()` instead" + commit: ~ + fixable: false location: row: 19 column: 8 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT018.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT018.snap index 3cfde0ccf9..3c0406174a 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT018.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT018.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - CompositeAssertion: - fixable: true + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + commit: Break down assertion into multiple parts + fixable: true location: row: 14 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CompositeAssertion: - fixable: true + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + commit: Break down assertion into multiple parts + fixable: true location: row: 15 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CompositeAssertion: - fixable: true + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + commit: Break down assertion into multiple parts + fixable: true location: row: 16 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CompositeAssertion: - fixable: true + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + commit: Break down assertion into multiple parts + fixable: true location: row: 17 column: 4 @@ -75,8 +83,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CompositeAssertion: - fixable: true + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + commit: Break down assertion into multiple parts + fixable: true location: row: 18 column: 4 @@ -93,8 +103,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CompositeAssertion: - fixable: true + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + commit: Break down assertion into multiple parts + fixable: true location: row: 19 column: 4 @@ -111,8 +123,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CompositeAssertion: - fixable: true + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + commit: Break down assertion into multiple parts + fixable: true location: row: 20 column: 4 @@ -129,8 +143,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CompositeAssertion: - fixable: true + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + commit: Break down assertion into multiple parts + fixable: true location: row: 21 column: 4 @@ -147,8 +163,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CompositeAssertion: - fixable: true + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + commit: Break down assertion into multiple parts + fixable: true location: row: 26 column: 4 @@ -165,8 +183,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CompositeAssertion: - fixable: true + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + commit: Break down assertion into multiple parts + fixable: true location: row: 27 column: 4 @@ -183,8 +203,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CompositeAssertion: - fixable: false + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + commit: ~ + fixable: false location: row: 30 column: 4 @@ -194,8 +216,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CompositeAssertion: - fixable: false + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + commit: ~ + fixable: false location: row: 31 column: 4 @@ -205,8 +229,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CompositeAssertion: - fixable: false + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + commit: ~ + fixable: false location: row: 33 column: 4 @@ -216,8 +242,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CompositeAssertion: - fixable: true + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + commit: Break down assertion into multiple parts + fixable: true location: row: 35 column: 4 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT019.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT019.snap index 38f58cf1ee..32e7cbf289 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT019.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT019.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - FixtureParamWithoutValue: - name: _fixture + name: FixtureParamWithoutValue + body: "Fixture `_fixture` without value is injected as parameter, use `@pytest.mark.usefixtures` instead" + commit: ~ + fixable: false location: row: 9 column: 13 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FixtureParamWithoutValue: - name: _fixture + name: FixtureParamWithoutValue + body: "Fixture `_fixture` without value is injected as parameter, use `@pytest.mark.usefixtures` instead" + commit: ~ + fixable: false location: row: 13 column: 16 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT020.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT020.snap index ff9db9b85a..ddba532e16 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT020.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT020.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - DeprecatedYieldFixture: ~ + name: DeprecatedYieldFixture + body: "`@pytest.yield_fixture` is deprecated, use `@pytest.fixture`" + commit: ~ + fixable: false location: row: 14 column: 1 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DeprecatedYieldFixture: ~ + name: DeprecatedYieldFixture + body: "`@pytest.yield_fixture` is deprecated, use `@pytest.fixture`" + commit: ~ + fixable: false location: row: 19 column: 1 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT021.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT021.snap index 76e5520c8a..2bb45e84cd 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT021.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT021.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_pytest_style/mod.rs +source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - FixtureFinalizerCallback: ~ + name: FixtureFinalizerCallback + body: "Use `yield` instead of `request.addfinalizer`" + commit: ~ + fixable: false location: row: 49 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FixtureFinalizerCallback: ~ + name: FixtureFinalizerCallback + body: "Use `yield` instead of `request.addfinalizer`" + commit: ~ + fixable: false location: row: 56 column: 4 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT022.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT022.snap index 015daac6d6..eabf27305e 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT022.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT022.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - UselessYieldFixture: - name: error + name: UselessYieldFixture + body: "No teardown in fixture `error`, use `return` instead of `yield`" + commit: "Replace `yield` with `return`" + fixable: true location: row: 17 column: 4 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_default.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_default.snap index 712c313caa..bc1206c032 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_default.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_default.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - IncorrectMarkParenthesesStyle: - mark_name: foo - expected_parens: () - actual_parens: "" + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" + commit: Add/remove parentheses + fixable: true location: row: 12 column: 1 @@ -23,10 +23,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - IncorrectMarkParenthesesStyle: - mark_name: foo - expected_parens: () - actual_parens: "" + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" + commit: Add/remove parentheses + fixable: true location: row: 17 column: 1 @@ -43,10 +43,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - IncorrectMarkParenthesesStyle: - mark_name: foo - expected_parens: () - actual_parens: "" + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" + commit: Add/remove parentheses + fixable: true location: row: 24 column: 5 @@ -63,10 +63,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - IncorrectMarkParenthesesStyle: - mark_name: foo - expected_parens: () - actual_parens: "" + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" + commit: Add/remove parentheses + fixable: true location: row: 30 column: 5 @@ -83,10 +83,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - IncorrectMarkParenthesesStyle: - mark_name: foo - expected_parens: () - actual_parens: "" + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" + commit: Add/remove parentheses + fixable: true location: row: 38 column: 9 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_no_parentheses.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_no_parentheses.snap index 4d892e7c37..ef33273d09 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_no_parentheses.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_no_parentheses.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - IncorrectMarkParenthesesStyle: - mark_name: foo - expected_parens: "" - actual_parens: () + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" + commit: Add/remove parentheses + fixable: true location: row: 46 column: 1 @@ -23,10 +23,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - IncorrectMarkParenthesesStyle: - mark_name: foo - expected_parens: "" - actual_parens: () + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" + commit: Add/remove parentheses + fixable: true location: row: 51 column: 1 @@ -43,10 +43,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - IncorrectMarkParenthesesStyle: - mark_name: foo - expected_parens: "" - actual_parens: () + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" + commit: Add/remove parentheses + fixable: true location: row: 58 column: 5 @@ -63,10 +63,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - IncorrectMarkParenthesesStyle: - mark_name: foo - expected_parens: "" - actual_parens: () + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" + commit: Add/remove parentheses + fixable: true location: row: 64 column: 5 @@ -83,10 +83,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - IncorrectMarkParenthesesStyle: - mark_name: foo - expected_parens: "" - actual_parens: () + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" + commit: Add/remove parentheses + fixable: true location: row: 72 column: 9 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT024.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT024.snap index 99b1358e21..98bcc420e4 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT024.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT024.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - UnnecessaryAsyncioMarkOnFixture: ~ + name: UnnecessaryAsyncioMarkOnFixture + body: "`pytest.mark.asyncio` is unnecessary for fixtures" + commit: "Remove `pytest.mark.asyncio`" + fixable: true location: row: 14 column: 1 @@ -20,7 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryAsyncioMarkOnFixture: ~ + name: UnnecessaryAsyncioMarkOnFixture + body: "`pytest.mark.asyncio` is unnecessary for fixtures" + commit: "Remove `pytest.mark.asyncio`" + fixable: true location: row: 20 column: 1 @@ -37,7 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryAsyncioMarkOnFixture: ~ + name: UnnecessaryAsyncioMarkOnFixture + body: "`pytest.mark.asyncio` is unnecessary for fixtures" + commit: "Remove `pytest.mark.asyncio`" + fixable: true location: row: 27 column: 1 @@ -54,7 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryAsyncioMarkOnFixture: ~ + name: UnnecessaryAsyncioMarkOnFixture + body: "`pytest.mark.asyncio` is unnecessary for fixtures" + commit: "Remove `pytest.mark.asyncio`" + fixable: true location: row: 33 column: 1 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT025.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT025.snap index 83049646a4..e0fbe46ed3 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT025.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT025.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - ErroneousUseFixturesOnFixture: ~ + name: ErroneousUseFixturesOnFixture + body: "`pytest.mark.usefixtures` has no effect on fixtures" + commit: "Remove `pytest.mark.usefixtures`" + fixable: true location: row: 9 column: 1 @@ -20,7 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - ErroneousUseFixturesOnFixture: ~ + name: ErroneousUseFixturesOnFixture + body: "`pytest.mark.usefixtures` has no effect on fixtures" + commit: "Remove `pytest.mark.usefixtures`" + fixable: true location: row: 16 column: 1 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT026.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT026.snap index b46afbd28b..fa6737f111 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT026.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT026.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- - kind: - UseFixturesWithoutParameters: ~ + name: UseFixturesWithoutParameters + body: "Useless `pytest.mark.usefixtures` without parameters" + commit: "Remove `usefixtures` decorator or pass parameters" + fixable: true location: row: 19 column: 1 @@ -20,7 +23,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - UseFixturesWithoutParameters: ~ + name: UseFixturesWithoutParameters + body: "Useless `pytest.mark.usefixtures` without parameters" + commit: "Remove `usefixtures` decorator or pass parameters" + fixable: true location: row: 24 column: 1 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap index 534a6af516..ec9273cc88 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 5 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 3 parent: ~ - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 16 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 21 column: 20 @@ -57,8 +63,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 30 column: 8 @@ -75,8 +83,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 35 column: 12 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap index 1ac2733d7b..f0b336ddda 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 3 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 5 column: 22 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap index 8d9c66f7c6..92e48ffa23 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 3 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 11 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 15 column: 38 @@ -57,8 +63,10 @@ expression: diagnostics column: 3 parent: ~ - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 17 column: 4 @@ -75,8 +83,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 22 column: 4 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap index 3bc1e04316..c60805a4f3 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 4 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 3 parent: ~ - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap index 06247b3663..bd7c353f11 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 2 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 6 column: 0 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap index 0a15cbdb24..66f586e986 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesDocstring: - quote: double + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + commit: Replace single quotes docstring with double quotes + fixable: true location: row: 1 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 3 parent: ~ - kind: - BadQuotesDocstring: - quote: double + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + commit: Replace single quotes docstring with double quotes + fixable: true location: row: 14 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - BadQuotesDocstring: - quote: double + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + commit: Replace single quotes docstring with double quotes + fixable: true location: row: 26 column: 8 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap index 4da2b1336b..894ab4fad1 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesDocstring: - quote: double + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + commit: Replace single quotes docstring with double quotes + fixable: true location: row: 2 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 53 parent: ~ - kind: - BadQuotesDocstring: - quote: double + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + commit: Replace single quotes docstring with double quotes + fixable: true location: row: 6 column: 8 @@ -39,8 +43,10 @@ expression: diagnostics column: 57 parent: ~ - kind: - BadQuotesDocstring: - quote: double + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + commit: Replace single quotes docstring with double quotes + fixable: true location: row: 9 column: 28 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap index 08c01b1922..5f80eedd78 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesDocstring: - quote: double + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + commit: Replace single quotes docstring with double quotes + fixable: true location: row: 2 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 56 parent: ~ - kind: - BadQuotesDocstring: - quote: double + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + commit: Replace single quotes docstring with double quotes + fixable: true location: row: 8 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - BadQuotesDocstring: - quote: double + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + commit: Replace single quotes docstring with double quotes + fixable: true location: row: 27 column: 4 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap index 4115e98c37..43e5d0daf7 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesDocstring: - quote: double + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + commit: Replace single quotes docstring with double quotes + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap index 6e2497a1f8..2b5ac33c07 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesDocstring: - quote: double + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + commit: Replace single quotes docstring with double quotes + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap index a19e53c8a0..78876fad33 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesDocstring: - quote: single + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + commit: Replace double quotes docstring with single quotes + fixable: true location: row: 1 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 3 parent: ~ - kind: - BadQuotesDocstring: - quote: single + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + commit: Replace double quotes docstring with single quotes + fixable: true location: row: 12 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - BadQuotesDocstring: - quote: single + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + commit: Replace double quotes docstring with single quotes + fixable: true location: row: 24 column: 8 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap index 44491c9f6f..338c8b395e 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesDocstring: - quote: single + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + commit: Replace double quotes docstring with single quotes + fixable: true location: row: 2 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 53 parent: ~ - kind: - BadQuotesDocstring: - quote: single + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + commit: Replace double quotes docstring with single quotes + fixable: true location: row: 6 column: 8 @@ -39,8 +43,10 @@ expression: diagnostics column: 57 parent: ~ - kind: - BadQuotesDocstring: - quote: single + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + commit: Replace double quotes docstring with single quotes + fixable: true location: row: 9 column: 28 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap index 6b3808fada..74bf4e2ab6 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesDocstring: - quote: single + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + commit: Replace double quotes docstring with single quotes + fixable: true location: row: 2 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 56 parent: ~ - kind: - BadQuotesDocstring: - quote: single + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + commit: Replace double quotes docstring with single quotes + fixable: true location: row: 8 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - BadQuotesDocstring: - quote: single + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + commit: Replace double quotes docstring with single quotes + fixable: true location: row: 27 column: 4 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap index 7554c8f5b2..0e212accda 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesDocstring: - quote: single + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + commit: Replace double quotes docstring with single quotes + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap index 812900e5d2..88871fac54 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesDocstring: - quote: single + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + commit: Replace double quotes docstring with single quotes + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap index 31dd08bffd..c393566075 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 5 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 3 parent: ~ - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 11 column: 20 @@ -39,8 +43,10 @@ expression: diagnostics column: 3 parent: ~ - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 18 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 23 column: 20 @@ -75,8 +83,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 32 column: 8 @@ -93,8 +103,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 37 column: 12 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap index c31ce94b7f..28643ac922 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 3 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 5 column: 22 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap index 10fc5ae380..b94ddf8268 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 3 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 11 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 15 column: 38 @@ -57,8 +63,10 @@ expression: diagnostics column: 3 parent: ~ - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 17 column: 4 @@ -75,8 +83,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 22 column: 4 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap index d8b3e55378..f7f25947be 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 4 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 3 parent: ~ - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap index 2a971926d0..42ac02b404 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 2 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 6 column: 0 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap index f4adff17f4..31cc5a45a2 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesInlineString: - quote: double + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + commit: Replace single quotes with double quotes + fixable: true location: row: 1 column: 24 @@ -21,8 +23,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - BadQuotesInlineString: - quote: double + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + commit: Replace single quotes with double quotes + fixable: true location: row: 2 column: 24 @@ -39,8 +43,10 @@ expression: diagnostics column: 46 parent: ~ - kind: - BadQuotesInlineString: - quote: double + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + commit: Replace single quotes with double quotes + fixable: true location: row: 3 column: 24 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap index 8abf62ca72..cb8e953179 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - AvoidableEscapedQuote: ~ + name: AvoidableEscapedQuote + body: Change outer quotes to avoid escaping inner quotes + commit: Change outer quotes to avoid escaping inner quotes + fixable: true location: row: 1 column: 25 @@ -20,7 +23,10 @@ expression: diagnostics column: 47 parent: ~ - kind: - AvoidableEscapedQuote: ~ + name: AvoidableEscapedQuote + body: Change outer quotes to avoid escaping inner quotes + commit: Change outer quotes to avoid escaping inner quotes + fixable: true location: row: 9 column: 4 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap index a8846bd8f9..da89379548 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesInlineString: - quote: double + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + commit: Replace single quotes with double quotes + fixable: true location: row: 2 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - BadQuotesInlineString: - quote: double + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + commit: Replace single quotes with double quotes + fixable: true location: row: 3 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - BadQuotesInlineString: - quote: double + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + commit: Replace single quotes with double quotes + fixable: true location: row: 4 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - BadQuotesInlineString: - quote: double + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + commit: Replace single quotes with double quotes + fixable: true location: row: 8 column: 4 @@ -75,8 +83,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - BadQuotesInlineString: - quote: double + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + commit: Replace single quotes with double quotes + fixable: true location: row: 9 column: 4 @@ -93,8 +103,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - BadQuotesInlineString: - quote: double + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + commit: Replace single quotes with double quotes + fixable: true location: row: 10 column: 4 @@ -111,8 +123,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - BadQuotesInlineString: - quote: double + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + commit: Replace single quotes with double quotes + fixable: true location: row: 27 column: 0 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap index 8aa0f737ef..774dd3f1dd 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesMultilineString: - quote: double + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + commit: Replace single multiline quotes with double quotes + fixable: true location: row: 1 column: 4 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap index d4b082be31..aa5cf99d3f 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesInlineString: - quote: single + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + commit: Replace double quotes with single quotes + fixable: true location: row: 1 column: 24 @@ -21,8 +23,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - BadQuotesInlineString: - quote: single + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + commit: Replace double quotes with single quotes + fixable: true location: row: 2 column: 24 @@ -39,8 +43,10 @@ expression: diagnostics column: 46 parent: ~ - kind: - BadQuotesInlineString: - quote: single + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + commit: Replace double quotes with single quotes + fixable: true location: row: 3 column: 24 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap index 7e1e8673f8..fc2a8e3088 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - AvoidableEscapedQuote: ~ + name: AvoidableEscapedQuote + body: Change outer quotes to avoid escaping inner quotes + commit: Change outer quotes to avoid escaping inner quotes + fixable: true location: row: 1 column: 25 @@ -20,7 +23,10 @@ expression: diagnostics column: 47 parent: ~ - kind: - AvoidableEscapedQuote: ~ + name: AvoidableEscapedQuote + body: Change outer quotes to avoid escaping inner quotes + commit: Change outer quotes to avoid escaping inner quotes + fixable: true location: row: 2 column: 25 @@ -37,7 +43,10 @@ expression: diagnostics column: 52 parent: ~ - kind: - AvoidableEscapedQuote: ~ + name: AvoidableEscapedQuote + body: Change outer quotes to avoid escaping inner quotes + commit: Change outer quotes to avoid escaping inner quotes + fixable: true location: row: 10 column: 4 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap index d0620e2dbb..9da48b8d39 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesInlineString: - quote: single + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + commit: Replace double quotes with single quotes + fixable: true location: row: 2 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - BadQuotesInlineString: - quote: single + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + commit: Replace double quotes with single quotes + fixable: true location: row: 3 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - BadQuotesInlineString: - quote: single + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + commit: Replace double quotes with single quotes + fixable: true location: row: 4 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - BadQuotesInlineString: - quote: single + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + commit: Replace double quotes with single quotes + fixable: true location: row: 8 column: 4 @@ -75,8 +83,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - BadQuotesInlineString: - quote: single + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + commit: Replace double quotes with single quotes + fixable: true location: row: 9 column: 4 @@ -93,8 +103,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - BadQuotesInlineString: - quote: single + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + commit: Replace double quotes with single quotes + fixable: true location: row: 10 column: 4 @@ -111,8 +123,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - BadQuotesInlineString: - quote: single + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + commit: Replace double quotes with single quotes + fixable: true location: row: 27 column: 0 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap index b96fa6ab1c..b120e8f768 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- - kind: - BadQuotesMultilineString: - quote: single + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + commit: Replace double multiline quotes with single quotes + fixable: true location: row: 1 column: 4 diff --git a/crates/ruff/src/rules/flake8_raise/rules/unnecessary_paren_on_raise_exception.rs b/crates/ruff/src/rules/flake8_raise/rules/unnecessary_paren_on_raise_exception.rs index 9f4f299d61..1f450d8058 100644 --- a/crates/ruff/src/rules/flake8_raise/rules/unnecessary_paren_on_raise_exception.rs +++ b/crates/ruff/src/rules/flake8_raise/rules/unnecessary_paren_on_raise_exception.rs @@ -5,7 +5,7 @@ use ruff_python_ast::helpers::match_parens; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/flake8_raise/snapshots/ruff__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap b/crates/ruff/src/rules/flake8_raise/snapshots/ruff__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap index 3166f31b9d..2e563f2616 100644 --- a/crates/ruff/src/rules/flake8_raise/snapshots/ruff__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap +++ b/crates/ruff/src/rules/flake8_raise/snapshots/ruff__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_raise/mod.rs expression: diagnostics --- - kind: - UnnecessaryParenOnRaiseException: ~ + name: UnnecessaryParenOnRaiseException + body: Unnecessary parentheses on raised exception + commit: Remove unnecessary parentheses + fixable: true location: row: 5 column: 20 @@ -20,7 +23,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - UnnecessaryParenOnRaiseException: ~ + name: UnnecessaryParenOnRaiseException + body: Unnecessary parentheses on raised exception + commit: Remove unnecessary parentheses + fixable: true location: row: 13 column: 15 @@ -37,7 +43,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - UnnecessaryParenOnRaiseException: ~ + name: UnnecessaryParenOnRaiseException + body: Unnecessary parentheses on raised exception + commit: Remove unnecessary parentheses + fixable: true location: row: 16 column: 16 @@ -54,7 +63,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - UnnecessaryParenOnRaiseException: ~ + name: UnnecessaryParenOnRaiseException + body: Unnecessary parentheses on raised exception + commit: Remove unnecessary parentheses + fixable: true location: row: 20 column: 4 @@ -71,7 +83,10 @@ expression: diagnostics column: 6 parent: ~ - kind: - UnnecessaryParenOnRaiseException: ~ + name: UnnecessaryParenOnRaiseException + body: Unnecessary parentheses on raised exception + commit: Remove unnecessary parentheses + fixable: true location: row: 23 column: 15 @@ -88,7 +103,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UnnecessaryParenOnRaiseException: ~ + name: UnnecessaryParenOnRaiseException + body: Unnecessary parentheses on raised exception + commit: Remove unnecessary parentheses + fixable: true location: row: 28 column: 15 diff --git a/crates/ruff/src/rules/flake8_return/rules.rs b/crates/ruff/src/rules/flake8_return/rules.rs index 8af8751002..c533ba0b73 100644 --- a/crates/ruff/src/rules/flake8_return/rules.rs +++ b/crates/ruff/src/rules/flake8_return/rules.rs @@ -9,7 +9,7 @@ use ruff_python_ast::whitespace::indentation; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::violation::{AlwaysAutofixableViolation, Violation}; use super::branch::Branch; diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET501_RET501.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET501_RET501.py.snap index 531888d98f..1e4920aff4 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET501_RET501.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET501_RET501.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- - kind: - UnnecessaryReturnNone: ~ + name: UnnecessaryReturnNone + body: "Do not explicitly `return None` in function if it is the only possible return value" + commit: "Remove explicit `return None`" + fixable: true location: row: 4 column: 4 diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET502_RET502.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET502_RET502.py.snap index 802ecbba8b..0a94683c2a 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET502_RET502.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET502_RET502.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- - kind: - ImplicitReturnValue: ~ + name: ImplicitReturnValue + body: "Do not implicitly `return None` in function able to return non-`None` value" + commit: "Add explicit `None` return value" + fixable: true location: row: 3 column: 8 diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET503_RET503.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET503_RET503.py.snap index c53ef9a949..4c182800a4 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET503_RET503.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET503_RET503.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 20 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 27 column: 8 @@ -37,7 +43,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 36 column: 4 @@ -54,7 +63,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 41 column: 4 @@ -71,7 +83,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 52 column: 8 @@ -88,7 +103,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 59 column: 4 @@ -105,7 +123,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 66 column: 4 @@ -122,7 +143,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 82 column: 4 @@ -139,7 +163,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 113 column: 4 @@ -156,7 +183,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 120 column: 4 @@ -173,7 +203,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 130 column: 4 @@ -190,7 +223,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 137 column: 4 @@ -207,7 +243,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 274 column: 4 @@ -224,7 +263,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 291 column: 12 @@ -241,7 +283,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 300 column: 8 @@ -258,7 +303,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 305 column: 8 @@ -275,7 +323,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 310 column: 8 @@ -292,7 +343,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 315 column: 8 @@ -309,7 +363,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - ImplicitReturn: ~ + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + commit: "Add explicit `return` statement" + fixable: true location: row: 320 column: 8 diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET504_RET504.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET504_RET504.py.snap index 8b9969a243..1b001d852a 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET504_RET504.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET504_RET504.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_return/mod.rs +source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- - kind: - UnnecessaryAssign: ~ + name: UnnecessaryAssign + body: "Unnecessary variable assignment before `return` statement" + commit: ~ + fixable: false location: row: 6 column: 11 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessaryAssign: ~ + name: UnnecessaryAssign + body: "Unnecessary variable assignment before `return` statement" + commit: ~ + fixable: false location: row: 13 column: 11 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessaryAssign: ~ + name: UnnecessaryAssign + body: "Unnecessary variable assignment before `return` statement" + commit: ~ + fixable: false location: row: 19 column: 15 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessaryAssign: ~ + name: UnnecessaryAssign + body: "Unnecessary variable assignment before `return` statement" + commit: ~ + fixable: false location: row: 31 column: 11 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessaryAssign: ~ + name: UnnecessaryAssign + body: "Unnecessary variable assignment before `return` statement" + commit: ~ + fixable: false location: row: 39 column: 11 diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET505_RET505.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET505_RET505.py.snap index 5bafa9e6ec..03a03f826d 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET505_RET505.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET505_RET505.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_return/mod.rs +source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- - kind: - SuperfluousElseReturn: - branch: Elif + name: SuperfluousElseReturn + body: "Unnecessary `elif` after `return` statement" + commit: ~ + fixable: false location: row: 8 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseReturn: - branch: Elif + name: SuperfluousElseReturn + body: "Unnecessary `elif` after `return` statement" + commit: ~ + fixable: false location: row: 23 column: 4 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseReturn: - branch: Elif + name: SuperfluousElseReturn + body: "Unnecessary `elif` after `return` statement" + commit: ~ + fixable: false location: row: 41 column: 4 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseReturn: - branch: Else + name: SuperfluousElseReturn + body: "Unnecessary `else` after `return` statement" + commit: ~ + fixable: false location: row: 53 column: 4 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseReturn: - branch: Else + name: SuperfluousElseReturn + body: "Unnecessary `else` after `return` statement" + commit: ~ + fixable: false location: row: 64 column: 8 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseReturn: - branch: Else + name: SuperfluousElseReturn + body: "Unnecessary `else` after `return` statement" + commit: ~ + fixable: false location: row: 79 column: 4 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseReturn: - branch: Else + name: SuperfluousElseReturn + body: "Unnecessary `else` after `return` statement" + commit: ~ + fixable: false location: row: 89 column: 8 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseReturn: - branch: Else + name: SuperfluousElseReturn + body: "Unnecessary `else` after `return` statement" + commit: ~ + fixable: false location: row: 99 column: 4 diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET506_RET506.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET506_RET506.py.snap index bb03c93e94..7719e07936 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET506_RET506.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET506_RET506.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_return/mod.rs +source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- - kind: - SuperfluousElseRaise: - branch: Elif + name: SuperfluousElseRaise + body: "Unnecessary `elif` after `raise` statement" + commit: ~ + fixable: false location: row: 8 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseRaise: - branch: Elif + name: SuperfluousElseRaise + body: "Unnecessary `elif` after `raise` statement" + commit: ~ + fixable: false location: row: 23 column: 4 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseRaise: - branch: Else + name: SuperfluousElseRaise + body: "Unnecessary `else` after `raise` statement" + commit: ~ + fixable: false location: row: 34 column: 4 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseRaise: - branch: Else + name: SuperfluousElseRaise + body: "Unnecessary `else` after `raise` statement" + commit: ~ + fixable: false location: row: 45 column: 8 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseRaise: - branch: Else + name: SuperfluousElseRaise + body: "Unnecessary `else` after `raise` statement" + commit: ~ + fixable: false location: row: 60 column: 4 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseRaise: - branch: Else + name: SuperfluousElseRaise + body: "Unnecessary `else` after `raise` statement" + commit: ~ + fixable: false location: row: 70 column: 8 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseRaise: - branch: Else + name: SuperfluousElseRaise + body: "Unnecessary `else` after `raise` statement" + commit: ~ + fixable: false location: row: 80 column: 4 diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET507_RET507.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET507_RET507.py.snap index 5205e8a7ae..d5596e8ad5 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET507_RET507.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET507_RET507.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_return/mod.rs +source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- - kind: - SuperfluousElseContinue: - branch: Elif + name: SuperfluousElseContinue + body: "Unnecessary `elif` after `continue` statement" + commit: ~ + fixable: false location: row: 8 column: 8 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseContinue: - branch: Elif + name: SuperfluousElseContinue + body: "Unnecessary `elif` after `continue` statement" + commit: ~ + fixable: false location: row: 22 column: 8 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseContinue: - branch: Else + name: SuperfluousElseContinue + body: "Unnecessary `else` after `continue` statement" + commit: ~ + fixable: false location: row: 36 column: 8 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseContinue: - branch: Else + name: SuperfluousElseContinue + body: "Unnecessary `else` after `continue` statement" + commit: ~ + fixable: false location: row: 47 column: 12 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseContinue: - branch: Else + name: SuperfluousElseContinue + body: "Unnecessary `else` after `continue` statement" + commit: ~ + fixable: false location: row: 63 column: 8 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseContinue: - branch: Else + name: SuperfluousElseContinue + body: "Unnecessary `else` after `continue` statement" + commit: ~ + fixable: false location: row: 74 column: 12 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseContinue: - branch: Else + name: SuperfluousElseContinue + body: "Unnecessary `else` after `continue` statement" + commit: ~ + fixable: false location: row: 85 column: 8 diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET508_RET508.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET508_RET508.py.snap index 01abf24242..98728677d4 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET508_RET508.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET508_RET508.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_return/mod.rs +source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- - kind: - SuperfluousElseBreak: - branch: Elif + name: SuperfluousElseBreak + body: "Unnecessary `elif` after `break` statement" + commit: ~ + fixable: false location: row: 8 column: 8 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseBreak: - branch: Elif + name: SuperfluousElseBreak + body: "Unnecessary `elif` after `break` statement" + commit: ~ + fixable: false location: row: 22 column: 8 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseBreak: - branch: Else + name: SuperfluousElseBreak + body: "Unnecessary `else` after `break` statement" + commit: ~ + fixable: false location: row: 33 column: 8 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseBreak: - branch: Else + name: SuperfluousElseBreak + body: "Unnecessary `else` after `break` statement" + commit: ~ + fixable: false location: row: 44 column: 12 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseBreak: - branch: Else + name: SuperfluousElseBreak + body: "Unnecessary `else` after `break` statement" + commit: ~ + fixable: false location: row: 60 column: 8 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseBreak: - branch: Else + name: SuperfluousElseBreak + body: "Unnecessary `else` after `break` statement" + commit: ~ + fixable: false location: row: 71 column: 12 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - SuperfluousElseBreak: - branch: Else + name: SuperfluousElseBreak + body: "Unnecessary `else` after `break` statement" + commit: ~ + fixable: false location: row: 82 column: 8 diff --git a/crates/ruff/src/rules/flake8_self/snapshots/ruff__rules__flake8_self__tests__private-member-access_SLF001.py.snap b/crates/ruff/src/rules/flake8_self/snapshots/ruff__rules__flake8_self__tests__private-member-access_SLF001.py.snap index 2f2f1bbf88..3a01c16d64 100644 --- a/crates/ruff/src/rules/flake8_self/snapshots/ruff__rules__flake8_self__tests__private-member-access_SLF001.py.snap +++ b/crates/ruff/src/rules/flake8_self/snapshots/ruff__rules__flake8_self__tests__private-member-access_SLF001.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_self/mod.rs expression: diagnostics --- - kind: - PrivateMemberAccess: - access: _private + name: PrivateMemberAccess + body: "Private member accessed: `_private`" + commit: ~ + fixable: false location: row: 34 column: 11 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrivateMemberAccess: - access: _private + name: PrivateMemberAccess + body: "Private member accessed: `_private`" + commit: ~ + fixable: false location: row: 36 column: 11 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrivateMemberAccess: - access: _private_thing + name: PrivateMemberAccess + body: "Private member accessed: `_private_thing`" + commit: ~ + fixable: false location: row: 38 column: 11 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrivateMemberAccess: - access: _private_thing + name: PrivateMemberAccess + body: "Private member accessed: `_private_thing`" + commit: ~ + fixable: false location: row: 43 column: 11 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrivateMemberAccess: - access: _private_thing + name: PrivateMemberAccess + body: "Private member accessed: `_private_thing`" + commit: ~ + fixable: false location: row: 59 column: 6 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrivateMemberAccess: - access: __really_private_thing + name: PrivateMemberAccess + body: "Private member accessed: `__really_private_thing`" + commit: ~ + fixable: false location: row: 60 column: 6 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrivateMemberAccess: - access: _private_func + name: PrivateMemberAccess + body: "Private member accessed: `_private_func`" + commit: ~ + fixable: false location: row: 61 column: 6 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrivateMemberAccess: - access: __really_private_func + name: PrivateMemberAccess + body: "Private member accessed: `__really_private_func`" + commit: ~ + fixable: false location: row: 62 column: 6 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrivateMemberAccess: - access: _private + name: PrivateMemberAccess + body: "Private member accessed: `_private`" + commit: ~ + fixable: false location: row: 63 column: 6 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrivateMemberAccess: - access: _private_thing + name: PrivateMemberAccess + body: "Private member accessed: `_private_thing`" + commit: ~ + fixable: false location: row: 64 column: 6 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PrivateMemberAccess: - access: _private_thing__ + name: PrivateMemberAccess + body: "Private member accessed: `_private_thing__`" + commit: ~ + fixable: false location: row: 65 column: 6 diff --git a/crates/ruff/src/rules/flake8_simplify/rules/ast_bool_op.rs b/crates/ruff/src/rules/flake8_simplify/rules/ast_bool_op.rs index a54d4e5c43..97373764ea 100644 --- a/crates/ruff/src/rules/flake8_simplify/rules/ast_bool_op.rs +++ b/crates/ruff/src/rules/flake8_simplify/rules/ast_bool_op.rs @@ -10,7 +10,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; /// ## What it does diff --git a/crates/ruff/src/rules/flake8_simplify/rules/ast_expr.rs b/crates/ruff/src/rules/flake8_simplify/rules/ast_expr.rs index b33b22d18f..4c8c9687d1 100644 --- a/crates/ruff/src/rules/flake8_simplify/rules/ast_expr.rs +++ b/crates/ruff/src/rules/flake8_simplify/rules/ast_expr.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/flake8_simplify/rules/ast_if.rs b/crates/ruff/src/rules/flake8_simplify/rules/ast_if.rs index cae64c0ccc..2507e90846 100644 --- a/crates/ruff/src/rules/flake8_simplify/rules/ast_if.rs +++ b/crates/ruff/src/rules/flake8_simplify/rules/ast_if.rs @@ -12,7 +12,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::flake8_simplify::rules::fix_if; use crate::violation::{AutofixKind, Availability, Violation}; diff --git a/crates/ruff/src/rules/flake8_simplify/rules/ast_ifexp.rs b/crates/ruff/src/rules/flake8_simplify/rules/ast_ifexp.rs index 568cc08a19..c8a8aaab31 100644 --- a/crates/ruff/src/rules/flake8_simplify/rules/ast_ifexp.rs +++ b/crates/ruff/src/rules/flake8_simplify/rules/ast_ifexp.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/flake8_simplify/rules/ast_unary_op.rs b/crates/ruff/src/rules/flake8_simplify/rules/ast_unary_op.rs index 3f09782939..907f8f3822 100644 --- a/crates/ruff/src/rules/flake8_simplify/rules/ast_unary_op.rs +++ b/crates/ruff/src/rules/flake8_simplify/rules/ast_unary_op.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::{Range, ScopeKind}; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/flake8_simplify/rules/ast_with.rs b/crates/ruff/src/rules/flake8_simplify/rules/ast_with.rs index 378dda02f9..00d01e9160 100644 --- a/crates/ruff/src/rules/flake8_simplify/rules/ast_with.rs +++ b/crates/ruff/src/rules/flake8_simplify/rules/ast_with.rs @@ -6,7 +6,7 @@ use ruff_python_ast::helpers::{first_colon_range, has_comments_in}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{AutofixKind, Availability, Violation}; use super::fix_with; diff --git a/crates/ruff/src/rules/flake8_simplify/rules/key_in_dict.rs b/crates/ruff/src/rules/flake8_simplify/rules/key_in_dict.rs index 42ff8e9813..31930d9493 100644 --- a/crates/ruff/src/rules/flake8_simplify/rules/key_in_dict.rs +++ b/crates/ruff/src/rules/flake8_simplify/rules/key_in_dict.rs @@ -5,7 +5,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/flake8_simplify/rules/reimplemented_builtin.rs b/crates/ruff/src/rules/flake8_simplify/rules/reimplemented_builtin.rs index 397175370f..da35586e02 100644 --- a/crates/ruff/src/rules/flake8_simplify/rules/reimplemented_builtin.rs +++ b/crates/ruff/src/rules/flake8_simplify/rules/reimplemented_builtin.rs @@ -9,7 +9,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/flake8_simplify/rules/yoda_conditions.rs b/crates/ruff/src/rules/flake8_simplify/rules/yoda_conditions.rs index fa0a81040d..61c8179864 100644 --- a/crates/ruff/src/rules/flake8_simplify/rules/yoda_conditions.rs +++ b/crates/ruff/src/rules/flake8_simplify/rules/yoda_conditions.rs @@ -10,7 +10,7 @@ use ruff_python_stdlib::str::{self}; use crate::checkers::ast::Checker; use crate::cst::matchers::{match_comparison, match_expression}; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{AutofixKind, Availability, Violation}; #[violation] diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM101_SIM101.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM101_SIM101.py.snap index a9a1925cc2..1765f0fe57 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM101_SIM101.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM101_SIM101.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - DuplicateIsinstanceCall: - name: a + name: DuplicateIsinstanceCall + body: "Multiple `isinstance` calls for `a`, merge into a single call" + commit: "Merge `isinstance` calls for `a`" + fixable: true location: row: 1 column: 3 @@ -21,8 +23,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - DuplicateIsinstanceCall: - name: a + name: DuplicateIsinstanceCall + body: "Multiple `isinstance` calls for `a`, merge into a single call" + commit: "Merge `isinstance` calls for `a`" + fixable: true location: row: 4 column: 3 @@ -39,8 +43,10 @@ expression: diagnostics column: 53 parent: ~ - kind: - DuplicateIsinstanceCall: - name: a + name: DuplicateIsinstanceCall + body: "Multiple `isinstance` calls for `a`, merge into a single call" + commit: "Merge `isinstance` calls for `a`" + fixable: true location: row: 7 column: 3 @@ -57,8 +63,10 @@ expression: diagnostics column: 68 parent: ~ - kind: - DuplicateIsinstanceCall: - name: a + name: DuplicateIsinstanceCall + body: "Multiple `isinstance` calls for `a`, merge into a single call" + commit: "Merge `isinstance` calls for `a`" + fixable: true location: row: 10 column: 3 @@ -75,8 +83,10 @@ expression: diagnostics column: 68 parent: ~ - kind: - DuplicateIsinstanceCall: - name: a + name: DuplicateIsinstanceCall + body: "Multiple `isinstance` calls for `a`, merge into a single call" + commit: "Merge `isinstance` calls for `a`" + fixable: true location: row: 13 column: 3 @@ -93,8 +103,10 @@ expression: diagnostics column: 68 parent: ~ - kind: - DuplicateIsinstanceCall: - name: a + name: DuplicateIsinstanceCall + body: "Multiple `isinstance` calls for `a`, merge into a single call" + commit: "Merge `isinstance` calls for `a`" + fixable: true location: row: 16 column: 4 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM102_SIM102.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM102_SIM102.py.snap index 0e166522c9..0b72b79424 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM102_SIM102.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM102_SIM102.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - CollapsibleIf: - fixable: true + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + commit: "Combine `if` statements using `and`" + fixable: true location: row: 2 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CollapsibleIf: - fixable: true + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + commit: "Combine `if` statements using `and`" + fixable: true location: row: 7 column: 0 @@ -39,8 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CollapsibleIf: - fixable: true + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + commit: "Combine `if` statements using `and`" + fixable: true location: row: 15 column: 0 @@ -57,8 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CollapsibleIf: - fixable: false + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + commit: ~ + fixable: false location: row: 20 column: 0 @@ -68,8 +76,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CollapsibleIf: - fixable: true + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + commit: "Combine `if` statements using `and`" + fixable: true location: row: 26 column: 0 @@ -86,8 +96,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CollapsibleIf: - fixable: true + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + commit: "Combine `if` statements using `and`" + fixable: true location: row: 51 column: 4 @@ -104,8 +116,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CollapsibleIf: - fixable: true + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + commit: "Combine `if` statements using `and`" + fixable: true location: row: 67 column: 0 @@ -122,8 +136,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CollapsibleIf: - fixable: true + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + commit: "Combine `if` statements using `and`" + fixable: true location: row: 83 column: 4 @@ -140,8 +156,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CollapsibleIf: - fixable: true + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + commit: "Combine `if` statements using `and`" + fixable: true location: row: 90 column: 0 @@ -158,8 +176,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - CollapsibleIf: - fixable: true + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + commit: "Combine `if` statements using `and`" + fixable: true location: row: 117 column: 4 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM103_SIM103.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM103_SIM103.py.snap index 458047ecb4..e15232fa85 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM103_SIM103.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM103_SIM103.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - NeedlessBool: - condition: a - fixable: true + name: NeedlessBool + body: "Return the condition `a` directly" + commit: "Replace with `return a`" + fixable: true location: row: 3 column: 4 @@ -22,9 +23,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - NeedlessBool: - condition: a == b - fixable: true + name: NeedlessBool + body: "Return the condition `a == b` directly" + commit: "Replace with `return a == b`" + fixable: true location: row: 11 column: 4 @@ -41,9 +43,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - NeedlessBool: - condition: b - fixable: true + name: NeedlessBool + body: "Return the condition `b` directly" + commit: "Replace with `return b`" + fixable: true location: row: 21 column: 4 @@ -60,9 +63,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - NeedlessBool: - condition: b - fixable: true + name: NeedlessBool + body: "Return the condition `b` directly" + commit: "Replace with `return b`" + fixable: true location: row: 32 column: 8 @@ -79,9 +83,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - NeedlessBool: - condition: a - fixable: false + name: NeedlessBool + body: "Return the condition `a` directly" + commit: ~ + fixable: false location: row: 57 column: 4 @@ -91,9 +96,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NeedlessBool: - condition: a - fixable: false + name: NeedlessBool + body: "Return the condition `a` directly" + commit: ~ + fixable: false location: row: 83 column: 4 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM105_SIM105.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM105_SIM105.py.snap index 66c383da17..a132e40ae1 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM105_SIM105.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM105_SIM105.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_simplify/mod.rs +source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - UseContextlibSuppress: - exception: ValueError + name: UseContextlibSuppress + body: "Use `contextlib.suppress(ValueError)` instead of try-except-pass" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UseContextlibSuppress: - exception: "ValueError, OSError" + name: UseContextlibSuppress + body: "Use `contextlib.suppress(ValueError, OSError)` instead of try-except-pass" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UseContextlibSuppress: - exception: Exception + name: UseContextlibSuppress + body: "Use `contextlib.suppress(Exception)` instead of try-except-pass" + commit: ~ + fixable: false location: row: 14 column: 0 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UseContextlibSuppress: - exception: "a.Error, b.Error" + name: UseContextlibSuppress + body: "Use `contextlib.suppress(a.Error, b.Error)` instead of try-except-pass" + commit: ~ + fixable: false location: row: 19 column: 0 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM107_SIM107.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM107_SIM107.py.snap index 15d41063ba..b0bc31e283 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM107_SIM107.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM107_SIM107.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_simplify/mod.rs +source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - ReturnInTryExceptFinally: ~ + name: ReturnInTryExceptFinally + body: "Don't use `return` in `try`/`except` and `finally`" + commit: ~ + fixable: false location: row: 9 column: 8 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM108_SIM108.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM108_SIM108.py.snap index 82e0462b7f..6cfdd14a3c 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM108_SIM108.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM108_SIM108.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - UseTernaryOperator: - contents: b = c if a else d - fixable: true + name: UseTernaryOperator + body: "Use ternary operator `b = c if a else d` instead of `if`-`else`-block" + commit: "Replace `if`-`else`-block with `b = c if a else d`" + fixable: true location: row: 2 column: 0 @@ -22,9 +23,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - UseTernaryOperator: - contents: abc = x if x > 0 else -x - fixable: false + name: UseTernaryOperator + body: "Use ternary operator `abc = x if x > 0 else -x` instead of `if`-`else`-block" + commit: ~ + fixable: false location: row: 58 column: 0 @@ -34,9 +36,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UseTernaryOperator: - contents: b = cccccccccccccccccccccccccccccccccccc if a else ddddddddddddddddddddddddddddddddddddd - fixable: true + name: UseTernaryOperator + body: "Use ternary operator `b = cccccccccccccccccccccccccccccccccccc if a else ddddddddddddddddddddddddddddddddddddd` instead of `if`-`else`-block" + commit: "Replace `if`-`else`-block with `b = cccccccccccccccccccccccccccccccccccc if a else ddddddddddddddddddddddddddddddddddddd`" + fixable: true location: row: 82 column: 0 @@ -53,9 +56,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - UseTernaryOperator: - contents: exitcode = 0 if True else 1 - fixable: false + name: UseTernaryOperator + body: "Use ternary operator `exitcode = 0 if True else 1` instead of `if`-`else`-block" + commit: ~ + fixable: false location: row: 97 column: 0 @@ -65,9 +69,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UseTernaryOperator: - contents: x = 3 if True else 5 - fixable: false + name: UseTernaryOperator + body: "Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block" + commit: ~ + fixable: false location: row: 104 column: 0 @@ -77,9 +82,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UseTernaryOperator: - contents: x = 3 if True else 5 - fixable: false + name: UseTernaryOperator + body: "Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block" + commit: ~ + fixable: false location: row: 109 column: 0 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM109_SIM109.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM109_SIM109.py.snap index b5d10acfe1..7a9947f71c 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM109_SIM109.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM109_SIM109.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - CompareWithTuple: - replacement: "a in (b, c)" + name: CompareWithTuple + body: "Use `a in (b, c)` instead of multiple equality comparisons" + commit: "Replace with `a in (b, c)`" + fixable: true location: row: 2 column: 3 @@ -21,8 +23,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - CompareWithTuple: - replacement: "a in (b, c)" + name: CompareWithTuple + body: "Use `a in (b, c)` instead of multiple equality comparisons" + commit: "Replace with `a in (b, c)`" + fixable: true location: row: 6 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - CompareWithTuple: - replacement: "a in (b, c)" + name: CompareWithTuple + body: "Use `a in (b, c)` instead of multiple equality comparisons" + commit: "Replace with `a in (b, c)`" + fixable: true location: row: 10 column: 3 @@ -57,8 +63,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - CompareWithTuple: - replacement: "a in (b, c)" + name: CompareWithTuple + body: "Use `a in (b, c)` instead of multiple equality comparisons" + commit: "Replace with `a in (b, c)`" + fixable: true location: row: 14 column: 3 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM110.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM110.py.snap index 16234811dd..311c361bc2 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM110.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM110.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - ReimplementedBuiltin: - repl: return any(check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 3 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - ReimplementedBuiltin: - repl: return all(not check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 25 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - ReimplementedBuiltin: - repl: return all(x.is_empty() for x in iterable) + name: ReimplementedBuiltin + body: "Use `return all(x.is_empty() for x in iterable)` instead of `for` loop" + commit: "Replace with `return all(x.is_empty() for x in iterable)`" + fixable: true location: row: 33 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - ReimplementedBuiltin: - repl: return any(check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 55 column: 4 @@ -75,8 +83,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - ReimplementedBuiltin: - repl: return all(not check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 64 column: 4 @@ -93,8 +103,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - ReimplementedBuiltin: - repl: return any(check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 73 column: 4 @@ -111,8 +123,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - ReimplementedBuiltin: - repl: return all(not check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 83 column: 4 @@ -129,8 +143,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - ReimplementedBuiltin: - repl: return any(check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 124 column: 4 @@ -140,8 +156,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ReimplementedBuiltin: - repl: return all(not check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 134 column: 4 @@ -151,8 +169,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ReimplementedBuiltin: - repl: return any(check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 144 column: 4 @@ -169,8 +189,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - ReimplementedBuiltin: - repl: return all(not check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 154 column: 4 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM111.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM111.py.snap index 3c7dce7de6..210486f3ba 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM111.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM111.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - ReimplementedBuiltin: - repl: return any(check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 3 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - ReimplementedBuiltin: - repl: return all(not check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 25 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - ReimplementedBuiltin: - repl: return all(x.is_empty() for x in iterable) + name: ReimplementedBuiltin + body: "Use `return all(x.is_empty() for x in iterable)` instead of `for` loop" + commit: "Replace with `return all(x.is_empty() for x in iterable)`" + fixable: true location: row: 33 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - ReimplementedBuiltin: - repl: return any(check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 55 column: 4 @@ -75,8 +83,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - ReimplementedBuiltin: - repl: return all(not check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 64 column: 4 @@ -93,8 +103,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - ReimplementedBuiltin: - repl: return any(check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 73 column: 4 @@ -111,8 +123,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - ReimplementedBuiltin: - repl: return all(not check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 83 column: 4 @@ -129,8 +143,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - ReimplementedBuiltin: - repl: return any(check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 124 column: 4 @@ -140,8 +156,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ReimplementedBuiltin: - repl: return all(not check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 134 column: 4 @@ -151,8 +169,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ReimplementedBuiltin: - repl: return any(check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 144 column: 4 @@ -169,8 +189,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - ReimplementedBuiltin: - repl: return all(not check(x) for x in iterable) + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + commit: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 154 column: 4 @@ -187,8 +209,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - ReimplementedBuiltin: - repl: return all(x in y for x in iterable) + name: ReimplementedBuiltin + body: "Use `return all(x in y for x in iterable)` instead of `for` loop" + commit: "Replace with `return all(x in y for x in iterable)`" + fixable: true location: row: 162 column: 4 @@ -205,8 +229,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - ReimplementedBuiltin: - repl: return all(x <= y for x in iterable) + name: ReimplementedBuiltin + body: "Use `return all(x <= y for x in iterable)` instead of `for` loop" + commit: "Replace with `return all(x <= y for x in iterable)`" + fixable: true location: row: 170 column: 4 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM112_SIM112.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM112_SIM112.py.snap index 14caa6dde2..12e29eb8fa 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM112_SIM112.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM112_SIM112.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - UseCapitalEnvironmentVariables: - expected: FOO - original: foo + name: UseCapitalEnvironmentVariables + body: "Use capitalized environment variable `FOO` instead of `foo`" + commit: "Replace `foo` with `FOO`" + fixable: true location: row: 4 column: 11 @@ -22,9 +23,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - UseCapitalEnvironmentVariables: - expected: FOO - original: foo + name: UseCapitalEnvironmentVariables + body: "Use capitalized environment variable `FOO` instead of `foo`" + commit: "Replace `foo` with `FOO`" + fixable: true location: row: 6 column: 15 @@ -41,9 +43,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - UseCapitalEnvironmentVariables: - expected: FOO - original: foo + name: UseCapitalEnvironmentVariables + body: "Use capitalized environment variable `FOO` instead of `foo`" + commit: "Replace `foo` with `FOO`" + fixable: true location: row: 8 column: 15 @@ -60,9 +63,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - UseCapitalEnvironmentVariables: - expected: FOO - original: foo + name: UseCapitalEnvironmentVariables + body: "Use capitalized environment variable `FOO` instead of `foo`" + commit: "Replace `foo` with `FOO`" + fixable: true location: row: 10 column: 10 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM114_SIM114.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM114_SIM114.py.snap index ee04790b30..33a07ccd4f 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM114_SIM114.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM114_SIM114.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - IfWithSameArms: ~ + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + commit: ~ + fixable: false location: row: 2 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IfWithSameArms: ~ + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IfWithSameArms: ~ + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + commit: ~ + fixable: false location: row: 14 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IfWithSameArms: ~ + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + commit: ~ + fixable: false location: row: 23 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IfWithSameArms: ~ + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + commit: ~ + fixable: false location: row: 24 column: 4 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IfWithSameArms: ~ + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + commit: ~ + fixable: false location: row: 31 column: 4 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IfWithSameArms: ~ + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + commit: ~ + fixable: false location: row: 38 column: 0 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IfWithSameArms: ~ + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + commit: ~ + fixable: false location: row: 62 column: 5 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM115_SIM115.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM115_SIM115.py.snap index 03d2fd87a4..7e5624c4d4 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM115_SIM115.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM115_SIM115.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_simplify/mod.rs +source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - OpenFileWithContextHandler: ~ + name: OpenFileWithContextHandler + body: Use context handler for opening files + commit: ~ + fixable: false location: row: 4 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - OpenFileWithContextHandler: ~ + name: OpenFileWithContextHandler + body: Use context handler for opening files + commit: ~ + fixable: false location: row: 31 column: 8 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM116_SIM116.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM116_SIM116.py.snap index f85322c620..46a9d914bf 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM116_SIM116.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM116_SIM116.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - ManualDictLookup: ~ + name: ManualDictLookup + body: "Use a dictionary instead of consecutive `if` statements" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ManualDictLookup: ~ + name: ManualDictLookup + body: "Use a dictionary instead of consecutive `if` statements" + commit: ~ + fixable: false location: row: 15 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ManualDictLookup: ~ + name: ManualDictLookup + body: "Use a dictionary instead of consecutive `if` statements" + commit: ~ + fixable: false location: row: 25 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ManualDictLookup: ~ + name: ManualDictLookup + body: "Use a dictionary instead of consecutive `if` statements" + commit: ~ + fixable: false location: row: 33 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ManualDictLookup: ~ + name: ManualDictLookup + body: "Use a dictionary instead of consecutive `if` statements" + commit: ~ + fixable: false location: row: 43 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ManualDictLookup: ~ + name: ManualDictLookup + body: "Use a dictionary instead of consecutive `if` statements" + commit: ~ + fixable: false location: row: 51 column: 0 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ManualDictLookup: ~ + name: ManualDictLookup + body: "Use a dictionary instead of consecutive `if` statements" + commit: ~ + fixable: false location: row: 79 column: 0 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM117_SIM117.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM117_SIM117.py.snap index 3136c30e8f..88a7749538 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM117_SIM117.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM117_SIM117.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - MultipleWithStatements: - fixable: true + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + commit: "Combine `with` statements" + fixable: true location: row: 2 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - MultipleWithStatements: - fixable: true + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + commit: "Combine `with` statements" + fixable: true location: row: 7 column: 0 @@ -39,8 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - MultipleWithStatements: - fixable: false + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -50,8 +56,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleWithStatements: - fixable: true + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + commit: "Combine `with` statements" + fixable: true location: row: 19 column: 0 @@ -68,8 +76,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - MultipleWithStatements: - fixable: true + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + commit: "Combine `with` statements" + fixable: true location: row: 53 column: 4 @@ -86,8 +96,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - MultipleWithStatements: - fixable: true + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + commit: "Combine `with` statements" + fixable: true location: row: 68 column: 0 @@ -104,8 +116,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - MultipleWithStatements: - fixable: true + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + commit: "Combine `with` statements" + fixable: true location: row: 76 column: 0 @@ -122,8 +136,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - MultipleWithStatements: - fixable: true + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + commit: "Combine `with` statements" + fixable: true location: row: 84 column: 0 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM118_SIM118.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM118_SIM118.py.snap index c734371f22..ab5077e29c 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM118_SIM118.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM118_SIM118.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - KeyInDict: - key: key - dict: obj + name: KeyInDict + body: "Use `key in obj` instead of `key in obj.keys()`" + commit: "Convert to `key in obj`" + fixable: true location: row: 1 column: 0 @@ -22,9 +23,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - KeyInDict: - key: "foo[\"bar\"]" - dict: obj + name: KeyInDict + body: "Use `foo[\"bar\"] in obj` instead of `foo[\"bar\"] in obj.keys()`" + commit: "Convert to `foo[\"bar\"] in obj`" + fixable: true location: row: 3 column: 0 @@ -41,9 +43,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - KeyInDict: - key: "foo['bar']" - dict: obj + name: KeyInDict + body: "Use `foo['bar'] in obj` instead of `foo['bar'] in obj.keys()`" + commit: "Convert to `foo['bar'] in obj`" + fixable: true location: row: 5 column: 0 @@ -60,9 +63,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - KeyInDict: - key: foo() - dict: obj + name: KeyInDict + body: "Use `foo() in obj` instead of `foo() in obj.keys()`" + commit: "Convert to `foo() in obj`" + fixable: true location: row: 7 column: 0 @@ -79,9 +83,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - KeyInDict: - key: key - dict: obj + name: KeyInDict + body: "Use `key in obj` instead of `key in obj.keys()`" + commit: "Convert to `key in obj`" + fixable: true location: row: 9 column: 4 @@ -98,9 +103,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - KeyInDict: - key: k - dict: obj + name: KeyInDict + body: "Use `k in obj` instead of `k in obj.keys()`" + commit: "Convert to `k in obj`" + fixable: true location: row: 16 column: 7 @@ -117,9 +123,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - KeyInDict: - key: k - dict: obj + name: KeyInDict + body: "Use `k in obj` instead of `k in obj.keys()`" + commit: "Convert to `k in obj`" + fixable: true location: row: 18 column: 7 @@ -136,9 +143,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - KeyInDict: - key: k - dict: obj + name: KeyInDict + body: "Use `k in obj` instead of `k in obj.keys()`" + commit: "Convert to `k in obj`" + fixable: true location: row: 20 column: 10 @@ -155,9 +163,10 @@ expression: diagnostics column: 25 parent: ~ - kind: - KeyInDict: - key: k - dict: obj + name: KeyInDict + body: "Use `k in obj` instead of `k in obj.keys()`" + commit: "Convert to `k in obj`" + fixable: true location: row: 22 column: 7 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM201_SIM201.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM201_SIM201.py.snap index d5ff81236c..ef60659f28 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM201_SIM201.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM201_SIM201.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - NegateEqualOp: - left: a - right: b + name: NegateEqualOp + body: "Use `a != b` instead of `not a == b`" + commit: "Replace with `!=` operator" + fixable: true location: row: 2 column: 3 @@ -22,9 +23,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - NegateEqualOp: - left: a - right: b + c + name: NegateEqualOp + body: "Use `a != b + c` instead of `not a == b + c`" + commit: "Replace with `!=` operator" + fixable: true location: row: 6 column: 3 @@ -41,9 +43,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - NegateEqualOp: - left: a + b - right: c + name: NegateEqualOp + body: "Use `a + b != c` instead of `not a + b == c`" + commit: "Replace with `!=` operator" + fixable: true location: row: 10 column: 3 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM202_SIM202.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM202_SIM202.py.snap index d910d1c2bd..1ba8616338 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM202_SIM202.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM202_SIM202.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - NegateNotEqualOp: - left: a - right: b + name: NegateNotEqualOp + body: "Use `a == b` instead of `not a != b`" + commit: "Replace with `==` operator" + fixable: true location: row: 2 column: 3 @@ -22,9 +23,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - NegateNotEqualOp: - left: a - right: b + c + name: NegateNotEqualOp + body: "Use `a == b + c` instead of `not a != b + c`" + commit: "Replace with `==` operator" + fixable: true location: row: 6 column: 3 @@ -41,9 +43,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - NegateNotEqualOp: - left: a + b - right: c + name: NegateNotEqualOp + body: "Use `a + b == c` instead of `not a + b != c`" + commit: "Replace with `==` operator" + fixable: true location: row: 10 column: 3 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM208_SIM208.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM208_SIM208.py.snap index edcd4bf246..8d7f56d90e 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM208_SIM208.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM208_SIM208.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - DoubleNegation: - expr: a + name: DoubleNegation + body: "Use `a` instead of `not (not a)`" + commit: "Replace with `a`" + fixable: true location: row: 1 column: 3 @@ -21,8 +23,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - DoubleNegation: - expr: a == b + name: DoubleNegation + body: "Use `a == b` instead of `not (not a == b)`" + commit: "Replace with `a == b`" + fixable: true location: row: 4 column: 3 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM210_SIM210.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM210_SIM210.py.snap index 396ce97822..a77abbd297 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM210_SIM210.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM210_SIM210.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - IfExprWithTrueFalse: - expr: b + name: IfExprWithTrueFalse + body: "Use `bool(b)` instead of `True if b else False`" + commit: "Replace with `not b" + fixable: true location: row: 1 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - IfExprWithTrueFalse: - expr: b != c + name: IfExprWithTrueFalse + body: "Use `bool(b != c)` instead of `True if b != c else False`" + commit: "Replace with `not b != c" + fixable: true location: row: 3 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - IfExprWithTrueFalse: - expr: b + c + name: IfExprWithTrueFalse + body: "Use `bool(b + c)` instead of `True if b + c else False`" + commit: "Replace with `not b + c" + fixable: true location: row: 5 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - IfExprWithTrueFalse: - expr: b + name: IfExprWithTrueFalse + body: "Use `bool(b)` instead of `True if b else False`" + commit: "Replace with `not b" + fixable: true location: row: 14 column: 8 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM211_SIM211.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM211_SIM211.py.snap index b3affb03f0..8bb1e4ebed 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM211_SIM211.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM211_SIM211.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - IfExprWithFalseTrue: - expr: b + name: IfExprWithFalseTrue + body: "Use `not b` instead of `False if b else True`" + commit: "Replace with `bool(b)" + fixable: true location: row: 1 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - IfExprWithFalseTrue: - expr: b != c + name: IfExprWithFalseTrue + body: "Use `not b != c` instead of `False if b != c else True`" + commit: "Replace with `bool(b != c)" + fixable: true location: row: 3 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - IfExprWithFalseTrue: - expr: b + c + name: IfExprWithFalseTrue + body: "Use `not b + c` instead of `False if b + c else True`" + commit: "Replace with `bool(b + c)" + fixable: true location: row: 5 column: 4 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM212_SIM212.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM212_SIM212.py.snap index 0f7838f8ea..1036f4b0cc 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM212_SIM212.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM212_SIM212.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - IfExprWithTwistedArms: - expr_body: b - expr_else: a + name: IfExprWithTwistedArms + body: "Use `a if a else b` instead of `b if not a else a`" + commit: "Replace with `a if a else b`" + fixable: true location: row: 1 column: 4 @@ -22,9 +23,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - IfExprWithTwistedArms: - expr_body: b + c - expr_else: a + name: IfExprWithTwistedArms + body: "Use `a if a else b + c` instead of `b + c if not a else a`" + commit: "Replace with `a if a else b + c`" + fixable: true location: row: 3 column: 4 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM220_SIM220.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM220_SIM220.py.snap index 58c02c2753..65767a4d16 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM220_SIM220.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM220_SIM220.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - ExprAndNotExpr: - name: a + name: ExprAndNotExpr + body: "Use `False` instead of `a and not a`" + commit: "Replace with `False`" + fixable: true location: row: 1 column: 3 @@ -21,8 +23,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - ExprAndNotExpr: - name: a + name: ExprAndNotExpr + body: "Use `False` instead of `a and not a`" + commit: "Replace with `False`" + fixable: true location: row: 4 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - ExprAndNotExpr: - name: a + name: ExprAndNotExpr + body: "Use `False` instead of `a and not a`" + commit: "Replace with `False`" + fixable: true location: row: 7 column: 4 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM221_SIM221.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM221_SIM221.py.snap index 56ad73019f..29d215a6f0 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM221_SIM221.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM221_SIM221.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - ExprOrNotExpr: - name: a + name: ExprOrNotExpr + body: "Use `True` instead of `a or not a`" + commit: "Replace with `True`" + fixable: true location: row: 1 column: 3 @@ -21,8 +23,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - ExprOrNotExpr: - name: a + name: ExprOrNotExpr + body: "Use `True` instead of `a or not a`" + commit: "Replace with `True`" + fixable: true location: row: 4 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - ExprOrNotExpr: - name: a + name: ExprOrNotExpr + body: "Use `True` instead of `a or not a`" + commit: "Replace with `True`" + fixable: true location: row: 7 column: 4 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM222_SIM222.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM222_SIM222.py.snap index d5329fc810..c3decba502 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM222_SIM222.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM222_SIM222.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - ExprOrTrue: ~ + name: ExprOrTrue + body: "Use `True` instead of `... or True`" + commit: "Replace with `True`" + fixable: true location: row: 1 column: 8 @@ -20,7 +23,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - ExprOrTrue: ~ + name: ExprOrTrue + body: "Use `True` instead of `... or True`" + commit: "Replace with `True`" + fixable: true location: row: 4 column: 15 @@ -37,7 +43,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - ExprOrTrue: ~ + name: ExprOrTrue + body: "Use `True` instead of `... or True`" + commit: "Replace with `True`" + fixable: true location: row: 7 column: 14 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM223_SIM223.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM223_SIM223.py.snap index 3896c349fe..2c6880ed9e 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM223_SIM223.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM223_SIM223.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - ExprAndFalse: ~ + name: ExprAndFalse + body: "Use `False` instead of `... and False`" + commit: "Replace with `False`" + fixable: true location: row: 1 column: 9 @@ -20,7 +23,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - ExprAndFalse: ~ + name: ExprAndFalse + body: "Use `False` instead of `... and False`" + commit: "Replace with `False`" + fixable: true location: row: 4 column: 16 @@ -37,7 +43,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - ExprAndFalse: ~ + name: ExprAndFalse + body: "Use `False` instead of `... and False`" + commit: "Replace with `False`" + fixable: true location: row: 7 column: 15 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM300_SIM300.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM300_SIM300.py.snap index 6eea1acc2d..951d220a66 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM300_SIM300.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM300_SIM300.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - YodaConditions: - suggestion: "compare == \"yoda\"" + name: YodaConditions + body: "Yoda conditions are discouraged, use `compare == \"yoda\"` instead" + commit: "Replace Yoda condition with `compare == \"yoda\"`" + fixable: true location: row: 2 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - YodaConditions: - suggestion: "compare == \"yoda\"" + name: YodaConditions + body: "Yoda conditions are discouraged, use `compare == \"yoda\"` instead" + commit: "Replace Yoda condition with `compare == \"yoda\"`" + fixable: true location: row: 3 column: 0 @@ -39,8 +43,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - YodaConditions: - suggestion: age == 42 + name: YodaConditions + body: "Yoda conditions are discouraged, use `age == 42` instead" + commit: "Replace Yoda condition with `age == 42`" + fixable: true location: row: 4 column: 0 @@ -57,8 +63,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - YodaConditions: - suggestion: "compare == (\"a\", \"b\")" + name: YodaConditions + body: "Yoda conditions are discouraged, use `compare == (\"a\", \"b\")` instead" + commit: "Replace Yoda condition with `compare == (\"a\", \"b\")`" + fixable: true location: row: 5 column: 0 @@ -75,8 +83,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - YodaConditions: - suggestion: "compare >= \"yoda\"" + name: YodaConditions + body: "Yoda conditions are discouraged, use `compare >= \"yoda\"` instead" + commit: "Replace Yoda condition with `compare >= \"yoda\"`" + fixable: true location: row: 6 column: 0 @@ -93,8 +103,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - YodaConditions: - suggestion: "compare > \"yoda\"" + name: YodaConditions + body: "Yoda conditions are discouraged, use `compare > \"yoda\"` instead" + commit: "Replace Yoda condition with `compare > \"yoda\"`" + fixable: true location: row: 7 column: 0 @@ -111,8 +123,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - YodaConditions: - suggestion: age < 42 + name: YodaConditions + body: "Yoda conditions are discouraged, use `age < 42` instead" + commit: "Replace Yoda condition with `age < 42`" + fixable: true location: row: 8 column: 0 @@ -129,8 +143,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - YodaConditions: - suggestion: age < -42 + name: YodaConditions + body: "Yoda conditions are discouraged, use `age < -42` instead" + commit: "Replace Yoda condition with `age < -42`" + fixable: true location: row: 9 column: 0 @@ -147,8 +163,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - YodaConditions: - suggestion: age < +42 + name: YodaConditions + body: "Yoda conditions are discouraged, use `age < +42` instead" + commit: "Replace Yoda condition with `age < +42`" + fixable: true location: row: 10 column: 0 @@ -165,8 +183,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - YodaConditions: - suggestion: age == YODA + name: YodaConditions + body: "Yoda conditions are discouraged, use `age == YODA` instead" + commit: "Replace Yoda condition with `age == YODA`" + fixable: true location: row: 11 column: 0 @@ -183,8 +203,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - YodaConditions: - suggestion: age < YODA + name: YodaConditions + body: "Yoda conditions are discouraged, use `age < YODA` instead" + commit: "Replace Yoda condition with `age < YODA`" + fixable: true location: row: 12 column: 0 @@ -201,8 +223,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - YodaConditions: - suggestion: age <= YODA + name: YodaConditions + body: "Yoda conditions are discouraged, use `age <= YODA` instead" + commit: "Replace Yoda condition with `age <= YODA`" + fixable: true location: row: 13 column: 0 @@ -219,8 +243,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - YodaConditions: - suggestion: age == JediOrder.YODA + name: YodaConditions + body: "Yoda conditions are discouraged, use `age == JediOrder.YODA` instead" + commit: "Replace Yoda condition with `age == JediOrder.YODA`" + fixable: true location: row: 14 column: 0 @@ -237,8 +263,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - YodaConditions: - suggestion: (number - 100) > 0 + name: YodaConditions + body: "Yoda conditions are discouraged, use `(number - 100) > 0` instead" + commit: "Replace Yoda condition with `(number - 100) > 0`" + fixable: true location: row: 15 column: 0 @@ -255,8 +283,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - YodaConditions: - suggestion: (60 * 60) < SomeClass().settings.SOME_CONSTANT_VALUE + name: YodaConditions + body: "Yoda conditions are discouraged, use `(60 * 60) < SomeClass().settings.SOME_CONSTANT_VALUE` instead" + commit: "Replace Yoda condition with `(60 * 60) < SomeClass().settings.SOME_CONSTANT_VALUE`" + fixable: true location: row: 16 column: 0 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM401_SIM401.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM401_SIM401.py.snap index 7213356f95..de07845c59 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM401_SIM401.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM401_SIM401.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- - kind: - DictGetWithDefault: - contents: "var = a_dict.get(key, \"default1\")" - fixable: true + name: DictGetWithDefault + body: "Use `var = a_dict.get(key, \"default1\")` instead of an `if` block" + commit: "Replace with `var = a_dict.get(key, \"default1\")`" + fixable: true location: row: 6 column: 0 @@ -22,9 +23,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - DictGetWithDefault: - contents: "var = a_dict.get(key, \"default2\")" - fixable: true + name: DictGetWithDefault + body: "Use `var = a_dict.get(key, \"default2\")` instead of an `if` block" + commit: "Replace with `var = a_dict.get(key, \"default2\")`" + fixable: true location: row: 12 column: 0 @@ -41,9 +43,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - DictGetWithDefault: - contents: "var = a_dict.get(key, val1 + val2)" - fixable: true + name: DictGetWithDefault + body: "Use `var = a_dict.get(key, val1 + val2)` instead of an `if` block" + commit: "Replace with `var = a_dict.get(key, val1 + val2)`" + fixable: true location: row: 18 column: 0 @@ -60,9 +63,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - DictGetWithDefault: - contents: "var = a_dict.get(keys[idx], \"default\")" - fixable: true + name: DictGetWithDefault + body: "Use `var = a_dict.get(keys[idx], \"default\")` instead of an `if` block" + commit: "Replace with `var = a_dict.get(keys[idx], \"default\")`" + fixable: true location: row: 24 column: 0 @@ -79,9 +83,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - DictGetWithDefault: - contents: "var = dicts[idx].get(key, \"default\")" - fixable: true + name: DictGetWithDefault + body: "Use `var = dicts[idx].get(key, \"default\")` instead of an `if` block" + commit: "Replace with `var = dicts[idx].get(key, \"default\")`" + fixable: true location: row: 30 column: 0 @@ -98,9 +103,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - DictGetWithDefault: - contents: "vars[idx] = a_dict.get(key, \"default\")" - fixable: true + name: DictGetWithDefault + body: "Use `vars[idx] = a_dict.get(key, \"default\")` instead of an `if` block" + commit: "Replace with `vars[idx] = a_dict.get(key, \"default\")`" + fixable: true location: row: 36 column: 0 diff --git a/crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs b/crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs index de66f47cd7..423e968e11 100644 --- a/crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs +++ b/crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs @@ -10,7 +10,7 @@ use ruff_python_stdlib::identifiers::is_module_name; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{AutofixKind, Availability, Violation}; pub type Settings = Strictness; diff --git a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__banned_api__tests__banned_api_true_positives.snap b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__banned_api__tests__banned_api_true_positives.snap index b43db1a9bf..5721c9a701 100644 --- a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__banned_api__tests__banned_api_true_positives.snap +++ b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__banned_api__tests__banned_api_true_positives.snap @@ -1,11 +1,12 @@ --- -source: src/rules/flake8_tidy_imports/banned_api.rs +source: crates/ruff/src/rules/flake8_tidy_imports/banned_api.rs expression: diagnostics --- - kind: - BannedApi: - name: cgi - message: The cgi module is deprecated. + name: BannedApi + body: "`cgi` is banned: The cgi module is deprecated." + commit: ~ + fixable: false location: row: 2 column: 7 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BannedApi: - name: cgi - message: The cgi module is deprecated. + name: BannedApi + body: "`cgi` is banned: The cgi module is deprecated." + commit: ~ + fixable: false location: row: 4 column: 0 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BannedApi: - name: cgi - message: The cgi module is deprecated. + name: BannedApi + body: "`cgi` is banned: The cgi module is deprecated." + commit: ~ + fixable: false location: row: 6 column: 0 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BannedApi: - name: cgi - message: The cgi module is deprecated. + name: BannedApi + body: "`cgi` is banned: The cgi module is deprecated." + commit: ~ + fixable: false location: row: 9 column: 7 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BannedApi: - name: cgi - message: The cgi module is deprecated. + name: BannedApi + body: "`cgi` is banned: The cgi module is deprecated." + commit: ~ + fixable: false location: row: 11 column: 0 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BannedApi: - name: cgi - message: The cgi module is deprecated. + name: BannedApi + body: "`cgi` is banned: The cgi module is deprecated." + commit: ~ + fixable: false location: row: 13 column: 0 @@ -75,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BannedApi: - name: typing.TypedDict - message: Use typing_extensions.TypedDict instead. + name: BannedApi + body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." + commit: ~ + fixable: false location: row: 17 column: 19 @@ -87,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BannedApi: - name: typing.TypedDict - message: Use typing_extensions.TypedDict instead. + name: BannedApi + body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." + commit: ~ + fixable: false location: row: 22 column: 0 @@ -99,9 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BannedApi: - name: typing.TypedDict - message: Use typing_extensions.TypedDict instead. + name: BannedApi + body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." + commit: ~ + fixable: false location: row: 24 column: 0 @@ -111,9 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BannedApi: - name: typing.TypedDict - message: Use typing_extensions.TypedDict instead. + name: BannedApi + body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." + commit: ~ + fixable: false location: row: 27 column: 0 @@ -123,9 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BannedApi: - name: typing.TypedDict - message: Use typing_extensions.TypedDict instead. + name: BannedApi + body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." + commit: ~ + fixable: false location: row: 29 column: 0 @@ -135,9 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BannedApi: - name: typing.TypedDict - message: Use typing_extensions.TypedDict instead. + name: BannedApi + body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." + commit: ~ + fixable: false location: row: 33 column: 0 diff --git a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_all_imports.snap b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_all_imports.snap index 8dc9ba5829..e0ffda00ab 100644 --- a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_all_imports.snap +++ b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_all_imports.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs expression: diagnostics --- - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 7 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 8 column: 0 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 9 column: 0 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 10 column: 0 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 11 column: 0 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 12 column: 0 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 13 column: 0 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 14 column: 0 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 17 column: 0 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 21 column: 0 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 22 column: 0 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 23 column: 0 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 24 column: 0 @@ -146,8 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 25 column: 0 @@ -157,8 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 26 column: 0 @@ -168,8 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 27 column: 0 @@ -179,8 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: all + name: RelativeImports + body: Relative imports are banned + commit: Replace relative imports with absolute imports + fixable: true location: row: 28 column: 0 diff --git a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports.snap b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports.snap index 8bb176b23b..5d90727f84 100644 --- a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports.snap +++ b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs expression: diagnostics --- - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 9 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 10 column: 0 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 11 column: 0 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 12 column: 0 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 17 column: 0 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 21 column: 0 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 22 column: 0 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 23 column: 0 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 24 column: 0 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 25 column: 0 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 26 column: 0 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 27 column: 0 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 28 column: 0 diff --git a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports_package.snap b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports_package.snap index fbf6f26a11..915d6232a1 100644 --- a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports_package.snap +++ b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports_package.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs expression: diagnostics --- - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 5 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 6 column: 0 @@ -32,8 +36,10 @@ expression: diagnostics column: 55 parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 6 column: 0 @@ -50,8 +56,10 @@ expression: diagnostics column: 55 parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 6 column: 0 @@ -68,8 +76,10 @@ expression: diagnostics column: 55 parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 7 column: 0 @@ -86,8 +96,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - RelativeImports: - strictness: parents + name: RelativeImports + body: Relative imports from parent modules are banned + commit: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 8 column: 0 diff --git a/crates/ruff/src/rules/flake8_type_checking/rules/empty_type_checking_block.rs b/crates/ruff/src/rules/flake8_type_checking/rules/empty_type_checking_block.rs index 57f7ceb770..7fd35bccad 100644 --- a/crates/ruff/src/rules/flake8_type_checking/rules/empty_type_checking_block.rs +++ b/crates/ruff/src/rules/flake8_type_checking/rules/empty_type_checking_block.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::{Range, RefEquality}; use crate::autofix::helpers::delete_stmt; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TCH005.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TCH005.py.snap index dd87cebe77..9718f21dec 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TCH005.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TCH005.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - EmptyTypeCheckingBlock: ~ + name: EmptyTypeCheckingBlock + body: Found empty type-checking block + commit: Delete empty type-checking block + fixable: true location: row: 4 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - EmptyTypeCheckingBlock: ~ + name: EmptyTypeCheckingBlock + body: Found empty type-checking block + commit: Delete empty type-checking block + fixable: true location: row: 8 column: 4 @@ -37,7 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - EmptyTypeCheckingBlock: ~ + name: EmptyTypeCheckingBlock + body: Found empty type-checking block + commit: Delete empty type-checking block + fixable: true location: row: 11 column: 4 @@ -54,7 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - EmptyTypeCheckingBlock: ~ + name: EmptyTypeCheckingBlock + body: Found empty type-checking block + commit: Delete empty type-checking block + fixable: true location: row: 16 column: 8 @@ -71,7 +83,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - EmptyTypeCheckingBlock: ~ + name: EmptyTypeCheckingBlock + body: Found empty type-checking block + commit: Delete empty type-checking block + fixable: true location: row: 22 column: 8 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__exempt_modules.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__exempt_modules.snap index 22d2b14a9d..9a2c3ad9b7 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__exempt_modules.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__exempt_modules.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_type_checking/mod.rs +source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - TypingOnlyThirdPartyImport: - full_name: flask + name: TypingOnlyThirdPartyImport + body: "Move third-party import `flask` into a type-checking block" + commit: ~ + fixable: false location: row: 14 column: 11 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap index d2b2402ee9..06b8a333b2 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_type_checking/mod.rs +source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - RuntimeImportInTypeCheckingBlock: - full_name: datetime.datetime + name: RuntimeImportInTypeCheckingBlock + body: "Move import `datetime.datetime` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 4 column: 25 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap index e8aa402677..d3db1e8f9c 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - RuntimeImportInTypeCheckingBlock: - full_name: typing.List + name: RuntimeImportInTypeCheckingBlock + body: "Move import `typing.List` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 4 column: 23 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap index 8cff4afd73..6a5eb608bd 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - RuntimeImportInTypeCheckingBlock: - full_name: collections.abc.Callable + name: RuntimeImportInTypeCheckingBlock + body: "Move import `collections.abc.Callable` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 6 column: 32 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap index 3ae0294d31..212d256cd6 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_type_checking/mod.rs +source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - RuntimeImportInTypeCheckingBlock: - full_name: datetime.date + name: RuntimeImportInTypeCheckingBlock + body: "Move import `datetime.date` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 4 column: 25 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap index 38e43aef40..ef069b492e 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - RuntimeImportInTypeCheckingBlock: - full_name: typing.Any + name: RuntimeImportInTypeCheckingBlock + body: "Move import `typing.Any` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 4 column: 23 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap index 6e997c1751..0e5f0f5e5e 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - RuntimeImportInTypeCheckingBlock: - full_name: typing.List + name: RuntimeImportInTypeCheckingBlock + body: "Move import `typing.List` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 4 column: 23 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RuntimeImportInTypeCheckingBlock: - full_name: typing.Sequence + name: RuntimeImportInTypeCheckingBlock + body: "Move import `typing.Sequence` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 4 column: 29 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RuntimeImportInTypeCheckingBlock: - full_name: typing.Set + name: RuntimeImportInTypeCheckingBlock + body: "Move import `typing.Set` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 4 column: 39 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap index 9e350e0180..6121b36627 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - RuntimeImportInTypeCheckingBlock: - full_name: typing.Tuple + name: RuntimeImportInTypeCheckingBlock + body: "Move import `typing.Tuple` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 4 column: 23 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RuntimeImportInTypeCheckingBlock: - full_name: typing.List + name: RuntimeImportInTypeCheckingBlock + body: "Move import `typing.List` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 4 column: 30 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap index 1d91e55c35..323b8aa7d1 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - RuntimeImportInTypeCheckingBlock: - full_name: datetime + name: RuntimeImportInTypeCheckingBlock + body: "Move import `datetime` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 10 column: 11 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RuntimeImportInTypeCheckingBlock: - full_name: array.array + name: RuntimeImportInTypeCheckingBlock + body: "Move import `array.array` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 11 column: 22 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RuntimeImportInTypeCheckingBlock: - full_name: pandas + name: RuntimeImportInTypeCheckingBlock + body: "Move import `pandas` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 13 column: 11 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap index ebb66dd07e..6d21c94d6b 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - RuntimeImportInTypeCheckingBlock: - full_name: datetime + name: RuntimeImportInTypeCheckingBlock + body: "Move import `datetime` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 12 column: 11 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RuntimeImportInTypeCheckingBlock: - full_name: array.array + name: RuntimeImportInTypeCheckingBlock + body: "Move import `array.array` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 13 column: 22 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RuntimeImportInTypeCheckingBlock: - full_name: pandas + name: RuntimeImportInTypeCheckingBlock + body: "Move import `pandas` out of type-checking block. Import is used for more than type hinting." + commit: ~ + fixable: false location: row: 15 column: 11 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__strict.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__strict.snap index 485c81c330..2a871b060d 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__strict.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__strict.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_type_checking/mod.rs +source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - TypingOnlyThirdPartyImport: - full_name: pkg.A + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pkg.A` into a type-checking block" + commit: ~ + fixable: false location: row: 24 column: 20 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypingOnlyThirdPartyImport: - full_name: pkg.A + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pkg.A` into a type-checking block" + commit: ~ + fixable: false location: row: 32 column: 20 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypingOnlyThirdPartyImport: - full_name: pkg.bar.A + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pkg.bar.A` into a type-checking block" + commit: ~ + fixable: false location: row: 51 column: 24 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap index b0a0bb7975..b9bfd0c86e 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_type_checking/mod.rs +source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - TypingOnlyFirstPartyImport: - full_name: ".TYP001" + name: TypingOnlyFirstPartyImport + body: "Move application import `.TYP001` into a type-checking block" + commit: ~ + fixable: false location: row: 20 column: 18 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap index b3967da79c..9e6ed96ae3 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_type_checking/mod.rs +source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - TypingOnlyStandardLibraryImport: - full_name: os + name: TypingOnlyStandardLibraryImport + body: "Move standard library import `os` into a type-checking block" + commit: ~ + fixable: false location: row: 8 column: 11 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap index 43cfb343de..1f83a21167 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - TypingOnlyStandardLibraryImport: - full_name: uuid.UUID + name: TypingOnlyStandardLibraryImport + body: "Move standard library import `uuid.UUID` into a type-checking block" + commit: ~ + fixable: false location: row: 5 column: 17 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap index 76533c7fb4..50cdfe32ac 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - TypingOnlyStandardLibraryImport: - full_name: uuid.UUID + name: TypingOnlyStandardLibraryImport + body: "Move standard library import `uuid.UUID` into a type-checking block" + commit: ~ + fixable: false location: row: 6 column: 17 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap index c62ba0be8d..97fe2e11ca 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - TypingOnlyThirdPartyImport: - full_name: pandas + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas` into a type-checking block" + commit: ~ + fixable: false location: row: 5 column: 11 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypingOnlyThirdPartyImport: - full_name: pandas.DataFrame + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas.DataFrame` into a type-checking block" + commit: ~ + fixable: false location: row: 11 column: 23 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypingOnlyThirdPartyImport: - full_name: pandas.DataFrame + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas.DataFrame` into a type-checking block" + commit: ~ + fixable: false location: row: 17 column: 23 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypingOnlyThirdPartyImport: - full_name: pandas + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas` into a type-checking block" + commit: ~ + fixable: false location: row: 23 column: 11 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypingOnlyThirdPartyImport: - full_name: pandas.DataFrame + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas.DataFrame` into a type-checking block" + commit: ~ + fixable: false location: row: 29 column: 23 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypingOnlyThirdPartyImport: - full_name: pandas.DataFrame + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas.DataFrame` into a type-checking block" + commit: ~ + fixable: false location: row: 35 column: 23 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypingOnlyThirdPartyImport: - full_name: pandas + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas` into a type-checking block" + commit: ~ + fixable: false location: row: 41 column: 11 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypingOnlyThirdPartyImport: - full_name: pandas + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas` into a type-checking block" + commit: ~ + fixable: false location: row: 47 column: 11 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap index f494ec7fb6..9561c74186 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - TypingOnlyThirdPartyImport: - full_name: geopandas + name: TypingOnlyThirdPartyImport + body: "Move third-party import `geopandas` into a type-checking block" + commit: ~ + fixable: false location: row: 3 column: 7 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypingOnlyThirdPartyImport: - full_name: pyproj + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pyproj` into a type-checking block" + commit: ~ + fixable: false location: row: 5 column: 7 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap index 881d11f4ae..1e4b23f1b7 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - TypingOnlyThirdPartyImport: - full_name: numpy + name: TypingOnlyThirdPartyImport + body: "Move third-party import `numpy` into a type-checking block" + commit: ~ + fixable: false location: row: 10 column: 7 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap index c9c78b31b5..05f90b3210 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_type_checking/mod.rs +source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- - kind: - TypingOnlyThirdPartyImport: - full_name: pkg.bar.A + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pkg.bar.A` into a type-checking block" + commit: ~ + fixable: false location: row: 51 column: 24 diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG001_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG001_ARG.py.snap index 3428cc5ddb..36a9869810 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG001_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG001_ARG.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_unused_arguments/mod.rs +source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs expression: diagnostics --- - kind: - UnusedFunctionArgument: - name: self + name: UnusedFunctionArgument + body: "Unused function argument: `self`" + commit: ~ + fixable: false location: row: 9 column: 6 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: x + name: UnusedFunctionArgument + body: "Unused function argument: `x`" + commit: ~ + fixable: false location: row: 9 column: 12 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: cls + name: UnusedFunctionArgument + body: "Unused function argument: `cls`" + commit: ~ + fixable: false location: row: 13 column: 6 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: x + name: UnusedFunctionArgument + body: "Unused function argument: `x`" + commit: ~ + fixable: false location: row: 13 column: 11 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: self + name: UnusedFunctionArgument + body: "Unused function argument: `self`" + commit: ~ + fixable: false location: row: 17 column: 6 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: x + name: UnusedFunctionArgument + body: "Unused function argument: `x`" + commit: ~ + fixable: false location: row: 17 column: 12 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: cls + name: UnusedFunctionArgument + body: "Unused function argument: `cls`" + commit: ~ + fixable: false location: row: 21 column: 6 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: x + name: UnusedFunctionArgument + body: "Unused function argument: `x`" + commit: ~ + fixable: false location: row: 21 column: 11 diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG002_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG002_ARG.py.snap index afbe78e018..c44cbe862a 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG002_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG002_ARG.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_unused_arguments/mod.rs +source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs expression: diagnostics --- - kind: - UnusedMethodArgument: - name: x + name: UnusedMethodArgument + body: "Unused method argument: `x`" + commit: ~ + fixable: false location: row: 35 column: 16 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedMethodArgument: - name: x + name: UnusedMethodArgument + body: "Unused method argument: `x`" + commit: ~ + fixable: false location: row: 38 column: 19 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedMethodArgument: - name: x + name: UnusedMethodArgument + body: "Unused method argument: `x`" + commit: ~ + fixable: false location: row: 41 column: 15 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedMethodArgument: - name: x + name: UnusedMethodArgument + body: "Unused method argument: `x`" + commit: ~ + fixable: false location: row: 190 column: 23 diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG003_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG003_ARG.py.snap index 2f2bc34e0d..094cb3c703 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG003_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG003_ARG.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_unused_arguments/mod.rs +source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs expression: diagnostics --- - kind: - UnusedClassMethodArgument: - name: x + name: UnusedClassMethodArgument + body: "Unused class method argument: `x`" + commit: ~ + fixable: false location: row: 45 column: 15 diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG004_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG004_ARG.py.snap index 99ce7a4598..c6ab12c733 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG004_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG004_ARG.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_unused_arguments/mod.rs +source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs expression: diagnostics --- - kind: - UnusedStaticMethodArgument: - name: cls + name: UnusedStaticMethodArgument + body: "Unused static method argument: `cls`" + commit: ~ + fixable: false location: row: 49 column: 10 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedStaticMethodArgument: - name: x + name: UnusedStaticMethodArgument + body: "Unused static method argument: `x`" + commit: ~ + fixable: false location: row: 49 column: 15 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedStaticMethodArgument: - name: x + name: UnusedStaticMethodArgument + body: "Unused static method argument: `x`" + commit: ~ + fixable: false location: row: 53 column: 10 diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG005_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG005_ARG.py.snap index be0832f12e..c02a1c1764 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG005_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG005_ARG.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_unused_arguments/mod.rs +source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs expression: diagnostics --- - kind: - UnusedLambdaArgument: - name: x + name: UnusedLambdaArgument + body: "Unused lambda argument: `x`" + commit: ~ + fixable: false location: row: 28 column: 7 diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__enforce_variadic_names.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__enforce_variadic_names.snap index 31dba57449..cace17089b 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__enforce_variadic_names.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__enforce_variadic_names.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_unused_arguments/mod.rs +source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs expression: diagnostics --- - kind: - UnusedFunctionArgument: - name: a + name: UnusedFunctionArgument + body: "Unused function argument: `a`" + commit: ~ + fixable: false location: row: 1 column: 6 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: b + name: UnusedFunctionArgument + body: "Unused function argument: `b`" + commit: ~ + fixable: false location: row: 1 column: 9 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: a + name: UnusedFunctionArgument + body: "Unused function argument: `a`" + commit: ~ + fixable: false location: row: 5 column: 6 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: b + name: UnusedFunctionArgument + body: "Unused function argument: `b`" + commit: ~ + fixable: false location: row: 5 column: 9 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: args + name: UnusedFunctionArgument + body: "Unused function argument: `args`" + commit: ~ + fixable: false location: row: 5 column: 13 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: kwargs + name: UnusedFunctionArgument + body: "Unused function argument: `kwargs`" + commit: ~ + fixable: false location: row: 5 column: 21 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedMethodArgument: - name: a + name: UnusedMethodArgument + body: "Unused method argument: `a`" + commit: ~ + fixable: false location: row: 10 column: 16 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedMethodArgument: - name: b + name: UnusedMethodArgument + body: "Unused method argument: `b`" + commit: ~ + fixable: false location: row: 10 column: 19 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedMethodArgument: - name: a + name: UnusedMethodArgument + body: "Unused method argument: `a`" + commit: ~ + fixable: false location: row: 13 column: 16 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedMethodArgument: - name: b + name: UnusedMethodArgument + body: "Unused method argument: `b`" + commit: ~ + fixable: false location: row: 13 column: 19 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedMethodArgument: - name: args + name: UnusedMethodArgument + body: "Unused method argument: `args`" + commit: ~ + fixable: false location: row: 13 column: 23 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedMethodArgument: - name: kwargs + name: UnusedMethodArgument + body: "Unused method argument: `kwargs`" + commit: ~ + fixable: false location: row: 13 column: 31 diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ignore_variadic_names.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ignore_variadic_names.snap index 2711437a91..36c04e7145 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ignore_variadic_names.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ignore_variadic_names.snap @@ -1,10 +1,12 @@ --- -source: src/rules/flake8_unused_arguments/mod.rs +source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs expression: diagnostics --- - kind: - UnusedFunctionArgument: - name: a + name: UnusedFunctionArgument + body: "Unused function argument: `a`" + commit: ~ + fixable: false location: row: 1 column: 6 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: b + name: UnusedFunctionArgument + body: "Unused function argument: `b`" + commit: ~ + fixable: false location: row: 1 column: 9 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: a + name: UnusedFunctionArgument + body: "Unused function argument: `a`" + commit: ~ + fixable: false location: row: 5 column: 6 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedFunctionArgument: - name: b + name: UnusedFunctionArgument + body: "Unused function argument: `b`" + commit: ~ + fixable: false location: row: 5 column: 9 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedMethodArgument: - name: a + name: UnusedMethodArgument + body: "Unused method argument: `a`" + commit: ~ + fixable: false location: row: 10 column: 16 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedMethodArgument: - name: b + name: UnusedMethodArgument + body: "Unused method argument: `b`" + commit: ~ + fixable: false location: row: 10 column: 19 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedMethodArgument: - name: a + name: UnusedMethodArgument + body: "Unused method argument: `a`" + commit: ~ + fixable: false location: row: 13 column: 16 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedMethodArgument: - name: b + name: UnusedMethodArgument + body: "Unused method argument: `b`" + commit: ~ + fixable: false location: row: 13 column: 19 diff --git a/crates/ruff/src/rules/flake8_use_pathlib/helpers.rs b/crates/ruff/src/rules/flake8_use_pathlib/helpers.rs index 6113133e0f..2e5fd54f4e 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/helpers.rs +++ b/crates/ruff/src/rules/flake8_use_pathlib/helpers.rs @@ -3,7 +3,7 @@ use rustpython_parser::ast::Expr; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::{Diagnostic, DiagnosticKind}; +use crate::registry::{AsRule, Diagnostic, DiagnosticKind}; use crate::rules::flake8_use_pathlib::violations::{ PathlibAbspath, PathlibBasename, PathlibChmod, PathlibDirname, PathlibExists, PathlibExpanduser, PathlibGetcwd, PathlibIsAbs, PathlibIsDir, PathlibIsFile, PathlibIsLink, diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap index b273639524..461a3f9ef1 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_use_pathlib/mod.rs +source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs expression: diagnostics --- - kind: - PathlibPyPath: ~ + name: PathlibPyPath + body: "`py.path` is in maintenance mode, use `pathlib` instead" + commit: ~ + fixable: false location: row: 3 column: 4 diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap index c5f6ad5501..33a83eb7da 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_use_pathlib/mod.rs +source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs expression: diagnostics --- - kind: - PathlibPyPath: ~ + name: PathlibPyPath + body: "`py.path` is in maintenance mode, use `pathlib` instead" + commit: ~ + fixable: false location: row: 3 column: 4 diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__full_name.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__full_name.py.snap index 4ab33e250a..de019571c4 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__full_name.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__full_name.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_use_pathlib/mod.rs +source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs expression: diagnostics --- - kind: - PathlibAbspath: ~ + name: PathlibAbspath + body: "`os.path.abspath()` should be replaced by `Path.resolve()`" + commit: ~ + fixable: false location: row: 6 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibChmod: ~ + name: PathlibChmod + body: "`os.chmod()` should be replaced by `Path.chmod()`" + commit: ~ + fixable: false location: row: 7 column: 5 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibMkdir: ~ + name: PathlibMkdir + body: "`os.mkdir()` should be replaced by `Path.mkdir()`" + commit: ~ + fixable: false location: row: 8 column: 6 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibMakedirs: ~ + name: PathlibMakedirs + body: "`os.makedirs()` should be replaced by `Path.mkdir(parents=True)`" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibRename: ~ + name: PathlibRename + body: "`os.rename()` should be replaced by `Path.rename()`" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibReplace: ~ + name: PathlibReplace + body: "`os.replace()` should be replaced by `Path.replace()`" + commit: ~ + fixable: false location: row: 11 column: 0 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibRmdir: ~ + name: PathlibRmdir + body: "`os.rmdir()` should be replaced by `Path.rmdir()`" + commit: ~ + fixable: false location: row: 12 column: 0 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibRemove: ~ + name: PathlibRemove + body: "`os.remove()` should be replaced by `Path.unlink()`" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibUnlink: ~ + name: PathlibUnlink + body: "`os.unlink()` should be replaced by `Path.unlink()`" + commit: ~ + fixable: false location: row: 14 column: 0 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibGetcwd: ~ + name: PathlibGetcwd + body: "`os.getcwd()` should be replaced by `Path.cwd()`" + commit: ~ + fixable: false location: row: 15 column: 0 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibExists: ~ + name: PathlibExists + body: "`os.path.exists()` should be replaced by `Path.exists()`" + commit: ~ + fixable: false location: row: 16 column: 4 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibExpanduser: ~ + name: PathlibExpanduser + body: "`os.path.expanduser()` should be replaced by `Path.expanduser()`" + commit: ~ + fixable: false location: row: 17 column: 5 @@ -123,7 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsDir: ~ + name: PathlibIsDir + body: "`os.path.isdir()` should be replaced by `Path.is_dir()`" + commit: ~ + fixable: false location: row: 18 column: 6 @@ -133,7 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsFile: ~ + name: PathlibIsFile + body: "`os.path.isfile()` should be replaced by `Path.is_file()`" + commit: ~ + fixable: false location: row: 19 column: 7 @@ -143,7 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsLink: ~ + name: PathlibIsLink + body: "`os.path.islink()` should be replaced by `Path.is_symlink()`" + commit: ~ + fixable: false location: row: 20 column: 8 @@ -153,7 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibReadlink: ~ + name: PathlibReadlink + body: "`os.readlink()` should be replaced by `Path.readlink()`" + commit: ~ + fixable: false location: row: 21 column: 0 @@ -163,7 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibStat: ~ + name: PathlibStat + body: "`os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`" + commit: ~ + fixable: false location: row: 22 column: 0 @@ -173,7 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsAbs: ~ + name: PathlibIsAbs + body: "`os.path.isabs()` should be replaced by `Path.is_absolute()`" + commit: ~ + fixable: false location: row: 23 column: 0 @@ -183,7 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibJoin: ~ + name: PathlibJoin + body: "`os.path.join()` should be replaced by `Path` with `/` operator" + commit: ~ + fixable: false location: row: 24 column: 0 @@ -193,7 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibBasename: ~ + name: PathlibBasename + body: "`os.path.basename()` should be replaced by `Path.name`" + commit: ~ + fixable: false location: row: 25 column: 0 @@ -203,7 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibDirname: ~ + name: PathlibDirname + body: "`os.path.dirname()` should be replaced by `Path.parent`" + commit: ~ + fixable: false location: row: 26 column: 0 @@ -213,7 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibSamefile: ~ + name: PathlibSamefile + body: "`os.path.samefile()` should be replaced by `Path.samefile()`" + commit: ~ + fixable: false location: row: 27 column: 0 @@ -223,7 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibSplitext: ~ + name: PathlibSplitext + body: "`os.path.splitext()` should be replaced by `Path.suffix`" + commit: ~ + fixable: false location: row: 28 column: 0 @@ -233,7 +302,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibOpen: ~ + name: PathlibOpen + body: "`open()` should be replaced by `Path.open()`" + commit: ~ + fixable: false location: row: 29 column: 5 @@ -243,7 +315,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibOpen: ~ + name: PathlibOpen + body: "`open()` should be replaced by `Path.open()`" + commit: ~ + fixable: false location: row: 31 column: 0 @@ -253,7 +328,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibGetcwd: ~ + name: PathlibGetcwd + body: "`os.getcwd()` should be replaced by `Path.cwd()`" + commit: ~ + fixable: false location: row: 32 column: 0 diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_as.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_as.py.snap index 956e8e62b6..70f98723e4 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_as.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_as.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_use_pathlib/mod.rs +source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs expression: diagnostics --- - kind: - PathlibAbspath: ~ + name: PathlibAbspath + body: "`os.path.abspath()` should be replaced by `Path.resolve()`" + commit: ~ + fixable: false location: row: 6 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibChmod: ~ + name: PathlibChmod + body: "`os.chmod()` should be replaced by `Path.chmod()`" + commit: ~ + fixable: false location: row: 7 column: 5 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibMkdir: ~ + name: PathlibMkdir + body: "`os.mkdir()` should be replaced by `Path.mkdir()`" + commit: ~ + fixable: false location: row: 8 column: 6 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibMakedirs: ~ + name: PathlibMakedirs + body: "`os.makedirs()` should be replaced by `Path.mkdir(parents=True)`" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibRename: ~ + name: PathlibRename + body: "`os.rename()` should be replaced by `Path.rename()`" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibReplace: ~ + name: PathlibReplace + body: "`os.replace()` should be replaced by `Path.replace()`" + commit: ~ + fixable: false location: row: 11 column: 0 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibRmdir: ~ + name: PathlibRmdir + body: "`os.rmdir()` should be replaced by `Path.rmdir()`" + commit: ~ + fixable: false location: row: 12 column: 0 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibRemove: ~ + name: PathlibRemove + body: "`os.remove()` should be replaced by `Path.unlink()`" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibUnlink: ~ + name: PathlibUnlink + body: "`os.unlink()` should be replaced by `Path.unlink()`" + commit: ~ + fixable: false location: row: 14 column: 0 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibGetcwd: ~ + name: PathlibGetcwd + body: "`os.getcwd()` should be replaced by `Path.cwd()`" + commit: ~ + fixable: false location: row: 15 column: 0 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibExists: ~ + name: PathlibExists + body: "`os.path.exists()` should be replaced by `Path.exists()`" + commit: ~ + fixable: false location: row: 16 column: 4 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibExpanduser: ~ + name: PathlibExpanduser + body: "`os.path.expanduser()` should be replaced by `Path.expanduser()`" + commit: ~ + fixable: false location: row: 17 column: 5 @@ -123,7 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsDir: ~ + name: PathlibIsDir + body: "`os.path.isdir()` should be replaced by `Path.is_dir()`" + commit: ~ + fixable: false location: row: 18 column: 6 @@ -133,7 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsFile: ~ + name: PathlibIsFile + body: "`os.path.isfile()` should be replaced by `Path.is_file()`" + commit: ~ + fixable: false location: row: 19 column: 7 @@ -143,7 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsLink: ~ + name: PathlibIsLink + body: "`os.path.islink()` should be replaced by `Path.is_symlink()`" + commit: ~ + fixable: false location: row: 20 column: 8 @@ -153,7 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibReadlink: ~ + name: PathlibReadlink + body: "`os.readlink()` should be replaced by `Path.readlink()`" + commit: ~ + fixable: false location: row: 21 column: 0 @@ -163,7 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibStat: ~ + name: PathlibStat + body: "`os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`" + commit: ~ + fixable: false location: row: 22 column: 0 @@ -173,7 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsAbs: ~ + name: PathlibIsAbs + body: "`os.path.isabs()` should be replaced by `Path.is_absolute()`" + commit: ~ + fixable: false location: row: 23 column: 0 @@ -183,7 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibJoin: ~ + name: PathlibJoin + body: "`os.path.join()` should be replaced by `Path` with `/` operator" + commit: ~ + fixable: false location: row: 24 column: 0 @@ -193,7 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibBasename: ~ + name: PathlibBasename + body: "`os.path.basename()` should be replaced by `Path.name`" + commit: ~ + fixable: false location: row: 25 column: 0 @@ -203,7 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibDirname: ~ + name: PathlibDirname + body: "`os.path.dirname()` should be replaced by `Path.parent`" + commit: ~ + fixable: false location: row: 26 column: 0 @@ -213,7 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibSamefile: ~ + name: PathlibSamefile + body: "`os.path.samefile()` should be replaced by `Path.samefile()`" + commit: ~ + fixable: false location: row: 27 column: 0 @@ -223,7 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibSplitext: ~ + name: PathlibSplitext + body: "`os.path.splitext()` should be replaced by `Path.suffix`" + commit: ~ + fixable: false location: row: 28 column: 0 diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from.py.snap index a3f6ff105b..5d1b36499a 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_use_pathlib/mod.rs +source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs expression: diagnostics --- - kind: - PathlibAbspath: ~ + name: PathlibAbspath + body: "`os.path.abspath()` should be replaced by `Path.resolve()`" + commit: ~ + fixable: false location: row: 8 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibChmod: ~ + name: PathlibChmod + body: "`os.chmod()` should be replaced by `Path.chmod()`" + commit: ~ + fixable: false location: row: 9 column: 5 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibMkdir: ~ + name: PathlibMkdir + body: "`os.mkdir()` should be replaced by `Path.mkdir()`" + commit: ~ + fixable: false location: row: 10 column: 6 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibMakedirs: ~ + name: PathlibMakedirs + body: "`os.makedirs()` should be replaced by `Path.mkdir(parents=True)`" + commit: ~ + fixable: false location: row: 11 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibRename: ~ + name: PathlibRename + body: "`os.rename()` should be replaced by `Path.rename()`" + commit: ~ + fixable: false location: row: 12 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibReplace: ~ + name: PathlibReplace + body: "`os.replace()` should be replaced by `Path.replace()`" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibRmdir: ~ + name: PathlibRmdir + body: "`os.rmdir()` should be replaced by `Path.rmdir()`" + commit: ~ + fixable: false location: row: 14 column: 0 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibRemove: ~ + name: PathlibRemove + body: "`os.remove()` should be replaced by `Path.unlink()`" + commit: ~ + fixable: false location: row: 15 column: 0 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibUnlink: ~ + name: PathlibUnlink + body: "`os.unlink()` should be replaced by `Path.unlink()`" + commit: ~ + fixable: false location: row: 16 column: 0 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibGetcwd: ~ + name: PathlibGetcwd + body: "`os.getcwd()` should be replaced by `Path.cwd()`" + commit: ~ + fixable: false location: row: 17 column: 0 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibExists: ~ + name: PathlibExists + body: "`os.path.exists()` should be replaced by `Path.exists()`" + commit: ~ + fixable: false location: row: 18 column: 4 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibExpanduser: ~ + name: PathlibExpanduser + body: "`os.path.expanduser()` should be replaced by `Path.expanduser()`" + commit: ~ + fixable: false location: row: 19 column: 5 @@ -123,7 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsDir: ~ + name: PathlibIsDir + body: "`os.path.isdir()` should be replaced by `Path.is_dir()`" + commit: ~ + fixable: false location: row: 20 column: 6 @@ -133,7 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsFile: ~ + name: PathlibIsFile + body: "`os.path.isfile()` should be replaced by `Path.is_file()`" + commit: ~ + fixable: false location: row: 21 column: 7 @@ -143,7 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsLink: ~ + name: PathlibIsLink + body: "`os.path.islink()` should be replaced by `Path.is_symlink()`" + commit: ~ + fixable: false location: row: 22 column: 8 @@ -153,7 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibReadlink: ~ + name: PathlibReadlink + body: "`os.readlink()` should be replaced by `Path.readlink()`" + commit: ~ + fixable: false location: row: 23 column: 0 @@ -163,7 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibStat: ~ + name: PathlibStat + body: "`os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`" + commit: ~ + fixable: false location: row: 24 column: 0 @@ -173,7 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsAbs: ~ + name: PathlibIsAbs + body: "`os.path.isabs()` should be replaced by `Path.is_absolute()`" + commit: ~ + fixable: false location: row: 25 column: 0 @@ -183,7 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibJoin: ~ + name: PathlibJoin + body: "`os.path.join()` should be replaced by `Path` with `/` operator" + commit: ~ + fixable: false location: row: 26 column: 0 @@ -193,7 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibBasename: ~ + name: PathlibBasename + body: "`os.path.basename()` should be replaced by `Path.name`" + commit: ~ + fixable: false location: row: 27 column: 0 @@ -203,7 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibDirname: ~ + name: PathlibDirname + body: "`os.path.dirname()` should be replaced by `Path.parent`" + commit: ~ + fixable: false location: row: 28 column: 0 @@ -213,7 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibSamefile: ~ + name: PathlibSamefile + body: "`os.path.samefile()` should be replaced by `Path.samefile()`" + commit: ~ + fixable: false location: row: 29 column: 0 @@ -223,7 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibSplitext: ~ + name: PathlibSplitext + body: "`os.path.splitext()` should be replaced by `Path.suffix`" + commit: ~ + fixable: false location: row: 30 column: 0 @@ -233,7 +302,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibOpen: ~ + name: PathlibOpen + body: "`open()` should be replaced by `Path.open()`" + commit: ~ + fixable: false location: row: 31 column: 5 @@ -243,7 +315,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibOpen: ~ + name: PathlibOpen + body: "`open()` should be replaced by `Path.open()`" + commit: ~ + fixable: false location: row: 33 column: 0 diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from_as.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from_as.py.snap index f0ae20f26d..ff444058fc 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from_as.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from_as.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/flake8_use_pathlib/mod.rs +source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs expression: diagnostics --- - kind: - PathlibAbspath: ~ + name: PathlibAbspath + body: "`os.path.abspath()` should be replaced by `Path.resolve()`" + commit: ~ + fixable: false location: row: 13 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibChmod: ~ + name: PathlibChmod + body: "`os.chmod()` should be replaced by `Path.chmod()`" + commit: ~ + fixable: false location: row: 14 column: 5 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibMkdir: ~ + name: PathlibMkdir + body: "`os.mkdir()` should be replaced by `Path.mkdir()`" + commit: ~ + fixable: false location: row: 15 column: 6 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibMakedirs: ~ + name: PathlibMakedirs + body: "`os.makedirs()` should be replaced by `Path.mkdir(parents=True)`" + commit: ~ + fixable: false location: row: 16 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibRename: ~ + name: PathlibRename + body: "`os.rename()` should be replaced by `Path.rename()`" + commit: ~ + fixable: false location: row: 17 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibReplace: ~ + name: PathlibReplace + body: "`os.replace()` should be replaced by `Path.replace()`" + commit: ~ + fixable: false location: row: 18 column: 0 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibRmdir: ~ + name: PathlibRmdir + body: "`os.rmdir()` should be replaced by `Path.rmdir()`" + commit: ~ + fixable: false location: row: 19 column: 0 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibRemove: ~ + name: PathlibRemove + body: "`os.remove()` should be replaced by `Path.unlink()`" + commit: ~ + fixable: false location: row: 20 column: 0 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibUnlink: ~ + name: PathlibUnlink + body: "`os.unlink()` should be replaced by `Path.unlink()`" + commit: ~ + fixable: false location: row: 21 column: 0 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibGetcwd: ~ + name: PathlibGetcwd + body: "`os.getcwd()` should be replaced by `Path.cwd()`" + commit: ~ + fixable: false location: row: 22 column: 0 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibExists: ~ + name: PathlibExists + body: "`os.path.exists()` should be replaced by `Path.exists()`" + commit: ~ + fixable: false location: row: 23 column: 4 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibExpanduser: ~ + name: PathlibExpanduser + body: "`os.path.expanduser()` should be replaced by `Path.expanduser()`" + commit: ~ + fixable: false location: row: 24 column: 5 @@ -123,7 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsDir: ~ + name: PathlibIsDir + body: "`os.path.isdir()` should be replaced by `Path.is_dir()`" + commit: ~ + fixable: false location: row: 25 column: 6 @@ -133,7 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsFile: ~ + name: PathlibIsFile + body: "`os.path.isfile()` should be replaced by `Path.is_file()`" + commit: ~ + fixable: false location: row: 26 column: 7 @@ -143,7 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsLink: ~ + name: PathlibIsLink + body: "`os.path.islink()` should be replaced by `Path.is_symlink()`" + commit: ~ + fixable: false location: row: 27 column: 8 @@ -153,7 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibReadlink: ~ + name: PathlibReadlink + body: "`os.readlink()` should be replaced by `Path.readlink()`" + commit: ~ + fixable: false location: row: 28 column: 0 @@ -163,7 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibStat: ~ + name: PathlibStat + body: "`os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`" + commit: ~ + fixable: false location: row: 29 column: 0 @@ -173,7 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibIsAbs: ~ + name: PathlibIsAbs + body: "`os.path.isabs()` should be replaced by `Path.is_absolute()`" + commit: ~ + fixable: false location: row: 30 column: 0 @@ -183,7 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibJoin: ~ + name: PathlibJoin + body: "`os.path.join()` should be replaced by `Path` with `/` operator" + commit: ~ + fixable: false location: row: 31 column: 0 @@ -193,7 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibBasename: ~ + name: PathlibBasename + body: "`os.path.basename()` should be replaced by `Path.name`" + commit: ~ + fixable: false location: row: 32 column: 0 @@ -203,7 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibDirname: ~ + name: PathlibDirname + body: "`os.path.dirname()` should be replaced by `Path.parent`" + commit: ~ + fixable: false location: row: 33 column: 0 @@ -213,7 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibSamefile: ~ + name: PathlibSamefile + body: "`os.path.samefile()` should be replaced by `Path.samefile()`" + commit: ~ + fixable: false location: row: 34 column: 0 @@ -223,7 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PathlibSplitext: ~ + name: PathlibSplitext + body: "`os.path.splitext()` should be replaced by `Path.suffix`" + commit: ~ + fixable: false location: row: 35 column: 0 diff --git a/crates/ruff/src/rules/isort/rules/organize_imports.rs b/crates/ruff/src/rules/isort/rules/organize_imports.rs index a7628e46cc..b288a9d3d4 100644 --- a/crates/ruff/src/rules/isort/rules/organize_imports.rs +++ b/crates/ruff/src/rules/isort/rules/organize_imports.rs @@ -13,7 +13,7 @@ use ruff_python_ast::types::Range; use ruff_python_ast::whitespace::leading_space; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::settings::{flags, Settings}; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__add_newline_before_comments.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__add_newline_before_comments.py.snap index 6cd28a1320..2ae1a6eb3a 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__add_newline_before_comments.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__add_newline_before_comments.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__as_imports_comments.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__as_imports_comments.py.snap index c97e326ce7..dc88c9352f 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__as_imports_comments.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__as_imports_comments.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap index 07e573e438..439506037c 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports.py.snap index 5e6448b3c1..7aad86f7ed 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap index 6a07eca41b..cd9b7fd626 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_import_from.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_import_from.py.snap index 52ec728dec..b6aee4b0c3 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_import_from.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_import_from.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring.py.snap index 6b9ad51085..55ab4530f6 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - MissingRequiredImport: from __future__ import annotations + name: MissingRequiredImport + body: "Missing required import: `from __future__ import annotations`" + commit: "Insert required import: `from __future__ import annotations`" + fixable: true location: row: 1 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - MissingRequiredImport: from __future__ import generator_stop + name: MissingRequiredImport + body: "Missing required import: `from __future__ import generator_stop`" + commit: "Insert required import: `from __future__ import generator_stop`" + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__comments.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__comments.py.snap index 627d9a03c6..30785c5101 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__comments.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__comments.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 3 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__deduplicate_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__deduplicate_imports.py.snap index 3969511bf7..da7bf82218 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__deduplicate_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__deduplicate_imports.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length.py.snap index e7977fa9ea..8ecbecb357 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 7 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length_comment.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length_comment.py.snap index a02b44f1d1..1d269b6e7c 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length_comment.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length_comment.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_single_line_force_single_line.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_single_line_force_single_line.py.snap index 852f462410..319ed09a74 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_single_line_force_single_line.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_single_line_force_single_line.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections.py.snap index 70944eca21..f3df96035d 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap index 2f33a480ed..5191fb35d7 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top.py.snap index be80bdaa65..b34ca2fc9b 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top_force_to_top.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top_force_to_top.py.snap index 1032522157..e0fea0b8aa 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top_force_to_top.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top_force_to_top.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases.py.snap index a059d60d49..909d1f4417 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap index 7a43c7a208..35b332dda2 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__forced_separate.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__forced_separate.py.snap index 4211946b75..6cdf4ba1e2 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__forced_separate.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__forced_separate.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 3 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__import_from_after_import.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__import_from_after_import.py.snap index fd85ecdbcd..bff24d4de3 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__import_from_after_import.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__import_from_after_import.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__inline_comments.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__inline_comments.py.snap index d3c9c09859..79c12bdb2a 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__inline_comments.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__inline_comments.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.py.snap index 4993e3e8ff..70151a8eb7 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 4 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 14 column: 0 @@ -54,7 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 52 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.pyi.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.pyi.snap index df03e36317..96c1f9fd8f 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.pyi.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.pyi.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 4 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 14 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap index cb3166b311..4ddd703e55 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__leading_prefix.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__leading_prefix.py.snap index 954c01e45b..2e51da91bf 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__leading_prefix.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__leading_prefix.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 7 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 5 column: 11 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 10 column: 8 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 13 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap index a224584c0e..168b5a5daa 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap index d868acc23c..69f89b6be2 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap index 29794d3946..a54253b8f1 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_between_typeslines_between_types.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_between_typeslines_between_types.py.snap index 363cacf044..e5648de827 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_between_typeslines_between_types.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_between_typeslines_between_types.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__magic_trailing_comma.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__magic_trailing_comma.py.snap index 0f58a62501..d6c859580d 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__magic_trailing_comma.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__magic_trailing_comma.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 2 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__natural_order.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__natural_order.py.snap index 9d55bfab7c..551bfa1fa5 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__natural_order.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__natural_order.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py.snap index 29794d3946..a54253b8f1 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap index 2a07a22abb..e7cc92dd67 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap index 40fddb14bc..79f48d626e 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_wrap_star.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_wrap_star.py.snap index a139b135e1..b333d4dbfc 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_wrap_star.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_wrap_star.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type.py.snap index 90657459c8..0b77edbbb9 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_false_order_by_type.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_false_order_by_type.py.snap index 1acbe697fa..b12d99a77a 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_false_order_by_type.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_false_order_by_type.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes.py.snap index fc71e49a11..b7d07c5373 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap index 212e36d9c9..10de3d3d22 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants.py.snap index 2c0d46a169..7cdb76ec83 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap index a1ef2118c2..15252e4b31 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables.py.snap index d2f72fc42a..8f56057a40 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap index 36e807c289..d6c1f23523 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_relative_imports_by_level.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_relative_imports_by_level.py.snap index 852ae2918f..81c5edb7ab 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_relative_imports_by_level.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_relative_imports_by_level.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_comment_order.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_comment_order.py.snap index 3e14b9dc4a..2b8e90c630 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_comment_order.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_comment_order.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_import_star.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_import_star.py.snap index c3b786dbba..9bb276684b 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_import_star.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_import_star.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_indentation.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_indentation.py.snap index 907ff8a5cd..a3402d80ab 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_indentation.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_indentation.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 2 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 5 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__reorder_within_section.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__reorder_within_section.py.snap index 0e4ceb95be..34089f4e0a 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__reorder_within_section.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__reorder_within_section.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring.py.snap index 705a19d977..485d122954 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - MissingRequiredImport: from __future__ import annotations + name: MissingRequiredImport + body: "Missing required import: `from __future__ import annotations`" + commit: "Insert required import: `from __future__ import annotations`" + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_multiline_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_multiline_docstring.py.snap index 313ea8a927..a2a9e3f035 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_multiline_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_multiline_docstring.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - MissingRequiredImport: from __future__ import annotations + name: MissingRequiredImport + body: "Missing required import: `from __future__ import annotations`" + commit: "Insert required import: `from __future__ import annotations`" + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring.py.snap index 6b9ad51085..55ab4530f6 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - MissingRequiredImport: from __future__ import annotations + name: MissingRequiredImport + body: "Missing required import: `from __future__ import annotations`" + commit: "Insert required import: `from __future__ import annotations`" + fixable: true location: row: 1 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - MissingRequiredImport: from __future__ import generator_stop + name: MissingRequiredImport + body: "Missing required import: `from __future__ import generator_stop`" + commit: "Insert required import: `from __future__ import generator_stop`" + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_first_party_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_first_party_imports.py.snap index a7a6e2494c..771782f8f9 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_first_party_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_first_party_imports.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_future_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_future_imports.py.snap index ad6cbfab76..4dd3badfcb 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_future_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_future_imports.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_local_folder_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_local_folder_imports.py.snap index dbd110d472..81fe0e1d5e 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_local_folder_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_local_folder_imports.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_third_party_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_third_party_imports.py.snap index a893e93551..8a628762d5 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_third_party_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_third_party_imports.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__skip.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__skip.py.snap index 8fb4c6d4c6..b45c7c97f7 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__skip.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__skip.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 12 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 19 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__sort_similar_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__sort_similar_imports.py.snap index 921b70a364..52ce194852 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__sort_similar_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__sort_similar_imports.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap index 7f73183d61..3c683fc1dd 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 2 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__star_before_others.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__star_before_others.py.snap index 8c5e5113f1..9f877097d3 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__star_before_others.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__star_before_others.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring.py.snap index 3ce497f891..570f24d749 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - MissingRequiredImport: import os + name: MissingRequiredImport + body: "Missing required import: `import os`" + commit: "Insert required import: `import os`" + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__trailing_suffix.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__trailing_suffix.py.snap index ecc01703d6..ccd27804c5 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__trailing_suffix.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__trailing_suffix.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 1 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnsortedImports: ~ + name: UnsortedImports + body: Import block is un-sorted or un-formatted + commit: Organize imports + fixable: true location: row: 5 column: 4 diff --git a/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_0.snap b/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_0.snap index 7caf6b07fd..48f32b98f2 100644 --- a/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_0.snap +++ b/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_0.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/mccabe/mod.rs expression: diagnostics --- - kind: - ComplexStructure: - name: trivial - complexity: 1 + name: ComplexStructure + body: "`trivial` is too complex (1)" + commit: ~ + fixable: false location: row: 2 column: 4 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: expr_as_statement - complexity: 1 + name: ComplexStructure + body: "`expr_as_statement` is too complex (1)" + commit: ~ + fixable: false location: row: 7 column: 4 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: sequential - complexity: 1 + name: ComplexStructure + body: "`sequential` is too complex (1)" + commit: ~ + fixable: false location: row: 12 column: 4 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: if_elif_else_dead_path - complexity: 3 + name: ComplexStructure + body: "`if_elif_else_dead_path` is too complex (3)" + commit: ~ + fixable: false location: row: 19 column: 4 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: nested_ifs - complexity: 3 + name: ComplexStructure + body: "`nested_ifs` is too complex (3)" + commit: ~ + fixable: false location: row: 29 column: 4 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: for_loop - complexity: 2 + name: ComplexStructure + body: "`for_loop` is too complex (2)" + commit: ~ + fixable: false location: row: 40 column: 4 @@ -75,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: for_else - complexity: 2 + name: ComplexStructure + body: "`for_else` is too complex (2)" + commit: ~ + fixable: false location: row: 46 column: 4 @@ -87,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: recursive - complexity: 2 + name: ComplexStructure + body: "`recursive` is too complex (2)" + commit: ~ + fixable: false location: row: 54 column: 4 @@ -99,9 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: nested_functions - complexity: 3 + name: ComplexStructure + body: "`nested_functions` is too complex (3)" + commit: ~ + fixable: false location: row: 62 column: 4 @@ -111,9 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: a - complexity: 2 + name: ComplexStructure + body: "`a` is too complex (2)" + commit: ~ + fixable: false location: row: 63 column: 8 @@ -123,9 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: b - complexity: 1 + name: ComplexStructure + body: "`b` is too complex (1)" + commit: ~ + fixable: false location: row: 64 column: 12 @@ -135,9 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: try_else - complexity: 4 + name: ComplexStructure + body: "`try_else` is too complex (4)" + commit: ~ + fixable: false location: row: 73 column: 4 @@ -147,9 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: nested_try_finally - complexity: 3 + name: ComplexStructure + body: "`nested_try_finally` is too complex (3)" + commit: ~ + fixable: false location: row: 85 column: 4 @@ -159,9 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: foobar - complexity: 3 + name: ComplexStructure + body: "`foobar` is too complex (3)" + commit: ~ + fixable: false location: row: 96 column: 10 @@ -171,9 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: annotated_assign - complexity: 1 + name: ComplexStructure + body: "`annotated_assign` is too complex (1)" + commit: ~ + fixable: false location: row: 107 column: 4 @@ -183,9 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: handle - complexity: 9 + name: ComplexStructure + body: "`handle` is too complex (9)" + commit: ~ + fixable: false location: row: 113 column: 8 @@ -195,9 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: a - complexity: 1 + name: ComplexStructure + body: "`a` is too complex (1)" + commit: ~ + fixable: false location: row: 118 column: 16 @@ -207,9 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: b - complexity: 2 + name: ComplexStructure + body: "`b` is too complex (2)" + commit: ~ + fixable: false location: row: 121 column: 16 @@ -219,9 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: c - complexity: 1 + name: ComplexStructure + body: "`c` is too complex (1)" + commit: ~ + fixable: false location: row: 126 column: 16 @@ -231,9 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: error - complexity: 1 + name: ComplexStructure + body: "`error` is too complex (1)" + commit: ~ + fixable: false location: row: 129 column: 16 @@ -243,9 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: info - complexity: 1 + name: ComplexStructure + body: "`info` is too complex (1)" + commit: ~ + fixable: false location: row: 132 column: 16 @@ -255,9 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: exception - complexity: 1 + name: ComplexStructure + body: "`exception` is too complex (1)" + commit: ~ + fixable: false location: row: 135 column: 16 diff --git a/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_3.snap b/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_3.snap index 46bd4bffe1..0b648112cc 100644 --- a/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_3.snap +++ b/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_3.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/mccabe/mod.rs expression: diagnostics --- - kind: - ComplexStructure: - name: try_else - complexity: 4 + name: ComplexStructure + body: "`try_else` is too complex (4)" + commit: ~ + fixable: false location: row: 73 column: 4 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComplexStructure: - name: handle - complexity: 9 + name: ComplexStructure + body: "`handle` is too complex (9)" + commit: ~ + fixable: false location: row: 113 column: 8 diff --git a/crates/ruff/src/rules/numpy/rules/deprecated_type_alias.rs b/crates/ruff/src/rules/numpy/rules/deprecated_type_alias.rs index 009cea214d..8d08296972 100644 --- a/crates/ruff/src/rules/numpy/rules/deprecated_type_alias.rs +++ b/crates/ruff/src/rules/numpy/rules/deprecated_type_alias.rs @@ -5,7 +5,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; /// ## What it does diff --git a/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap b/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap index d1fd8c6b93..fcab6eaabf 100644 --- a/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap +++ b/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/numpy/mod.rs expression: diagnostics --- - kind: - NumpyDeprecatedTypeAlias: - type_name: bool + name: NumpyDeprecatedTypeAlias + body: "Type alias `np.bool` is deprecated, replace with builtin type" + commit: "Replace `np.bool` with builtin type" + fixable: true location: row: 6 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - NumpyDeprecatedTypeAlias: - type_name: int + name: NumpyDeprecatedTypeAlias + body: "Type alias `np.int` is deprecated, replace with builtin type" + commit: "Replace `np.int` with builtin type" + fixable: true location: row: 7 column: 0 @@ -39,8 +43,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - NumpyDeprecatedTypeAlias: - type_name: object + name: NumpyDeprecatedTypeAlias + body: "Type alias `np.object` is deprecated, replace with builtin type" + commit: "Replace `np.object` with builtin type" + fixable: true location: row: 9 column: 12 @@ -57,8 +63,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - NumpyDeprecatedTypeAlias: - type_name: int + name: NumpyDeprecatedTypeAlias + body: "Type alias `np.int` is deprecated, replace with builtin type" + commit: "Replace `np.int` with builtin type" + fixable: true location: row: 12 column: 71 @@ -75,8 +83,10 @@ expression: diagnostics column: 77 parent: ~ - kind: - NumpyDeprecatedTypeAlias: - type_name: long + name: NumpyDeprecatedTypeAlias + body: "Type alias `np.long` is deprecated, replace with builtin type" + commit: "Replace `np.long` with builtin type" + fixable: true location: row: 12 column: 79 @@ -93,8 +103,10 @@ expression: diagnostics column: 86 parent: ~ - kind: - NumpyDeprecatedTypeAlias: - type_name: object + name: NumpyDeprecatedTypeAlias + body: "Type alias `np.object` is deprecated, replace with builtin type" + commit: "Replace `np.object` with builtin type" + fixable: true location: row: 17 column: 10 @@ -111,8 +123,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - NumpyDeprecatedTypeAlias: - type_name: int + name: NumpyDeprecatedTypeAlias + body: "Type alias `np.int` is deprecated, replace with builtin type" + commit: "Replace `np.int` with builtin type" + fixable: true location: row: 20 column: 15 diff --git a/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap b/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap index d572ce9822..16f4a52ab3 100644 --- a/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap +++ b/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/numpy/mod.rs expression: diagnostics --- - kind: - NumpyLegacyRandom: - method_name: standard_normal + name: NumpyLegacyRandom + body: "Replace legacy `np.random.standard_normal` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 10 column: 7 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: standard_normal + name: NumpyLegacyRandom + body: "Replace legacy `np.random.standard_normal` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 11 column: 12 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: seed + name: NumpyLegacyRandom + body: "Replace legacy `np.random.seed` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 15 column: 0 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: get_state + name: NumpyLegacyRandom + body: "Replace legacy `np.random.get_state` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 16 column: 0 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: set_state + name: NumpyLegacyRandom + body: "Replace legacy `np.random.set_state` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 17 column: 0 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: rand + name: NumpyLegacyRandom + body: "Replace legacy `np.random.rand` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 18 column: 0 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: randn + name: NumpyLegacyRandom + body: "Replace legacy `np.random.randn` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 19 column: 0 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: randint + name: NumpyLegacyRandom + body: "Replace legacy `np.random.randint` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 20 column: 0 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: random_integers + name: NumpyLegacyRandom + body: "Replace legacy `np.random.random_integers` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 21 column: 0 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: random_sample + name: NumpyLegacyRandom + body: "Replace legacy `np.random.random_sample` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 22 column: 0 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: choice + name: NumpyLegacyRandom + body: "Replace legacy `np.random.choice` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 23 column: 0 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: bytes + name: NumpyLegacyRandom + body: "Replace legacy `np.random.bytes` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 24 column: 0 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: shuffle + name: NumpyLegacyRandom + body: "Replace legacy `np.random.shuffle` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 25 column: 0 @@ -146,8 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: permutation + name: NumpyLegacyRandom + body: "Replace legacy `np.random.permutation` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 26 column: 0 @@ -157,8 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: beta + name: NumpyLegacyRandom + body: "Replace legacy `np.random.beta` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 27 column: 0 @@ -168,8 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: binomial + name: NumpyLegacyRandom + body: "Replace legacy `np.random.binomial` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 28 column: 0 @@ -179,8 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: chisquare + name: NumpyLegacyRandom + body: "Replace legacy `np.random.chisquare` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 29 column: 0 @@ -190,8 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: dirichlet + name: NumpyLegacyRandom + body: "Replace legacy `np.random.dirichlet` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 30 column: 0 @@ -201,8 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: exponential + name: NumpyLegacyRandom + body: "Replace legacy `np.random.exponential` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 31 column: 0 @@ -212,8 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: f + name: NumpyLegacyRandom + body: "Replace legacy `np.random.f` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 32 column: 0 @@ -223,8 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: gamma + name: NumpyLegacyRandom + body: "Replace legacy `np.random.gamma` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 33 column: 0 @@ -234,8 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: geometric + name: NumpyLegacyRandom + body: "Replace legacy `np.random.geometric` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 34 column: 0 @@ -245,8 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: get_state + name: NumpyLegacyRandom + body: "Replace legacy `np.random.get_state` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 35 column: 0 @@ -256,8 +302,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: gumbel + name: NumpyLegacyRandom + body: "Replace legacy `np.random.gumbel` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 36 column: 0 @@ -267,8 +315,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: hypergeometric + name: NumpyLegacyRandom + body: "Replace legacy `np.random.hypergeometric` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 37 column: 0 @@ -278,8 +328,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: laplace + name: NumpyLegacyRandom + body: "Replace legacy `np.random.laplace` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 38 column: 0 @@ -289,8 +341,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: logistic + name: NumpyLegacyRandom + body: "Replace legacy `np.random.logistic` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 39 column: 0 @@ -300,8 +354,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: lognormal + name: NumpyLegacyRandom + body: "Replace legacy `np.random.lognormal` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 40 column: 0 @@ -311,8 +367,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: logseries + name: NumpyLegacyRandom + body: "Replace legacy `np.random.logseries` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 41 column: 0 @@ -322,8 +380,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: multinomial + name: NumpyLegacyRandom + body: "Replace legacy `np.random.multinomial` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 42 column: 0 @@ -333,8 +393,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: multivariate_normal + name: NumpyLegacyRandom + body: "Replace legacy `np.random.multivariate_normal` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 43 column: 0 @@ -344,8 +406,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: negative_binomial + name: NumpyLegacyRandom + body: "Replace legacy `np.random.negative_binomial` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 44 column: 0 @@ -355,8 +419,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: noncentral_chisquare + name: NumpyLegacyRandom + body: "Replace legacy `np.random.noncentral_chisquare` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 45 column: 0 @@ -366,8 +432,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: noncentral_f + name: NumpyLegacyRandom + body: "Replace legacy `np.random.noncentral_f` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 46 column: 0 @@ -377,8 +445,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: normal + name: NumpyLegacyRandom + body: "Replace legacy `np.random.normal` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 47 column: 0 @@ -388,8 +458,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: pareto + name: NumpyLegacyRandom + body: "Replace legacy `np.random.pareto` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 48 column: 0 @@ -399,8 +471,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: poisson + name: NumpyLegacyRandom + body: "Replace legacy `np.random.poisson` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 49 column: 0 @@ -410,8 +484,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: power + name: NumpyLegacyRandom + body: "Replace legacy `np.random.power` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 50 column: 0 @@ -421,8 +497,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: rayleigh + name: NumpyLegacyRandom + body: "Replace legacy `np.random.rayleigh` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 51 column: 0 @@ -432,8 +510,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: standard_cauchy + name: NumpyLegacyRandom + body: "Replace legacy `np.random.standard_cauchy` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 52 column: 0 @@ -443,8 +523,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: standard_exponential + name: NumpyLegacyRandom + body: "Replace legacy `np.random.standard_exponential` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 53 column: 0 @@ -454,8 +536,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: standard_gamma + name: NumpyLegacyRandom + body: "Replace legacy `np.random.standard_gamma` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 54 column: 0 @@ -465,8 +549,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: standard_normal + name: NumpyLegacyRandom + body: "Replace legacy `np.random.standard_normal` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 55 column: 0 @@ -476,8 +562,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: standard_t + name: NumpyLegacyRandom + body: "Replace legacy `np.random.standard_t` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 56 column: 0 @@ -487,8 +575,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: triangular + name: NumpyLegacyRandom + body: "Replace legacy `np.random.triangular` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 57 column: 0 @@ -498,8 +588,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: uniform + name: NumpyLegacyRandom + body: "Replace legacy `np.random.uniform` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 58 column: 0 @@ -509,8 +601,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: vonmises + name: NumpyLegacyRandom + body: "Replace legacy `np.random.vonmises` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 59 column: 0 @@ -520,8 +614,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: wald + name: NumpyLegacyRandom + body: "Replace legacy `np.random.wald` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 60 column: 0 @@ -531,8 +627,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: weibull + name: NumpyLegacyRandom + body: "Replace legacy `np.random.weibull` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 61 column: 0 @@ -542,8 +640,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NumpyLegacyRandom: - method_name: zipf + name: NumpyLegacyRandom + body: "Replace legacy `np.random.zipf` call with `np.random.Generator`" + commit: ~ + fixable: false location: row: 62 column: 0 diff --git a/crates/ruff/src/rules/pandas_vet/mod.rs b/crates/ruff/src/rules/pandas_vet/mod.rs index d54317d6c1..486536a137 100644 --- a/crates/ruff/src/rules/pandas_vet/mod.rs +++ b/crates/ruff/src/rules/pandas_vet/mod.rs @@ -16,7 +16,7 @@ mod tests { use ruff_python_ast::source_code::{Indexer, Locator, Stylist}; use crate::linter::{check_path, LinterResult}; - use crate::registry::{Linter, Rule}; + use crate::registry::{AsRule, Linter, Rule}; use crate::settings::flags; use crate::test::test_path; use crate::{directives, settings}; @@ -45,10 +45,10 @@ mod tests { flags::Noqa::Enabled, flags::Autofix::Enabled, ); - let actual = diagnostics - .iter() + let actual: Vec = diagnostics + .into_iter() .map(|diagnostic| diagnostic.kind.rule().clone()) - .collect::>(); + .collect(); assert_eq!(actual, expected); } diff --git a/crates/ruff/src/rules/pandas_vet/rules/inplace_argument.rs b/crates/ruff/src/rules/pandas_vet/rules/inplace_argument.rs index 12ab87c39b..4aa8bdb6a0 100644 --- a/crates/ruff/src/rules/pandas_vet/rules/inplace_argument.rs +++ b/crates/ruff/src/rules/pandas_vet/rules/inplace_argument.rs @@ -4,7 +4,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::pandas_vet::fixes::fix_inplace_argument; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/pandas_vet/snapshots/ruff__rules__pandas_vet__tests__PD002_PD002.py.snap b/crates/ruff/src/rules/pandas_vet/snapshots/ruff__rules__pandas_vet__tests__PD002_PD002.py.snap index 0037b6ad6d..9e395c842e 100644 --- a/crates/ruff/src/rules/pandas_vet/snapshots/ruff__rules__pandas_vet__tests__PD002_PD002.py.snap +++ b/crates/ruff/src/rules/pandas_vet/snapshots/ruff__rules__pandas_vet__tests__PD002_PD002.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pandas_vet/mod.rs expression: diagnostics --- - kind: - UseOfInplaceArgument: ~ + name: UseOfInplaceArgument + body: "`inplace=True` should be avoided; it has inconsistent behavior" + commit: "Assign to variable; remove `inplace` arg" + fixable: true location: row: 5 column: 22 @@ -20,7 +23,10 @@ expression: diagnostics column: 35 parent: ~ - kind: - UseOfInplaceArgument: ~ + name: UseOfInplaceArgument + body: "`inplace=True` should be avoided; it has inconsistent behavior" + commit: "Assign to variable; remove `inplace` arg" + fixable: true location: row: 7 column: 22 @@ -37,7 +43,10 @@ expression: diagnostics column: 35 parent: ~ - kind: - UseOfInplaceArgument: ~ + name: UseOfInplaceArgument + body: "`inplace=True` should be avoided; it has inconsistent behavior" + commit: "Assign to variable; remove `inplace` arg" + fixable: true location: row: 10 column: 4 @@ -54,7 +63,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UseOfInplaceArgument: ~ + name: UseOfInplaceArgument + body: "`inplace=True` should be avoided; it has inconsistent behavior" + commit: "Assign to variable; remove `inplace` arg" + fixable: true location: row: 17 column: 8 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N801_N801.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N801_N801.py.snap index c6d648d2cb..f1fa063365 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N801_N801.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N801_N801.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pep8_naming/mod.rs +source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - InvalidClassName: - name: bad + name: InvalidClassName + body: "Class name `bad` should use CapWords convention " + commit: ~ + fixable: false location: row: 1 column: 6 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidClassName: - name: _bad + name: InvalidClassName + body: "Class name `_bad` should use CapWords convention " + commit: ~ + fixable: false location: row: 5 column: 6 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidClassName: - name: bad_class + name: InvalidClassName + body: "Class name `bad_class` should use CapWords convention " + commit: ~ + fixable: false location: row: 9 column: 6 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidClassName: - name: Bad_Class + name: InvalidClassName + body: "Class name `Bad_Class` should use CapWords convention " + commit: ~ + fixable: false location: row: 13 column: 6 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidClassName: - name: BAD_CLASS + name: InvalidClassName + body: "Class name `BAD_CLASS` should use CapWords convention " + commit: ~ + fixable: false location: row: 17 column: 6 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N802_N802.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N802_N802.py.snap index bcd981f392..0c859a835d 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N802_N802.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N802_N802.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pep8_naming/mod.rs +source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - InvalidFunctionName: - name: Bad + name: InvalidFunctionName + body: "Function name `Bad` should be lowercase" + commit: ~ + fixable: false location: row: 4 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidFunctionName: - name: _Bad + name: InvalidFunctionName + body: "Function name `_Bad` should be lowercase" + commit: ~ + fixable: false location: row: 8 column: 4 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidFunctionName: - name: BAD + name: InvalidFunctionName + body: "Function name `BAD` should be lowercase" + commit: ~ + fixable: false location: row: 12 column: 4 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidFunctionName: - name: BAD_FUNC + name: InvalidFunctionName + body: "Function name `BAD_FUNC` should be lowercase" + commit: ~ + fixable: false location: row: 16 column: 4 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidFunctionName: - name: testTest + name: InvalidFunctionName + body: "Function name `testTest` should be lowercase" + commit: ~ + fixable: false location: row: 40 column: 8 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N803_N803.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N803_N803.py.snap index 89b57eafa8..bd44245f13 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N803_N803.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N803_N803.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pep8_naming/mod.rs +source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - InvalidArgumentName: - name: A + name: InvalidArgumentName + body: "Argument name `A` should be lowercase" + commit: ~ + fixable: false location: row: 1 column: 15 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidArgumentName: - name: A + name: InvalidArgumentName + body: "Argument name `A` should be lowercase" + commit: ~ + fixable: false location: row: 6 column: 27 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N804_N804.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N804_N804.py.snap index c7615713c7..34c4a59ea7 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N804_N804.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N804_N804.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pep8_naming/mod.rs +source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - InvalidFirstArgumentNameForClassMethod: ~ + name: InvalidFirstArgumentNameForClassMethod + body: "First argument of a class method should be named `cls`" + commit: ~ + fixable: false location: row: 30 column: 26 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidFirstArgumentNameForClassMethod: ~ + name: InvalidFirstArgumentNameForClassMethod + body: "First argument of a class method should be named `cls`" + commit: ~ + fixable: false location: row: 38 column: 55 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidFirstArgumentNameForClassMethod: ~ + name: InvalidFirstArgumentNameForClassMethod + body: "First argument of a class method should be named `cls`" + commit: ~ + fixable: false location: row: 43 column: 19 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N805_N805.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N805_N805.py.snap index 52bc9cef56..7c1c06e224 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N805_N805.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N805_N805.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - InvalidFirstArgumentNameForMethod: ~ + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + commit: ~ + fixable: false location: row: 7 column: 19 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidFirstArgumentNameForMethod: ~ + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + commit: ~ + fixable: false location: row: 12 column: 29 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidFirstArgumentNameForMethod: ~ + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + commit: ~ + fixable: false location: row: 27 column: 14 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidFirstArgumentNameForMethod: ~ + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + commit: ~ + fixable: false location: row: 31 column: 14 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidFirstArgumentNameForMethod: ~ + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + commit: ~ + fixable: false location: row: 60 column: 28 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N806_N806.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N806_N806.py.snap index c10a336a41..64ac9777c4 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N806_N806.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N806_N806.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - NonLowercaseVariableInFunction: - name: Camel + name: NonLowercaseVariableInFunction + body: "Variable `Camel` in function should be lowercase" + commit: ~ + fixable: false location: row: 14 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NonLowercaseVariableInFunction: - name: CONSTANT + name: NonLowercaseVariableInFunction + body: "Variable `CONSTANT` in function should be lowercase" + commit: ~ + fixable: false location: row: 15 column: 4 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N807_N807.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N807_N807.py.snap index 778ea3e3b9..110c72feb1 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N807_N807.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N807_N807.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pep8_naming/mod.rs +source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - DunderFunctionName: ~ + name: DunderFunctionName + body: "Function name should not start and end with `__`" + commit: ~ + fixable: false location: row: 1 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DunderFunctionName: ~ + name: DunderFunctionName + body: "Function name should not start and end with `__`" + commit: ~ + fixable: false location: row: 14 column: 8 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N811_N811.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N811_N811.py.snap index 93570d37f7..a8d368ef6d 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N811_N811.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N811_N811.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pep8_naming/mod.rs +source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - ConstantImportedAsNonConstant: - name: CONST - asname: const + name: ConstantImportedAsNonConstant + body: "Constant `CONST` imported as non-constant `const`" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ConstantImportedAsNonConstant: - name: CONSTANT - asname: constant + name: ConstantImportedAsNonConstant + body: "Constant `CONSTANT` imported as non-constant `constant`" + commit: ~ + fixable: false location: row: 2 column: 0 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ConstantImportedAsNonConstant: - name: ANOTHER_CONSTANT - asname: another_constant + name: ConstantImportedAsNonConstant + body: "Constant `ANOTHER_CONSTANT` imported as non-constant `another_constant`" + commit: ~ + fixable: false location: row: 3 column: 0 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N812_N812.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N812_N812.py.snap index 6cca4d20d3..aa8b262c75 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N812_N812.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N812_N812.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pep8_naming/mod.rs +source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - LowercaseImportedAsNonLowercase: - name: lowercase - asname: Lower + name: LowercaseImportedAsNonLowercase + body: "Lowercase `lowercase` imported as non-lowercase `Lower`" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LowercaseImportedAsNonLowercase: - name: lowercase - asname: Lowercase + name: LowercaseImportedAsNonLowercase + body: "Lowercase `lowercase` imported as non-lowercase `Lowercase`" + commit: ~ + fixable: false location: row: 2 column: 0 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LowercaseImportedAsNonLowercase: - name: another_lowercase - asname: AnotherLowercase + name: LowercaseImportedAsNonLowercase + body: "Lowercase `another_lowercase` imported as non-lowercase `AnotherLowercase`" + commit: ~ + fixable: false location: row: 3 column: 0 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N813_N813.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N813_N813.py.snap index 2408ebe239..c92474bce7 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N813_N813.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N813_N813.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pep8_naming/mod.rs +source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - CamelcaseImportedAsLowercase: - name: Camel - asname: camel + name: CamelcaseImportedAsLowercase + body: "Camelcase `Camel` imported as lowercase `camel`" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CamelcaseImportedAsLowercase: - name: CamelCase - asname: camelcase + name: CamelcaseImportedAsLowercase + body: "Camelcase `CamelCase` imported as lowercase `camelcase`" + commit: ~ + fixable: false location: row: 2 column: 0 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CamelcaseImportedAsLowercase: - name: AnotherCamelCase - asname: another_camelcase + name: CamelcaseImportedAsLowercase + body: "Camelcase `AnotherCamelCase` imported as lowercase `another_camelcase`" + commit: ~ + fixable: false location: row: 3 column: 0 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N814_N814.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N814_N814.py.snap index 50fcd2f0af..89910a0d3b 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N814_N814.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N814_N814.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pep8_naming/mod.rs +source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - CamelcaseImportedAsConstant: - name: Camel - asname: CAMEL + name: CamelcaseImportedAsConstant + body: "Camelcase `Camel` imported as constant `CAMEL`" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CamelcaseImportedAsConstant: - name: CamelCase - asname: CAMELCASE + name: CamelcaseImportedAsConstant + body: "Camelcase `CamelCase` imported as constant `CAMELCASE`" + commit: ~ + fixable: false location: row: 2 column: 0 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CamelcaseImportedAsConstant: - name: AnotherCamelCase - asname: ANOTHER_CAMELCASE + name: CamelcaseImportedAsConstant + body: "Camelcase `AnotherCamelCase` imported as constant `ANOTHER_CAMELCASE`" + commit: ~ + fixable: false location: row: 3 column: 0 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N815_N815.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N815_N815.py.snap index 5c4b74e2d0..7a2d4a2bc2 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N815_N815.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N815_N815.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - MixedCaseVariableInClassScope: - name: mixedCase + name: MixedCaseVariableInClassScope + body: "Variable `mixedCase` in class scope should not be mixedCase" + commit: ~ + fixable: false location: row: 9 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MixedCaseVariableInClassScope: - name: _mixedCase + name: MixedCaseVariableInClassScope + body: "Variable `_mixedCase` in class scope should not be mixedCase" + commit: ~ + fixable: false location: row: 10 column: 4 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MixedCaseVariableInClassScope: - name: mixed_Case + name: MixedCaseVariableInClassScope + body: "Variable `mixed_Case` in class scope should not be mixedCase" + commit: ~ + fixable: false location: row: 11 column: 4 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N816_N816.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N816_N816.py.snap index 956b26e032..700ded0828 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N816_N816.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N816_N816.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - MixedCaseVariableInGlobalScope: - name: mixedCase + name: MixedCaseVariableInGlobalScope + body: "Variable `mixedCase` in global scope should not be mixedCase" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MixedCaseVariableInGlobalScope: - name: _mixedCase + name: MixedCaseVariableInGlobalScope + body: "Variable `_mixedCase` in global scope should not be mixedCase" + commit: ~ + fixable: false location: row: 8 column: 0 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MixedCaseVariableInGlobalScope: - name: mixed_Case + name: MixedCaseVariableInGlobalScope + body: "Variable `mixed_Case` in global scope should not be mixedCase" + commit: ~ + fixable: false location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N817_N817.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N817_N817.py.snap index e808ccae9f..7edbccbaeb 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N817_N817.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N817_N817.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pep8_naming/mod.rs +source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - CamelcaseImportedAsAcronym: - name: CaMel - asname: CM + name: CamelcaseImportedAsAcronym + body: "CamelCase `CaMel` imported as acronym `CM`" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CamelcaseImportedAsAcronym: - name: CamelCase - asname: CC + name: CamelcaseImportedAsAcronym + body: "CamelCase `CamelCase` imported as acronym `CC`" + commit: ~ + fixable: false location: row: 2 column: 0 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N818_N818.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N818_N818.py.snap index f7aa423e28..f1c20a7f90 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N818_N818.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N818_N818.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pep8_naming/mod.rs +source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - ErrorSuffixOnExceptionName: - name: C + name: ErrorSuffixOnExceptionName + body: "Exception name `C` should be named with an Error suffix" + commit: ~ + fixable: false location: row: 9 column: 6 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ErrorSuffixOnExceptionName: - name: E + name: ErrorSuffixOnExceptionName + body: "Exception name `E` should be named with an Error suffix" + commit: ~ + fixable: false location: row: 17 column: 6 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap index f157eeabed..395a09310e 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - InvalidModuleName: - name: MODULE + name: InvalidModuleName + body: "Invalid module name: 'MODULE'" + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap index 6cccfc15c0..baed39dcf8 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - InvalidModuleName: - name: mod with spaces + name: InvalidModuleName + body: "Invalid module name: 'mod with spaces'" + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap index 8b7bc92d10..30f470692b 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - InvalidModuleName: - name: mod-with-dashes + name: InvalidModuleName + body: "Invalid module name: 'mod-with-dashes'" + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap index c4fe88441b..ef242c80a3 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - InvalidModuleName: - name: file-with-dashes + name: InvalidModuleName + body: "Invalid module name: 'file-with-dashes'" + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__classmethod_decorators.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__classmethod_decorators.snap index 85f1aa926a..6b8de3ff70 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__classmethod_decorators.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__classmethod_decorators.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- - kind: - InvalidFirstArgumentNameForMethod: ~ + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + commit: ~ + fixable: false location: row: 7 column: 19 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidFirstArgumentNameForMethod: ~ + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + commit: ~ + fixable: false location: row: 12 column: 29 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidFirstArgumentNameForMethod: ~ + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + commit: ~ + fixable: false location: row: 60 column: 28 diff --git a/crates/ruff/src/rules/pycodestyle/rules/lambda_assignment.rs b/crates/ruff/src/rules/pycodestyle/rules/lambda_assignment.rs index 6963833050..881b5fef19 100644 --- a/crates/ruff/src/rules/pycodestyle/rules/lambda_assignment.rs +++ b/crates/ruff/src/rules/pycodestyle/rules/lambda_assignment.rs @@ -8,7 +8,7 @@ use ruff_python_ast::whitespace::leading_space; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{AutofixKind, Availability, Violation}; #[violation] diff --git a/crates/ruff/src/rules/pycodestyle/rules/literal_comparisons.rs b/crates/ruff/src/rules/pycodestyle/rules/literal_comparisons.rs index 4e22df5ead..0772938ff0 100644 --- a/crates/ruff/src/rules/pycodestyle/rules/literal_comparisons.rs +++ b/crates/ruff/src/rules/pycodestyle/rules/literal_comparisons.rs @@ -9,7 +9,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::pycodestyle::helpers::compare; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/pycodestyle/rules/missing_whitespace.rs b/crates/ruff/src/rules/pycodestyle/rules/missing_whitespace.rs index dd85af38d6..3338130690 100644 --- a/crates/ruff/src/rules/pycodestyle/rules/missing_whitespace.rs +++ b/crates/ruff/src/rules/pycodestyle/rules/missing_whitespace.rs @@ -7,8 +7,8 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::fix::Fix; -use crate::registry::Diagnostic; use crate::registry::DiagnosticKind; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::pycodestyle::helpers::{is_keyword_token, is_singleton_token}; use crate::violation::AlwaysAutofixableViolation; use crate::violation::Violation; diff --git a/crates/ruff/src/rules/pycodestyle/rules/not_tests.rs b/crates/ruff/src/rules/pycodestyle/rules/not_tests.rs index 0c254aa708..2e7785401c 100644 --- a/crates/ruff/src/rules/pycodestyle/rules/not_tests.rs +++ b/crates/ruff/src/rules/pycodestyle/rules/not_tests.rs @@ -5,7 +5,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::pycodestyle::helpers::compare; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/pycodestyle/rules/whitespace_before_parameters.rs b/crates/ruff/src/rules/pycodestyle/rules/whitespace_before_parameters.rs index d32adb6a4a..39de94254a 100644 --- a/crates/ruff/src/rules/pycodestyle/rules/whitespace_before_parameters.rs +++ b/crates/ruff/src/rules/pycodestyle/rules/whitespace_before_parameters.rs @@ -7,7 +7,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::pycodestyle::helpers::{is_keyword_token, is_op_token, is_soft_keyword_token}; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E101_E101.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E101_E101.py.snap index b78ef86463..38c53e56db 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E101_E101.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E101_E101.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MixedSpacesAndTabs: ~ + name: MixedSpacesAndTabs + body: Indentation contains mixed spaces and tabs + commit: ~ + fixable: false location: row: 11 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MixedSpacesAndTabs: ~ + name: MixedSpacesAndTabs + body: Indentation contains mixed spaces and tabs + commit: ~ + fixable: false location: row: 15 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MixedSpacesAndTabs: ~ + name: MixedSpacesAndTabs + body: Indentation contains mixed spaces and tabs + commit: ~ + fixable: false location: row: 19 column: 0 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E111_E11.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E111_E11.py.snap index be1d2e5b81..d04fc8744f 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E111_E11.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E111_E11.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - IndentationWithInvalidMultiple: - indent_size: 4 + name: IndentationWithInvalidMultiple + body: Indentation is not a multiple of 4 + commit: ~ + fixable: false location: row: 3 column: 2 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationWithInvalidMultiple: - indent_size: 4 + name: IndentationWithInvalidMultiple + body: Indentation is not a multiple of 4 + commit: ~ + fixable: false location: row: 6 column: 5 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E112_E11.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E112_E11.py.snap index 893b066a95..f92d7173b4 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E112_E11.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E112_E11.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - NoIndentedBlock: ~ + name: NoIndentedBlock + body: Expected an indented block + commit: ~ + fixable: false location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E113_E11.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E113_E11.py.snap index 7a2daf801f..8340132016 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E113_E11.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E113_E11.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - UnexpectedIndentation: ~ + name: UnexpectedIndentation + body: Unexpected indentation + commit: ~ + fixable: false location: row: 12 column: 4 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E114_E11.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E114_E11.py.snap index c3dd92882c..8836526032 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E114_E11.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E114_E11.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - IndentationWithInvalidMultipleComment: - indent_size: 4 + name: IndentationWithInvalidMultipleComment + body: Indentation is not a multiple of 4 (comment) + commit: ~ + fixable: false location: row: 15 column: 5 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E115_E11.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E115_E11.py.snap index 67cca275fb..41d34ac5e6 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E115_E11.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E115_E11.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - NoIndentedBlockComment: ~ + name: NoIndentedBlockComment + body: Expected an indented block (comment) + commit: ~ + fixable: false location: row: 30 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NoIndentedBlockComment: ~ + name: NoIndentedBlockComment + body: Expected an indented block (comment) + commit: ~ + fixable: false location: row: 31 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NoIndentedBlockComment: ~ + name: NoIndentedBlockComment + body: Expected an indented block (comment) + commit: ~ + fixable: false location: row: 32 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NoIndentedBlockComment: ~ + name: NoIndentedBlockComment + body: Expected an indented block (comment) + commit: ~ + fixable: false location: row: 33 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NoIndentedBlockComment: ~ + name: NoIndentedBlockComment + body: Expected an indented block (comment) + commit: ~ + fixable: false location: row: 34 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NoIndentedBlockComment: ~ + name: NoIndentedBlockComment + body: Expected an indented block (comment) + commit: ~ + fixable: false location: row: 35 column: 0 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E116_E11.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E116_E11.py.snap index cd1baf79fb..1c181fb1ca 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E116_E11.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E116_E11.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - UnexpectedIndentationComment: ~ + name: UnexpectedIndentationComment + body: Unexpected indentation (comment) + commit: ~ + fixable: false location: row: 15 column: 5 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnexpectedIndentationComment: ~ + name: UnexpectedIndentationComment + body: Unexpected indentation (comment) + commit: ~ + fixable: false location: row: 22 column: 12 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnexpectedIndentationComment: ~ + name: UnexpectedIndentationComment + body: Unexpected indentation (comment) + commit: ~ + fixable: false location: row: 24 column: 12 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnexpectedIndentationComment: ~ + name: UnexpectedIndentationComment + body: Unexpected indentation (comment) + commit: ~ + fixable: false location: row: 26 column: 12 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E117_E11.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E117_E11.py.snap index f960d02489..3937e89957 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E117_E11.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E117_E11.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - OverIndented: ~ + name: OverIndented + body: Over-indented + commit: ~ + fixable: false location: row: 6 column: 5 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - OverIndented: ~ + name: OverIndented + body: Over-indented + commit: ~ + fixable: false location: row: 39 column: 8 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - OverIndented: ~ + name: OverIndented + body: Over-indented + commit: ~ + fixable: false location: row: 42 column: 2 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E201_E20.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E201_E20.py.snap index 49a1f32c5e..8c7e016ac0 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E201_E20.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E201_E20.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - WhitespaceAfterOpenBracket: ~ + name: WhitespaceAfterOpenBracket + body: "Whitespace after '('" + commit: ~ + fixable: false location: row: 2 column: 5 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceAfterOpenBracket: ~ + name: WhitespaceAfterOpenBracket + body: "Whitespace after '('" + commit: ~ + fixable: false location: row: 4 column: 9 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceAfterOpenBracket: ~ + name: WhitespaceAfterOpenBracket + body: "Whitespace after '('" + commit: ~ + fixable: false location: row: 6 column: 14 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceAfterOpenBracket: ~ + name: WhitespaceAfterOpenBracket + body: "Whitespace after '('" + commit: ~ + fixable: false location: row: 8 column: 5 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceAfterOpenBracket: ~ + name: WhitespaceAfterOpenBracket + body: "Whitespace after '('" + commit: ~ + fixable: false location: row: 10 column: 9 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceAfterOpenBracket: ~ + name: WhitespaceAfterOpenBracket + body: "Whitespace after '('" + commit: ~ + fixable: false location: row: 12 column: 14 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E202_E20.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E202_E20.py.snap index 1429cc10ec..507f499d57 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E202_E20.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E202_E20.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - WhitespaceBeforeCloseBracket: ~ + name: WhitespaceBeforeCloseBracket + body: "Whitespace before ')'" + commit: ~ + fixable: false location: row: 19 column: 22 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceBeforeCloseBracket: ~ + name: WhitespaceBeforeCloseBracket + body: "Whitespace before ')'" + commit: ~ + fixable: false location: row: 21 column: 21 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceBeforeCloseBracket: ~ + name: WhitespaceBeforeCloseBracket + body: "Whitespace before ')'" + commit: ~ + fixable: false location: row: 23 column: 10 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceBeforeCloseBracket: ~ + name: WhitespaceBeforeCloseBracket + body: "Whitespace before ')'" + commit: ~ + fixable: false location: row: 25 column: 22 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceBeforeCloseBracket: ~ + name: WhitespaceBeforeCloseBracket + body: "Whitespace before ')'" + commit: ~ + fixable: false location: row: 27 column: 21 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceBeforeCloseBracket: ~ + name: WhitespaceBeforeCloseBracket + body: "Whitespace before ')'" + commit: ~ + fixable: false location: row: 29 column: 10 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E203_E20.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E203_E20.py.snap index fd4943ea8e..ed2c382f9c 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E203_E20.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E203_E20.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - WhitespaceBeforePunctuation: ~ + name: WhitespaceBeforePunctuation + body: "Whitespace before ',', ';', or ':'" + commit: ~ + fixable: false location: row: 51 column: 9 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceBeforePunctuation: ~ + name: WhitespaceBeforePunctuation + body: "Whitespace before ',', ';', or ':'" + commit: ~ + fixable: false location: row: 55 column: 9 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceBeforePunctuation: ~ + name: WhitespaceBeforePunctuation + body: "Whitespace before ',', ';', or ':'" + commit: ~ + fixable: false location: row: 60 column: 14 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceBeforePunctuation: ~ + name: WhitespaceBeforePunctuation + body: "Whitespace before ',', ';', or ':'" + commit: ~ + fixable: false location: row: 63 column: 14 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceBeforePunctuation: ~ + name: WhitespaceBeforePunctuation + body: "Whitespace before ',', ';', or ':'" + commit: ~ + fixable: false location: row: 67 column: 12 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - WhitespaceBeforePunctuation: ~ + name: WhitespaceBeforePunctuation + body: "Whitespace before ',', ';', or ':'" + commit: ~ + fixable: false location: row: 71 column: 12 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E211_E21.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E211_E21.py.snap index 4351420747..9a1a61969b 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E211_E21.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E211_E21.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - WhitespaceBeforeParameters: - bracket: "'('" + name: WhitespaceBeforeParameters + body: "Whitespace before '('" + commit: "Removed whitespace before '('" + fixable: true location: row: 2 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - WhitespaceBeforeParameters: - bracket: "'['" + name: WhitespaceBeforeParameters + body: "Whitespace before '['" + commit: "Removed whitespace before '['" + fixable: true location: row: 4 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - WhitespaceBeforeParameters: - bracket: "'['" + name: WhitespaceBeforeParameters + body: "Whitespace before '['" + commit: "Removed whitespace before '['" + fixable: true location: row: 4 column: 19 @@ -57,8 +63,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - WhitespaceBeforeParameters: - bracket: "'['" + name: WhitespaceBeforeParameters + body: "Whitespace before '['" + commit: "Removed whitespace before '['" + fixable: true location: row: 6 column: 11 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E221_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E221_E22.py.snap index c48a21ad99..29831c7e9d 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E221_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E221_E22.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MultipleSpacesBeforeOperator: ~ + name: MultipleSpacesBeforeOperator + body: Multiple spaces before operator + commit: ~ + fixable: false location: row: 3 column: 5 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesBeforeOperator: ~ + name: MultipleSpacesBeforeOperator + body: Multiple spaces before operator + commit: ~ + fixable: false location: row: 5 column: 1 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesBeforeOperator: ~ + name: MultipleSpacesBeforeOperator + body: Multiple spaces before operator + commit: ~ + fixable: false location: row: 6 column: 1 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesBeforeOperator: ~ + name: MultipleSpacesBeforeOperator + body: Multiple spaces before operator + commit: ~ + fixable: false location: row: 9 column: 4 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesBeforeOperator: ~ + name: MultipleSpacesBeforeOperator + body: Multiple spaces before operator + commit: ~ + fixable: false location: row: 10 column: 4 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesBeforeOperator: ~ + name: MultipleSpacesBeforeOperator + body: Multiple spaces before operator + commit: ~ + fixable: false location: row: 13 column: 8 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesBeforeOperator: ~ + name: MultipleSpacesBeforeOperator + body: Multiple spaces before operator + commit: ~ + fixable: false location: row: 15 column: 8 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesBeforeOperator: ~ + name: MultipleSpacesBeforeOperator + body: Multiple spaces before operator + commit: ~ + fixable: false location: row: 19 column: 13 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E222_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E222_E22.py.snap index 14d49596ce..f999036cc0 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E222_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E222_E22.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MultipleSpacesAfterOperator: ~ + name: MultipleSpacesAfterOperator + body: Multiple spaces after operator + commit: ~ + fixable: false location: row: 28 column: 7 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesAfterOperator: ~ + name: MultipleSpacesAfterOperator + body: Multiple spaces after operator + commit: ~ + fixable: false location: row: 31 column: 3 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesAfterOperator: ~ + name: MultipleSpacesAfterOperator + body: Multiple spaces after operator + commit: ~ + fixable: false location: row: 32 column: 3 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesAfterOperator: ~ + name: MultipleSpacesAfterOperator + body: Multiple spaces after operator + commit: ~ + fixable: false location: row: 35 column: 6 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesAfterOperator: ~ + name: MultipleSpacesAfterOperator + body: Multiple spaces after operator + commit: ~ + fixable: false location: row: 36 column: 6 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E223_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E223_E22.py.snap index ed13bb7169..c6f7153be1 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E223_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E223_E22.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - TabBeforeOperator: ~ + name: TabBeforeOperator + body: Tab before operator + commit: ~ + fixable: false location: row: 43 column: 1 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E224_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E224_E22.py.snap index 09fef37768..99c95623aa 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E224_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E224_E22.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - TabAfterOperator: ~ + name: TabAfterOperator + body: Tab after operator + commit: ~ + fixable: false location: row: 48 column: 4 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E225_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E225_E22.py.snap index 2909bd92e4..48d739ad15 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E225_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E225_E22.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 54 column: 12 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 58 column: 3 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 60 column: 7 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 62 column: 11 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 64 column: 9 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 66 column: 8 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 68 column: 14 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 70 column: 11 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 72 column: 14 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 74 column: 11 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 76 column: 2 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 76 column: 3 @@ -123,7 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 78 column: 2 @@ -133,7 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 78 column: 5 @@ -143,7 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 88 column: 7 @@ -153,7 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 90 column: 5 @@ -163,7 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 92 column: 2 @@ -173,7 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 94 column: 3 @@ -183,7 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 98 column: 8 @@ -193,7 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 100 column: 6 @@ -203,7 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundOperator: ~ + name: MissingWhitespaceAroundOperator + body: Missing whitespace around operator + commit: ~ + fixable: false location: row: 154 column: 12 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E226_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E226_E22.py.snap index 5c8e7b8dcc..c4c5b5f0f2 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E226_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E226_E22.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MissingWhitespaceAroundArithmeticOperator: ~ + name: MissingWhitespaceAroundArithmeticOperator + body: Missing whitespace around arithmetic operator + commit: ~ + fixable: false location: row: 92 column: 3 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundArithmeticOperator: ~ + name: MissingWhitespaceAroundArithmeticOperator + body: Missing whitespace around arithmetic operator + commit: ~ + fixable: false location: row: 94 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundArithmeticOperator: ~ + name: MissingWhitespaceAroundArithmeticOperator + body: Missing whitespace around arithmetic operator + commit: ~ + fixable: false location: row: 96 column: 4 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundArithmeticOperator: ~ + name: MissingWhitespaceAroundArithmeticOperator + body: Missing whitespace around arithmetic operator + commit: ~ + fixable: false location: row: 98 column: 10 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundArithmeticOperator: ~ + name: MissingWhitespaceAroundArithmeticOperator + body: Missing whitespace around arithmetic operator + commit: ~ + fixable: false location: row: 100 column: 10 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundArithmeticOperator: ~ + name: MissingWhitespaceAroundArithmeticOperator + body: Missing whitespace around arithmetic operator + commit: ~ + fixable: false location: row: 106 column: 6 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundArithmeticOperator: ~ + name: MissingWhitespaceAroundArithmeticOperator + body: Missing whitespace around arithmetic operator + commit: ~ + fixable: false location: row: 106 column: 14 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundArithmeticOperator: ~ + name: MissingWhitespaceAroundArithmeticOperator + body: Missing whitespace around arithmetic operator + commit: ~ + fixable: false location: row: 110 column: 5 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundArithmeticOperator: ~ + name: MissingWhitespaceAroundArithmeticOperator + body: Missing whitespace around arithmetic operator + commit: ~ + fixable: false location: row: 112 column: 5 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundArithmeticOperator: ~ + name: MissingWhitespaceAroundArithmeticOperator + body: Missing whitespace around arithmetic operator + commit: ~ + fixable: false location: row: 114 column: 10 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundArithmeticOperator: ~ + name: MissingWhitespaceAroundArithmeticOperator + body: Missing whitespace around arithmetic operator + commit: ~ + fixable: false location: row: 114 column: 16 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundArithmeticOperator: ~ + name: MissingWhitespaceAroundArithmeticOperator + body: Missing whitespace around arithmetic operator + commit: ~ + fixable: false location: row: 116 column: 11 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E227_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E227_E22.py.snap index 9ac299bd36..62858be647 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E227_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E227_E22.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MissingWhitespaceAroundBitwiseOrShiftOperator: ~ + name: MissingWhitespaceAroundBitwiseOrShiftOperator + body: Missing whitespace around bitwise or shift operator + commit: ~ + fixable: false location: row: 121 column: 11 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundBitwiseOrShiftOperator: ~ + name: MissingWhitespaceAroundBitwiseOrShiftOperator + body: Missing whitespace around bitwise or shift operator + commit: ~ + fixable: false location: row: 123 column: 11 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundBitwiseOrShiftOperator: ~ + name: MissingWhitespaceAroundBitwiseOrShiftOperator + body: Missing whitespace around bitwise or shift operator + commit: ~ + fixable: false location: row: 125 column: 5 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundBitwiseOrShiftOperator: ~ + name: MissingWhitespaceAroundBitwiseOrShiftOperator + body: Missing whitespace around bitwise or shift operator + commit: ~ + fixable: false location: row: 127 column: 5 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundBitwiseOrShiftOperator: ~ + name: MissingWhitespaceAroundBitwiseOrShiftOperator + body: Missing whitespace around bitwise or shift operator + commit: ~ + fixable: false location: row: 129 column: 5 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E228_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E228_E22.py.snap index 54f3d89f19..efd59b2831 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E228_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E228_E22.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MissingWhitespaceAroundModuloOperator: ~ + name: MissingWhitespaceAroundModuloOperator + body: Missing whitespace around modulo operator + commit: ~ + fixable: false location: row: 131 column: 5 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundModuloOperator: ~ + name: MissingWhitespaceAroundModuloOperator + body: Missing whitespace around modulo operator + commit: ~ + fixable: false location: row: 133 column: 9 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundModuloOperator: ~ + name: MissingWhitespaceAroundModuloOperator + body: Missing whitespace around modulo operator + commit: ~ + fixable: false location: row: 135 column: 25 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E231_E23.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E231_E23.py.snap index 8d4a385910..759462e411 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E231_E23.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E231_E23.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MissingWhitespace: - token: "," + name: MissingWhitespace + body: "Missing whitespace after ','" + commit: "Added missing whitespace after ','" + fixable: true location: row: 2 column: 6 @@ -21,8 +23,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - MissingWhitespace: - token: "," + name: MissingWhitespace + body: "Missing whitespace after ','" + commit: "Added missing whitespace after ','" + fixable: true location: row: 4 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - MissingWhitespace: - token: ":" + name: MissingWhitespace + body: "Missing whitespace after ':'" + commit: "Added missing whitespace after ':'" + fixable: true location: row: 6 column: 9 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E251_E25.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E251_E25.py.snap index 274b074d2a..fc1ef90806 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E251_E25.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E251_E25.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - UnexpectedSpacesAroundKeywordParameterEquals: ~ + name: UnexpectedSpacesAroundKeywordParameterEquals + body: Unexpected spaces around keyword / parameter equals + commit: ~ + fixable: false location: row: 2 column: 11 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnexpectedSpacesAroundKeywordParameterEquals: ~ + name: UnexpectedSpacesAroundKeywordParameterEquals + body: Unexpected spaces around keyword / parameter equals + commit: ~ + fixable: false location: row: 2 column: 13 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnexpectedSpacesAroundKeywordParameterEquals: ~ + name: UnexpectedSpacesAroundKeywordParameterEquals + body: Unexpected spaces around keyword / parameter equals + commit: ~ + fixable: false location: row: 6 column: 8 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnexpectedSpacesAroundKeywordParameterEquals: ~ + name: UnexpectedSpacesAroundKeywordParameterEquals + body: Unexpected spaces around keyword / parameter equals + commit: ~ + fixable: false location: row: 8 column: 7 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnexpectedSpacesAroundKeywordParameterEquals: ~ + name: UnexpectedSpacesAroundKeywordParameterEquals + body: Unexpected spaces around keyword / parameter equals + commit: ~ + fixable: false location: row: 10 column: 7 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnexpectedSpacesAroundKeywordParameterEquals: ~ + name: UnexpectedSpacesAroundKeywordParameterEquals + body: Unexpected spaces around keyword / parameter equals + commit: ~ + fixable: false location: row: 10 column: 9 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnexpectedSpacesAroundKeywordParameterEquals: ~ + name: UnexpectedSpacesAroundKeywordParameterEquals + body: Unexpected spaces around keyword / parameter equals + commit: ~ + fixable: false location: row: 12 column: 13 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnexpectedSpacesAroundKeywordParameterEquals: ~ + name: UnexpectedSpacesAroundKeywordParameterEquals + body: Unexpected spaces around keyword / parameter equals + commit: ~ + fixable: false location: row: 15 column: 28 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnexpectedSpacesAroundKeywordParameterEquals: ~ + name: UnexpectedSpacesAroundKeywordParameterEquals + body: Unexpected spaces around keyword / parameter equals + commit: ~ + fixable: false location: row: 18 column: 44 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnexpectedSpacesAroundKeywordParameterEquals: ~ + name: UnexpectedSpacesAroundKeywordParameterEquals + body: Unexpected spaces around keyword / parameter equals + commit: ~ + fixable: false location: row: 23 column: 7 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnexpectedSpacesAroundKeywordParameterEquals: ~ + name: UnexpectedSpacesAroundKeywordParameterEquals + body: Unexpected spaces around keyword / parameter equals + commit: ~ + fixable: false location: row: 23 column: 9 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E252_E25.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E252_E25.py.snap index 2db2258a5f..809e4a20b1 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E252_E25.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E252_E25.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MissingWhitespaceAroundParameterEquals: ~ + name: MissingWhitespaceAroundParameterEquals + body: Missing whitespace around parameter equals + commit: ~ + fixable: false location: row: 46 column: 14 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundParameterEquals: ~ + name: MissingWhitespaceAroundParameterEquals + body: Missing whitespace around parameter equals + commit: ~ + fixable: false location: row: 46 column: 15 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundParameterEquals: ~ + name: MissingWhitespaceAroundParameterEquals + body: Missing whitespace around parameter equals + commit: ~ + fixable: false location: row: 46 column: 26 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAroundParameterEquals: ~ + name: MissingWhitespaceAroundParameterEquals + body: Missing whitespace around parameter equals + commit: ~ + fixable: false location: row: 46 column: 35 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E261_E26.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E261_E26.py.snap index 51da107934..21a9fcb78c 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E261_E26.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E261_E26.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - TooFewSpacesBeforeInlineComment: ~ + name: TooFewSpacesBeforeInlineComment + body: Insert at least two spaces before an inline comment + commit: ~ + fixable: false location: row: 2 column: 4 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E262_E26.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E262_E26.py.snap index ba046740cc..81d4f0c4d4 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E262_E26.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E262_E26.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - NoSpaceAfterInlineComment: ~ + name: NoSpaceAfterInlineComment + body: "Inline comment should start with `# `" + commit: ~ + fixable: false location: row: 4 column: 11 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NoSpaceAfterInlineComment: ~ + name: NoSpaceAfterInlineComment + body: "Inline comment should start with `# `" + commit: ~ + fixable: false location: row: 6 column: 11 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NoSpaceAfterInlineComment: ~ + name: NoSpaceAfterInlineComment + body: "Inline comment should start with `# `" + commit: ~ + fixable: false location: row: 8 column: 11 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NoSpaceAfterInlineComment: ~ + name: NoSpaceAfterInlineComment + body: "Inline comment should start with `# `" + commit: ~ + fixable: false location: row: 63 column: 8 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NoSpaceAfterInlineComment: ~ + name: NoSpaceAfterInlineComment + body: "Inline comment should start with `# `" + commit: ~ + fixable: false location: row: 66 column: 8 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E265_E26.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E265_E26.py.snap index cf6f62d882..fd0951cd21 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E265_E26.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E265_E26.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - NoSpaceAfterBlockComment: ~ + name: NoSpaceAfterBlockComment + body: "Block comment should start with `# `" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NoSpaceAfterBlockComment: ~ + name: NoSpaceAfterBlockComment + body: "Block comment should start with `# `" + commit: ~ + fixable: false location: row: 14 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NoSpaceAfterBlockComment: ~ + name: NoSpaceAfterBlockComment + body: "Block comment should start with `# `" + commit: ~ + fixable: false location: row: 25 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NoSpaceAfterBlockComment: ~ + name: NoSpaceAfterBlockComment + body: "Block comment should start with `# `" + commit: ~ + fixable: false location: row: 32 column: 0 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E266_E26.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E266_E26.py.snap index 7a89454759..9dc6427fdc 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E266_E26.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E266_E26.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MultipleLeadingHashesForBlockComment: ~ + name: MultipleLeadingHashesForBlockComment + body: "Too many leading `#` before block comment" + commit: ~ + fixable: false location: row: 19 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleLeadingHashesForBlockComment: ~ + name: MultipleLeadingHashesForBlockComment + body: "Too many leading `#` before block comment" + commit: ~ + fixable: false location: row: 22 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleLeadingHashesForBlockComment: ~ + name: MultipleLeadingHashesForBlockComment + body: "Too many leading `#` before block comment" + commit: ~ + fixable: false location: row: 26 column: 0 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E271_E27.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E271_E27.py.snap index bf63fa06de..a8c43e5519 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E271_E27.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E271_E27.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MultipleSpacesAfterKeyword: ~ + name: MultipleSpacesAfterKeyword + body: Multiple spaces after keyword + commit: ~ + fixable: false location: row: 4 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesAfterKeyword: ~ + name: MultipleSpacesAfterKeyword + body: Multiple spaces after keyword + commit: ~ + fixable: false location: row: 6 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesAfterKeyword: ~ + name: MultipleSpacesAfterKeyword + body: Multiple spaces after keyword + commit: ~ + fixable: false location: row: 8 column: 2 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesAfterKeyword: ~ + name: MultipleSpacesAfterKeyword + body: Multiple spaces after keyword + commit: ~ + fixable: false location: row: 14 column: 5 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesAfterKeyword: ~ + name: MultipleSpacesAfterKeyword + body: Multiple spaces after keyword + commit: ~ + fixable: false location: row: 16 column: 5 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesAfterKeyword: ~ + name: MultipleSpacesAfterKeyword + body: Multiple spaces after keyword + commit: ~ + fixable: false location: row: 18 column: 5 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesAfterKeyword: ~ + name: MultipleSpacesAfterKeyword + body: Multiple spaces after keyword + commit: ~ + fixable: false location: row: 20 column: 6 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesAfterKeyword: ~ + name: MultipleSpacesAfterKeyword + body: Multiple spaces after keyword + commit: ~ + fixable: false location: row: 22 column: 6 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesAfterKeyword: ~ + name: MultipleSpacesAfterKeyword + body: Multiple spaces after keyword + commit: ~ + fixable: false location: row: 35 column: 13 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E272_E27.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E272_E27.py.snap index 38d45bb4ad..cb97833ccd 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E272_E27.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E272_E27.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MultipleSpacesBeforeKeyword: ~ + name: MultipleSpacesBeforeKeyword + body: Multiple spaces before keyword + commit: ~ + fixable: false location: row: 20 column: 1 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesBeforeKeyword: ~ + name: MultipleSpacesBeforeKeyword + body: Multiple spaces before keyword + commit: ~ + fixable: false location: row: 22 column: 1 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleSpacesBeforeKeyword: ~ + name: MultipleSpacesBeforeKeyword + body: Multiple spaces before keyword + commit: ~ + fixable: false location: row: 24 column: 4 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E273_E27.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E273_E27.py.snap index aff67aa486..fe2f671bdb 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E273_E27.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E273_E27.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - TabAfterKeyword: ~ + name: TabAfterKeyword + body: Tab after keyword + commit: ~ + fixable: false location: row: 10 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TabAfterKeyword: ~ + name: TabAfterKeyword + body: Tab after keyword + commit: ~ + fixable: false location: row: 12 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TabAfterKeyword: ~ + name: TabAfterKeyword + body: Tab after keyword + commit: ~ + fixable: false location: row: 12 column: 9 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TabAfterKeyword: ~ + name: TabAfterKeyword + body: Tab after keyword + commit: ~ + fixable: false location: row: 26 column: 5 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TabAfterKeyword: ~ + name: TabAfterKeyword + body: Tab after keyword + commit: ~ + fixable: false location: row: 30 column: 9 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E274_E27.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E274_E27.py.snap index 3c5d511c0b..3cfe3d2758 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E274_E27.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E274_E27.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - TabBeforeKeyword: ~ + name: TabBeforeKeyword + body: Tab before keyword + commit: ~ + fixable: false location: row: 28 column: 1 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TabBeforeKeyword: ~ + name: TabBeforeKeyword + body: Tab before keyword + commit: ~ + fixable: false location: row: 30 column: 4 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E275_E27.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E275_E27.py.snap index dbe1402678..9ab26e1d43 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E275_E27.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E275_E27.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MissingWhitespaceAfterKeyword: ~ + name: MissingWhitespaceAfterKeyword + body: Missing whitespace after keyword + commit: ~ + fixable: false location: row: 37 column: 13 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAfterKeyword: ~ + name: MissingWhitespaceAfterKeyword + body: Missing whitespace after keyword + commit: ~ + fixable: false location: row: 39 column: 29 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAfterKeyword: ~ + name: MissingWhitespaceAfterKeyword + body: Missing whitespace after keyword + commit: ~ + fixable: false location: row: 42 column: 33 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAfterKeyword: ~ + name: MissingWhitespaceAfterKeyword + body: Missing whitespace after keyword + commit: ~ + fixable: false location: row: 46 column: 2 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MissingWhitespaceAfterKeyword: ~ + name: MissingWhitespaceAfterKeyword + body: Missing whitespace after keyword + commit: ~ + fixable: false location: row: 54 column: 10 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E401_E40.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E401_E40.py.snap index 2cf3822010..d03a9e46c4 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E401_E40.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E401_E40.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MultipleImportsOnOneLine: ~ + name: MultipleImportsOnOneLine + body: Multiple imports on one line + commit: ~ + fixable: false location: row: 2 column: 0 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E40.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E40.py.snap index 5468e12db5..0d33988427 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E40.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E40.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - ModuleImportNotAtTopOfFile: ~ + name: ModuleImportNotAtTopOfFile + body: Module level import not at top of file + commit: ~ + fixable: false location: row: 55 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ModuleImportNotAtTopOfFile: ~ + name: ModuleImportNotAtTopOfFile + body: Module level import not at top of file + commit: ~ + fixable: false location: row: 57 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ModuleImportNotAtTopOfFile: ~ + name: ModuleImportNotAtTopOfFile + body: Module level import not at top of file + commit: ~ + fixable: false location: row: 61 column: 0 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E402.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E402.py.snap index 3e1165bcbb..6d8f35dd6d 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E402.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E402.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - ModuleImportNotAtTopOfFile: ~ + name: ModuleImportNotAtTopOfFile + body: Module level import not at top of file + commit: ~ + fixable: false location: row: 24 column: 0 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E501_E501.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E501_E501.py.snap index 3decd5f38b..652dd57bc8 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E501_E501.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E501_E501.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - LineTooLong: - - 123 - - 88 + name: LineTooLong + body: Line too long (123 > 88 characters) + commit: ~ + fixable: false location: row: 5 column: 88 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LineTooLong: - - 127 - - 88 + name: LineTooLong + body: Line too long (127 > 88 characters) + commit: ~ + fixable: false location: row: 25 column: 88 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LineTooLong: - - 132 - - 88 + name: LineTooLong + body: Line too long (132 > 88 characters) + commit: ~ + fixable: false location: row: 40 column: 88 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LineTooLong: - - 105 - - 88 + name: LineTooLong + body: Line too long (105 > 88 characters) + commit: ~ + fixable: false location: row: 43 column: 88 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LineTooLong: - - 129 - - 88 + name: LineTooLong + body: Line too long (129 > 88 characters) + commit: ~ + fixable: false location: row: 61 column: 88 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E701_E70.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E701_E70.py.snap index 5d25ebec2e..8097f4d26f 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E701_E70.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E701_E70.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MultipleStatementsOnOneLineColon: ~ + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + commit: ~ + fixable: false location: row: 2 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineColon: ~ + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + commit: ~ + fixable: false location: row: 4 column: 39 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineColon: ~ + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + commit: ~ + fixable: false location: row: 25 column: 7 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineColon: ~ + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + commit: ~ + fixable: false location: row: 27 column: 7 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineColon: ~ + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + commit: ~ + fixable: false location: row: 29 column: 9 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineColon: ~ + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + commit: ~ + fixable: false location: row: 31 column: 3 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineColon: ~ + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + commit: ~ + fixable: false location: row: 32 column: 17 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineColon: ~ + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + commit: ~ + fixable: false location: row: 33 column: 7 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineColon: ~ + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + commit: ~ + fixable: false location: row: 35 column: 7 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineColon: ~ + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + commit: ~ + fixable: false location: row: 37 column: 8 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineColon: ~ + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + commit: ~ + fixable: false location: row: 39 column: 14 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineColon: ~ + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + commit: ~ + fixable: false location: row: 54 column: 7 @@ -123,7 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineColon: ~ + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + commit: ~ + fixable: false location: row: 56 column: 7 @@ -133,7 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineColon: ~ + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + commit: ~ + fixable: false location: row: 59 column: 11 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E702_E70.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E702_E70.py.snap index 237b9be6cf..1cc31c7778 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E702_E70.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E702_E70.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - MultipleStatementsOnOneLineSemicolon: ~ + name: MultipleStatementsOnOneLineSemicolon + body: Multiple statements on one line (semicolon) + commit: ~ + fixable: false location: row: 6 column: 9 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineSemicolon: ~ + name: MultipleStatementsOnOneLineSemicolon + body: Multiple statements on one line (semicolon) + commit: ~ + fixable: false location: row: 8 column: 16 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineSemicolon: ~ + name: MultipleStatementsOnOneLineSemicolon + body: Multiple statements on one line (semicolon) + commit: ~ + fixable: false location: row: 12 column: 8 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineSemicolon: ~ + name: MultipleStatementsOnOneLineSemicolon + body: Multiple statements on one line (semicolon) + commit: ~ + fixable: false location: row: 25 column: 10 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineSemicolon: ~ + name: MultipleStatementsOnOneLineSemicolon + body: Multiple statements on one line (semicolon) + commit: ~ + fixable: false location: row: 54 column: 12 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultipleStatementsOnOneLineSemicolon: ~ + name: MultipleStatementsOnOneLineSemicolon + body: Multiple statements on one line (semicolon) + commit: ~ + fixable: false location: row: 56 column: 12 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E703_E70.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E703_E70.py.snap index 95b06e69d2..73f0d06b30 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E703_E70.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E703_E70.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - UselessSemicolon: ~ + name: UselessSemicolon + body: Statement ends with an unnecessary semicolon + commit: Remove unnecessary semicolon + fixable: true location: row: 10 column: 12 @@ -20,7 +23,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - UselessSemicolon: ~ + name: UselessSemicolon + body: Statement ends with an unnecessary semicolon + commit: Remove unnecessary semicolon + fixable: true location: row: 12 column: 22 @@ -37,7 +43,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - UselessSemicolon: ~ + name: UselessSemicolon + body: Statement ends with an unnecessary semicolon + commit: Remove unnecessary semicolon + fixable: true location: row: 25 column: 13 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E711_E711.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E711_E711.py.snap index db553f3317..cdbaeac873 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E711_E711.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E711_E711.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - NoneComparison: Eq + name: NoneComparison + body: "Comparison to `None` should be `cond is None`" + commit: "Replace with `cond is None`" + fixable: true location: row: 2 column: 10 @@ -20,7 +23,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - NoneComparison: NotEq + name: NoneComparison + body: "Comparison to `None` should be `cond is not None`" + commit: "Replace with `cond is not None`" + fixable: true location: row: 5 column: 10 @@ -37,7 +43,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - NoneComparison: Eq + name: NoneComparison + body: "Comparison to `None` should be `cond is None`" + commit: "Replace with `cond is None`" + fixable: true location: row: 8 column: 3 @@ -54,7 +63,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - NoneComparison: NotEq + name: NoneComparison + body: "Comparison to `None` should be `cond is not None`" + commit: "Replace with `cond is not None`" + fixable: true location: row: 11 column: 3 @@ -71,7 +83,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - NoneComparison: Eq + name: NoneComparison + body: "Comparison to `None` should be `cond is None`" + commit: "Replace with `cond is None`" + fixable: true location: row: 14 column: 13 @@ -88,7 +103,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - NoneComparison: NotEq + name: NoneComparison + body: "Comparison to `None` should be `cond is not None`" + commit: "Replace with `cond is not None`" + fixable: true location: row: 17 column: 13 @@ -105,7 +123,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - NoneComparison: NotEq + name: NoneComparison + body: "Comparison to `None` should be `cond is not None`" + commit: "Replace with `cond is not None`" + fixable: true location: row: 20 column: 3 @@ -122,7 +143,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - NoneComparison: Eq + name: NoneComparison + body: "Comparison to `None` should be `cond is None`" + commit: "Replace with `cond is None`" + fixable: true location: row: 23 column: 3 @@ -139,7 +163,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - NoneComparison: Eq + name: NoneComparison + body: "Comparison to `None` should be `cond is None`" + commit: "Replace with `cond is None`" + fixable: true location: row: 26 column: 8 @@ -156,7 +183,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - NoneComparison: NotEq + name: NoneComparison + body: "Comparison to `None` should be `cond is not None`" + commit: "Replace with `cond is not None`" + fixable: true location: row: 26 column: 16 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E712_E712.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E712_E712.py.snap index bd61501743..ba5a75cca4 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E712_E712.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E712_E712.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - TrueFalseComparison: - - true - - Eq + name: TrueFalseComparison + body: "Comparison to `True` should be `cond is True`" + commit: "Replace with `cond is True`" + fixable: true location: row: 2 column: 10 @@ -22,9 +23,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - TrueFalseComparison: - - false - - NotEq + name: TrueFalseComparison + body: "Comparison to `False` should be `cond is not False`" + commit: "Replace with `cond is not False`" + fixable: true location: row: 5 column: 10 @@ -41,9 +43,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - TrueFalseComparison: - - true - - NotEq + name: TrueFalseComparison + body: "Comparison to `True` should be `cond is not True`" + commit: "Replace with `cond is not True`" + fixable: true location: row: 8 column: 3 @@ -60,9 +63,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - TrueFalseComparison: - - false - - Eq + name: TrueFalseComparison + body: "Comparison to `False` should be `cond is False`" + commit: "Replace with `cond is False`" + fixable: true location: row: 11 column: 3 @@ -79,9 +83,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - TrueFalseComparison: - - true - - Eq + name: TrueFalseComparison + body: "Comparison to `True` should be `cond is True`" + commit: "Replace with `cond is True`" + fixable: true location: row: 14 column: 13 @@ -98,9 +103,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - TrueFalseComparison: - - false - - NotEq + name: TrueFalseComparison + body: "Comparison to `False` should be `cond is not False`" + commit: "Replace with `cond is not False`" + fixable: true location: row: 17 column: 13 @@ -117,9 +123,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - TrueFalseComparison: - - true - - Eq + name: TrueFalseComparison + body: "Comparison to `True` should be `cond is True`" + commit: "Replace with `cond is True`" + fixable: true location: row: 20 column: 19 @@ -136,9 +143,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - TrueFalseComparison: - - false - - Eq + name: TrueFalseComparison + body: "Comparison to `False` should be `cond is False`" + commit: "Replace with `cond is False`" + fixable: true location: row: 20 column: 43 @@ -155,9 +163,10 @@ expression: diagnostics column: 48 parent: ~ - kind: - TrueFalseComparison: - - true - - Eq + name: TrueFalseComparison + body: "Comparison to `True` should be `cond is True`" + commit: "Replace with `cond is True`" + fixable: true location: row: 22 column: 4 @@ -174,9 +183,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - TrueFalseComparison: - - true - - Eq + name: TrueFalseComparison + body: "Comparison to `True` should be `cond is True`" + commit: "Replace with `cond is True`" + fixable: true location: row: 25 column: 10 @@ -193,9 +203,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - TrueFalseComparison: - - false - - NotEq + name: TrueFalseComparison + body: "Comparison to `False` should be `cond is not False`" + commit: "Replace with `cond is not False`" + fixable: true location: row: 25 column: 18 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E713_E713.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E713_E713.py.snap index c5fca0e4db..fd91a35b18 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E713_E713.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E713_E713.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - NotInTest: ~ + name: NotInTest + body: "Test for membership should be `not in`" + commit: "Convert to `not in`" + fixable: true location: row: 2 column: 7 @@ -20,7 +23,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - NotInTest: ~ + name: NotInTest + body: "Test for membership should be `not in`" + commit: "Convert to `not in`" + fixable: true location: row: 5 column: 7 @@ -37,7 +43,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - NotInTest: ~ + name: NotInTest + body: "Test for membership should be `not in`" + commit: "Convert to `not in`" + fixable: true location: row: 8 column: 7 @@ -54,7 +63,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - NotInTest: ~ + name: NotInTest + body: "Test for membership should be `not in`" + commit: "Convert to `not in`" + fixable: true location: row: 11 column: 22 @@ -71,7 +83,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - NotInTest: ~ + name: NotInTest + body: "Test for membership should be `not in`" + commit: "Convert to `not in`" + fixable: true location: row: 14 column: 8 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E714_E714.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E714_E714.py.snap index 9bf48c1614..14d0ce5199 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E714_E714.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E714_E714.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - NotIsTest: ~ + name: NotIsTest + body: "Test for object identity should be `is not`" + commit: "Convert to `is not`" + fixable: true location: row: 2 column: 7 @@ -20,7 +23,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - NotIsTest: ~ + name: NotIsTest + body: "Test for object identity should be `is not`" + commit: "Convert to `is not`" + fixable: true location: row: 5 column: 7 @@ -37,7 +43,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - NotIsTest: ~ + name: NotIsTest + body: "Test for object identity should be `is not`" + commit: "Convert to `is not`" + fixable: true location: row: 8 column: 7 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E721_E721.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E721_E721.py.snap index 2d03d3d431..4c7ea1adbe 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E721_E721.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E721_E721.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 2 column: 3 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 5 column: 3 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 10 column: 3 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 15 column: 3 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 18 column: 7 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 20 column: 7 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 22 column: 7 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 24 column: 7 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 26 column: 7 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 28 column: 7 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 30 column: 7 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 32 column: 7 @@ -123,7 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 34 column: 7 @@ -133,7 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 40 column: 7 @@ -143,7 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TypeComparison: ~ + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + commit: ~ + fixable: false location: row: 42 column: 7 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E722_E722.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E722_E722.py.snap index 93699e485a..a6d1768783 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E722_E722.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E722_E722.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - BareExcept: ~ + name: BareExcept + body: "Do not use bare `except`" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BareExcept: ~ + name: BareExcept + body: "Do not use bare `except`" + commit: ~ + fixable: false location: row: 11 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BareExcept: ~ + name: BareExcept + body: "Do not use bare `except`" + commit: ~ + fixable: false location: row: 16 column: 0 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E731_E731.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E731_E731.py.snap index 06b3ac8ad9..65c06817b4 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E731_E731.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E731_E731.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - LambdaAssignment: - name: f - fixable: true + name: LambdaAssignment + body: "Do not assign a `lambda` expression, use a `def`" + commit: "Rewrite `f` as a `def`" + fixable: true location: row: 2 column: 0 @@ -22,9 +23,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - LambdaAssignment: - name: f - fixable: true + name: LambdaAssignment + body: "Do not assign a `lambda` expression, use a `def`" + commit: "Rewrite `f` as a `def`" + fixable: true location: row: 4 column: 0 @@ -41,9 +43,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - LambdaAssignment: - name: this - fixable: true + name: LambdaAssignment + body: "Do not assign a `lambda` expression, use a `def`" + commit: "Rewrite `this` as a `def`" + fixable: true location: row: 7 column: 4 @@ -60,9 +63,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - LambdaAssignment: - name: f - fixable: true + name: LambdaAssignment + body: "Do not assign a `lambda` expression, use a `def`" + commit: "Rewrite `f` as a `def`" + fixable: true location: row: 9 column: 0 @@ -79,9 +83,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - LambdaAssignment: - name: f - fixable: true + name: LambdaAssignment + body: "Do not assign a `lambda` expression, use a `def`" + commit: "Rewrite `f` as a `def`" + fixable: true location: row: 11 column: 0 @@ -98,9 +103,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - LambdaAssignment: - name: f - fixable: false + name: LambdaAssignment + body: "Do not assign a `lambda` expression, use a `def`" + commit: ~ + fixable: false location: row: 14 column: 4 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E741_E741.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E741_E741.py.snap index 937b738912..de74946951 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E741_E741.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E741_E741.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: I + name: AmbiguousVariableName + body: "Ambiguous variable name: `I`" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: O + name: AmbiguousVariableName + body: "Ambiguous variable name: `O`" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 8 column: 3 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 9 column: 4 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 10 column: 4 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 11 column: 4 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 16 column: 4 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 20 column: 7 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 25 column: 11 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 26 column: 4 @@ -123,7 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 30 column: 4 @@ -133,7 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 33 column: 17 @@ -143,7 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 34 column: 8 @@ -153,7 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 40 column: 7 @@ -163,7 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: I + name: AmbiguousVariableName + body: "Ambiguous variable name: `I`" + commit: ~ + fixable: false location: row: 40 column: 13 @@ -173,7 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 44 column: 7 @@ -183,7 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: I + name: AmbiguousVariableName + body: "Ambiguous variable name: `I`" + commit: ~ + fixable: false location: row: 44 column: 15 @@ -193,7 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 48 column: 8 @@ -203,7 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: I + name: AmbiguousVariableName + body: "Ambiguous variable name: `I`" + commit: ~ + fixable: false location: row: 48 column: 13 @@ -213,7 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 57 column: 15 @@ -223,7 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 66 column: 19 @@ -233,7 +302,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 71 column: 21 @@ -243,7 +315,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousVariableName: l + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + commit: ~ + fixable: false location: row: 74 column: 4 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E742_E742.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E742_E742.py.snap index a9a7e0abfe..18adf0a4b6 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E742_E742.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E742_E742.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - AmbiguousClassName: l + name: AmbiguousClassName + body: "Ambiguous class name: `l`" + commit: ~ + fixable: false location: row: 1 column: 6 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousClassName: I + name: AmbiguousClassName + body: "Ambiguous class name: `I`" + commit: ~ + fixable: false location: row: 5 column: 6 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousClassName: O + name: AmbiguousClassName + body: "Ambiguous class name: `O`" + commit: ~ + fixable: false location: row: 9 column: 6 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E743_E743.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E743_E743.py.snap index c2956a2d2e..13549b2dff 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E743_E743.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E743_E743.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - AmbiguousFunctionName: l + name: AmbiguousFunctionName + body: "Ambiguous function name: `l`" + commit: ~ + fixable: false location: row: 1 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousFunctionName: I + name: AmbiguousFunctionName + body: "Ambiguous function name: `I`" + commit: ~ + fixable: false location: row: 5 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AmbiguousFunctionName: O + name: AmbiguousFunctionName + body: "Ambiguous function name: `O`" + commit: ~ + fixable: false location: row: 10 column: 8 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E999_E999.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E999_E999.py.snap index 162a6f62a2..d216f04408 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E999_E999.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E999_E999.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - SyntaxError: - message: unindent does not match any outer indentation level + name: SyntaxError + body: "SyntaxError: unindent does not match any outer indentation level" + commit: ~ + fixable: false location: row: 3 column: 0 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W191_W19.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W191_W19.py.snap index cde5b6c01c..50dbc2477b 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W191_W19.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W191_W19.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 3 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 9 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 16 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 21 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 26 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 32 column: 0 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 38 column: 0 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 44 column: 0 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 45 column: 0 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 54 column: 0 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 58 column: 0 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 61 column: 0 @@ -123,7 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 62 column: 0 @@ -133,7 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 63 column: 0 @@ -143,7 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 64 column: 0 @@ -153,7 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 65 column: 0 @@ -163,7 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 66 column: 0 @@ -173,7 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 73 column: 0 @@ -183,7 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 78 column: 0 @@ -193,7 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 83 column: 0 @@ -203,7 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 88 column: 0 @@ -213,7 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 91 column: 0 @@ -223,7 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 92 column: 0 @@ -233,7 +302,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 98 column: 0 @@ -243,7 +315,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 99 column: 0 @@ -253,7 +328,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 102 column: 0 @@ -263,7 +341,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 105 column: 0 @@ -273,7 +354,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 110 column: 0 @@ -283,7 +367,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 125 column: 0 @@ -293,7 +380,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 131 column: 0 @@ -303,7 +393,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 132 column: 0 @@ -313,7 +406,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 133 column: 0 @@ -323,7 +419,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 136 column: 0 @@ -333,7 +432,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 137 column: 0 @@ -343,7 +445,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 138 column: 0 @@ -353,7 +458,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 139 column: 0 @@ -363,7 +471,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 140 column: 0 @@ -373,7 +484,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IndentationContainsTabs: ~ + name: IndentationContainsTabs + body: Indentation contains tabs + commit: ~ + fixable: false location: row: 143 column: 0 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W291_W29.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W291_W29.py.snap index c88a113ee2..5c3f2e3d40 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W291_W29.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W291_W29.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - TrailingWhitespace: ~ + name: TrailingWhitespace + body: Trailing whitespace + commit: Remove trailing whitespace + fixable: true location: row: 4 column: 5 @@ -20,7 +23,10 @@ expression: diagnostics column: 6 parent: ~ - kind: - TrailingWhitespace: ~ + name: TrailingWhitespace + body: Trailing whitespace + commit: Remove trailing whitespace + fixable: true location: row: 11 column: 34 @@ -37,7 +43,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - TrailingWhitespace: ~ + name: TrailingWhitespace + body: Trailing whitespace + commit: Remove trailing whitespace + fixable: true location: row: 13 column: 5 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_0.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_0.py.snap index 2bc231757f..687aacb14a 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_0.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_0.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - NoNewLineAtEndOfFile: ~ + name: NoNewLineAtEndOfFile + body: No newline at end of file + commit: Add trailing newline + fixable: true location: row: 2 column: 8 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W293_W29.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W293_W29.py.snap index f8f3c45533..1ab92fc2d8 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W293_W29.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W293_W29.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - BlankLineContainsWhitespace: ~ + name: BlankLineContainsWhitespace + body: Blank line contains whitespace + commit: Remove whitespace from blank line + fixable: true location: row: 7 column: 0 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_0.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_0.py.snap index 5741615437..8ab53505e1 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_0.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_0.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - InvalidEscapeSequence: "." + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\.`" + commit: Add backslash to escape sequence + fixable: true location: row: 2 column: 9 @@ -20,7 +23,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - InvalidEscapeSequence: "." + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\.`" + commit: Add backslash to escape sequence + fixable: true location: row: 6 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - InvalidEscapeSequence: _ + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\_`" + commit: Add backslash to escape sequence + fixable: true location: row: 11 column: 5 @@ -54,7 +63,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - InvalidEscapeSequence: _ + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\_`" + commit: Add backslash to escape sequence + fixable: true location: row: 18 column: 5 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_1.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_1.py.snap index 5741615437..8ab53505e1 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_1.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_1.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - InvalidEscapeSequence: "." + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\.`" + commit: Add backslash to escape sequence + fixable: true location: row: 2 column: 9 @@ -20,7 +23,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - InvalidEscapeSequence: "." + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\.`" + commit: Add backslash to escape sequence + fixable: true location: row: 6 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - InvalidEscapeSequence: _ + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\_`" + commit: Add backslash to escape sequence + fixable: true location: row: 11 column: 5 @@ -54,7 +63,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - InvalidEscapeSequence: _ + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\_`" + commit: Add backslash to escape sequence + fixable: true location: row: 18 column: 5 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__constant_literals.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__constant_literals.snap index fe0e3cea6e..e1d7e743dc 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__constant_literals.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__constant_literals.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - IsLiteral: - cmpop: Is + name: IsLiteral + body: "Use `==` to compare constant literals" + commit: "Replace `is` with `==`" + fixable: true location: row: 4 column: 3 @@ -21,8 +23,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - IsLiteral: - cmpop: Is + name: IsLiteral + body: "Use `==` to compare constant literals" + commit: "Replace `is` with `==`" + fixable: true location: row: 6 column: 3 @@ -39,8 +43,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - IsLiteral: - cmpop: Is + name: IsLiteral + body: "Use `==` to compare constant literals" + commit: "Replace `is` with `==`" + fixable: true location: row: 8 column: 3 @@ -57,8 +63,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - IsLiteral: - cmpop: Is + name: IsLiteral + body: "Use `==` to compare constant literals" + commit: "Replace `is` with `==`" + fixable: true location: row: 10 column: 3 @@ -75,8 +83,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - IsLiteral: - cmpop: Is + name: IsLiteral + body: "Use `==` to compare constant literals" + commit: "Replace `is` with `==`" + fixable: true location: row: 12 column: 3 @@ -93,9 +103,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - TrueFalseComparison: - - false - - Eq + name: TrueFalseComparison + body: "Comparison to `False` should be `cond is False`" + commit: "Replace with `cond is False`" + fixable: true location: row: 14 column: 3 @@ -112,7 +123,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - NoneComparison: Eq + name: NoneComparison + body: "Comparison to `None` should be `cond is None`" + commit: "Replace with `cond is None`" + fixable: true location: row: 14 column: 12 @@ -129,7 +143,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - NoneComparison: Eq + name: NoneComparison + body: "Comparison to `None` should be `cond is None`" + commit: "Replace with `cond is None`" + fixable: true location: row: 16 column: 3 @@ -146,9 +163,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - TrueFalseComparison: - - false - - Eq + name: TrueFalseComparison + body: "Comparison to `False` should be `cond is False`" + commit: "Replace with `cond is False`" + fixable: true location: row: 16 column: 11 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__max_doc_length.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__max_doc_length.snap index fce4aa18f9..4fbd02fb07 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__max_doc_length.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__max_doc_length.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - DocLineTooLong: - - 57 - - 50 + name: DocLineTooLong + body: Doc line too long (57 > 50 characters) + commit: ~ + fixable: false location: row: 2 column: 50 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DocLineTooLong: - - 56 - - 50 + name: DocLineTooLong + body: Doc line too long (56 > 50 characters) + commit: ~ + fixable: false location: row: 6 column: 50 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DocLineTooLong: - - 56 - - 50 + name: DocLineTooLong + body: Doc line too long (56 > 50 characters) + commit: ~ + fixable: false location: row: 10 column: 50 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DocLineTooLong: - - 61 - - 50 + name: DocLineTooLong + body: Doc line too long (61 > 50 characters) + commit: ~ + fixable: false location: row: 15 column: 50 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_false.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_false.snap index 6b5898d738..e32db4f410 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_false.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_false.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - LineTooLong: - - 149 - - 88 + name: LineTooLong + body: Line too long (149 > 88 characters) + commit: ~ + fixable: false location: row: 1 column: 88 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LineTooLong: - - 148 - - 88 + name: LineTooLong + body: Line too long (148 > 88 characters) + commit: ~ + fixable: false location: row: 2 column: 88 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LineTooLong: - - 155 - - 88 + name: LineTooLong + body: Line too long (155 > 88 characters) + commit: ~ + fixable: false location: row: 3 column: 88 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LineTooLong: - - 150 - - 88 + name: LineTooLong + body: Line too long (150 > 88 characters) + commit: ~ + fixable: false location: row: 4 column: 88 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LineTooLong: - - 149 - - 88 + name: LineTooLong + body: Line too long (149 > 88 characters) + commit: ~ + fixable: false location: row: 5 column: 88 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LineTooLong: - - 156 - - 88 + name: LineTooLong + body: Line too long (156 > 88 characters) + commit: ~ + fixable: false location: row: 6 column: 88 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__w292_4.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__w292_4.snap index 7c71a716d0..371ab820e5 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__w292_4.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__w292_4.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- - kind: - NoNewLineAtEndOfFile: ~ + name: NoNewLineAtEndOfFile + body: No newline at end of file + commit: Add trailing newline + fixable: true location: row: 1 column: 1 diff --git a/crates/ruff/src/rules/pydocstyle/rules/blank_after_summary.rs b/crates/ruff/src/rules/pydocstyle/rules/blank_after_summary.rs index d78033f829..0830da5d65 100644 --- a/crates/ruff/src/rules/pydocstyle/rules/blank_after_summary.rs +++ b/crates/ruff/src/rules/pydocstyle/rules/blank_after_summary.rs @@ -5,7 +5,7 @@ use crate::checkers::ast::Checker; use crate::docstrings::definition::Docstring; use crate::fix::Fix; use crate::message::Location; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{AutofixKind, Availability, Violation}; #[violation] diff --git a/crates/ruff/src/rules/pydocstyle/rules/blank_before_after_class.rs b/crates/ruff/src/rules/pydocstyle/rules/blank_before_after_class.rs index cacc75761e..baa2f31acc 100644 --- a/crates/ruff/src/rules/pydocstyle/rules/blank_before_after_class.rs +++ b/crates/ruff/src/rules/pydocstyle/rules/blank_before_after_class.rs @@ -5,7 +5,7 @@ use crate::checkers::ast::Checker; use crate::docstrings::definition::{DefinitionKind, Docstring}; use crate::fix::Fix; use crate::message::Location; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pydocstyle/rules/blank_before_after_function.rs b/crates/ruff/src/rules/pydocstyle/rules/blank_before_after_function.rs index a959a21fa9..24ea1dabb5 100644 --- a/crates/ruff/src/rules/pydocstyle/rules/blank_before_after_function.rs +++ b/crates/ruff/src/rules/pydocstyle/rules/blank_before_after_function.rs @@ -8,7 +8,7 @@ use crate::checkers::ast::Checker; use crate::docstrings::definition::{DefinitionKind, Docstring}; use crate::fix::Fix; use crate::message::Location; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pydocstyle/rules/ends_with_period.rs b/crates/ruff/src/rules/pydocstyle/rules/ends_with_period.rs index 1845f08484..22e6c0bf55 100644 --- a/crates/ruff/src/rules/pydocstyle/rules/ends_with_period.rs +++ b/crates/ruff/src/rules/pydocstyle/rules/ends_with_period.rs @@ -9,7 +9,7 @@ use crate::docstrings::definition::Docstring; use crate::docstrings::sections::SectionKind; use crate::fix::Fix; use crate::message::Location; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::pydocstyle::helpers::logical_line; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/pydocstyle/rules/ends_with_punctuation.rs b/crates/ruff/src/rules/pydocstyle/rules/ends_with_punctuation.rs index 52b6b26475..d79669318a 100644 --- a/crates/ruff/src/rules/pydocstyle/rules/ends_with_punctuation.rs +++ b/crates/ruff/src/rules/pydocstyle/rules/ends_with_punctuation.rs @@ -9,7 +9,7 @@ use crate::docstrings::definition::Docstring; use crate::docstrings::sections::SectionKind; use crate::fix::Fix; use crate::message::Location; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::pydocstyle::helpers::logical_line; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/pydocstyle/rules/indent.rs b/crates/ruff/src/rules/pydocstyle/rules/indent.rs index a272ad1211..344f5c0db9 100644 --- a/crates/ruff/src/rules/pydocstyle/rules/indent.rs +++ b/crates/ruff/src/rules/pydocstyle/rules/indent.rs @@ -7,7 +7,7 @@ use crate::checkers::ast::Checker; use crate::docstrings::definition::Docstring; use crate::fix::Fix; use crate::message::Location; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::violation::{AlwaysAutofixableViolation, Violation}; #[violation] diff --git a/crates/ruff/src/rules/pydocstyle/rules/multi_line_summary_start.rs b/crates/ruff/src/rules/pydocstyle/rules/multi_line_summary_start.rs index 0f73ec377a..2f897429bf 100644 --- a/crates/ruff/src/rules/pydocstyle/rules/multi_line_summary_start.rs +++ b/crates/ruff/src/rules/pydocstyle/rules/multi_line_summary_start.rs @@ -8,7 +8,7 @@ use crate::checkers::ast::Checker; use crate::docstrings::definition::{DefinitionKind, Docstring}; use crate::fix::Fix; use crate::message::Location; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pydocstyle/rules/newline_after_last_paragraph.rs b/crates/ruff/src/rules/pydocstyle/rules/newline_after_last_paragraph.rs index 9ff15b8c81..f8e9745471 100644 --- a/crates/ruff/src/rules/pydocstyle/rules/newline_after_last_paragraph.rs +++ b/crates/ruff/src/rules/pydocstyle/rules/newline_after_last_paragraph.rs @@ -7,7 +7,7 @@ use crate::checkers::ast::Checker; use crate::docstrings::definition::Docstring; use crate::fix::Fix; use crate::message::Location; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pydocstyle/rules/no_surrounding_whitespace.rs b/crates/ruff/src/rules/pydocstyle/rules/no_surrounding_whitespace.rs index 38d0274c8b..5290bd075c 100644 --- a/crates/ruff/src/rules/pydocstyle/rules/no_surrounding_whitespace.rs +++ b/crates/ruff/src/rules/pydocstyle/rules/no_surrounding_whitespace.rs @@ -7,7 +7,7 @@ use crate::checkers::ast::Checker; use crate::docstrings::definition::Docstring; use crate::fix::Fix; use crate::message::Location; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pydocstyle/rules/one_liner.rs b/crates/ruff/src/rules/pydocstyle/rules/one_liner.rs index d38ef84373..73edd95eef 100644 --- a/crates/ruff/src/rules/pydocstyle/rules/one_liner.rs +++ b/crates/ruff/src/rules/pydocstyle/rules/one_liner.rs @@ -6,7 +6,7 @@ use ruff_python_ast::whitespace::LinesWithTrailingNewline; use crate::checkers::ast::Checker; use crate::docstrings::definition::Docstring; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pydocstyle/rules/sections.rs b/crates/ruff/src/rules/pydocstyle/rules/sections.rs index 804024e4c3..7da4c722ec 100644 --- a/crates/ruff/src/rules/pydocstyle/rules/sections.rs +++ b/crates/ruff/src/rules/pydocstyle/rules/sections.rs @@ -17,7 +17,7 @@ use crate::docstrings::sections::{section_contexts, SectionContext, SectionKind} use crate::docstrings::styles::SectionStyle; use crate::fix::Fix; use crate::message::Location; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::rules::pydocstyle::settings::Convention; use crate::violation::{AlwaysAutofixableViolation, Violation}; diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100_D.py.snap index 9b7e29c356..2ed50d391c 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100_D.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - PublicModule: ~ + name: PublicModule + body: Missing docstring in public module + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D101_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D101_D.py.snap index 74e0bfbeb8..b6f295cfb2 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D101_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D101_D.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - PublicClass: ~ + name: PublicClass + body: Missing docstring in public class + commit: ~ + fixable: false location: row: 15 column: 6 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_D.py.snap index 3e3075ed64..b550e7e226 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_D.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - PublicMethod: ~ + name: PublicMethod + body: Missing docstring in public method + commit: ~ + fixable: false location: row: 23 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PublicMethod: ~ + name: PublicMethod + body: Missing docstring in public method + commit: ~ + fixable: false location: row: 56 column: 8 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PublicMethod: ~ + name: PublicMethod + body: Missing docstring in public method + commit: ~ + fixable: false location: row: 68 column: 8 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_setter.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_setter.py.snap index 0d8f7420fa..b807e99e0b 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_setter.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_setter.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - PublicMethod: ~ + name: PublicMethod + body: Missing docstring in public method + commit: ~ + fixable: false location: row: 16 column: 8 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D103_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D103_D.py.snap index 27c8fc1864..8c67a660a7 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D103_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D103_D.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - PublicFunction: ~ + name: PublicFunction + body: Missing docstring in public function + commit: ~ + fixable: false location: row: 400 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D104____init__.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D104____init__.py.snap index 54aeda7e9b..fd8efd1c46 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D104____init__.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D104____init__.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - PublicPackage: ~ + name: PublicPackage + body: Missing docstring in public package + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D105_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D105_D.py.snap index 982b6a5aa9..43ee35da43 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D105_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D105_D.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - MagicMethod: ~ + name: MagicMethod + body: Missing docstring in magic method + commit: ~ + fixable: false location: row: 64 column: 8 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D107_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D107_D.py.snap index 1e22eddc2b..e866b1fb4d 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D107_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D107_D.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - PublicInit: ~ + name: PublicInit + body: "Missing docstring in `__init__`" + commit: ~ + fixable: false location: row: 60 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PublicInit: ~ + name: PublicInit + body: "Missing docstring in `__init__`" + commit: ~ + fixable: false location: row: 534 column: 8 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D200_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D200_D.py.snap index aa53a2425b..6cb1e4ad52 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D200_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D200_D.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - FitsOnOneLine: ~ + name: FitsOnOneLine + body: One-line docstring should fit on one line + commit: Reformat to one line + fixable: true location: row: 129 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - FitsOnOneLine: ~ + name: FitsOnOneLine + body: One-line docstring should fit on one line + commit: Reformat to one line + fixable: true location: row: 597 column: 4 @@ -37,7 +43,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - FitsOnOneLine: ~ + name: FitsOnOneLine + body: One-line docstring should fit on one line + commit: Reformat to one line + fixable: true location: row: 606 column: 4 @@ -54,7 +63,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - FitsOnOneLine: ~ + name: FitsOnOneLine + body: One-line docstring should fit on one line + commit: Reformat to one line + fixable: true location: row: 615 column: 4 @@ -64,7 +76,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FitsOnOneLine: ~ + name: FitsOnOneLine + body: One-line docstring should fit on one line + commit: Reformat to one line + fixable: true location: row: 624 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D201_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D201_D.py.snap index c276fbfd9d..b12f26094c 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D201_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D201_D.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - NoBlankLineBeforeFunction: - num_lines: 1 + name: NoBlankLineBeforeFunction + body: No blank lines allowed before function docstring (found 1) + commit: Remove blank line(s) before function docstring + fixable: true location: row: 137 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - NoBlankLineBeforeFunction: - num_lines: 1 + name: NoBlankLineBeforeFunction + body: No blank lines allowed before function docstring (found 1) + commit: Remove blank line(s) before function docstring + fixable: true location: row: 151 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - NoBlankLineBeforeFunction: - num_lines: 1 + name: NoBlankLineBeforeFunction + body: No blank lines allowed before function docstring (found 1) + commit: Remove blank line(s) before function docstring + fixable: true location: row: 546 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - NoBlankLineBeforeFunction: - num_lines: 1 + name: NoBlankLineBeforeFunction + body: No blank lines allowed before function docstring (found 1) + commit: Remove blank line(s) before function docstring + fixable: true location: row: 568 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D.py.snap index 072e594911..4c3a139513 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - NoBlankLineAfterFunction: - num_lines: 1 + name: NoBlankLineAfterFunction + body: No blank lines allowed after function docstring (found 1) + commit: Remove blank line(s) after function docstring + fixable: true location: row: 142 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - NoBlankLineAfterFunction: - num_lines: 1 + name: NoBlankLineAfterFunction + body: No blank lines allowed after function docstring (found 1) + commit: Remove blank line(s) after function docstring + fixable: true location: row: 151 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - NoBlankLineAfterFunction: - num_lines: 1 + name: NoBlankLineAfterFunction + body: No blank lines allowed after function docstring (found 1) + commit: Remove blank line(s) after function docstring + fixable: true location: row: 555 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - NoBlankLineAfterFunction: - num_lines: 1 + name: NoBlankLineAfterFunction + body: No blank lines allowed after function docstring (found 1) + commit: Remove blank line(s) after function docstring + fixable: true location: row: 568 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D202.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D202.py.snap index 40f6384b5d..a2011ae83f 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D202.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D202.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - NoBlankLineAfterFunction: - num_lines: 2 + name: NoBlankLineAfterFunction + body: No blank lines allowed after function docstring (found 2) + commit: Remove blank line(s) after function docstring + fixable: true location: row: 57 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - NoBlankLineAfterFunction: - num_lines: 2 + name: NoBlankLineAfterFunction + body: No blank lines allowed after function docstring (found 2) + commit: Remove blank line(s) after function docstring + fixable: true location: row: 68 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - NoBlankLineAfterFunction: - num_lines: 1 + name: NoBlankLineAfterFunction + body: No blank lines allowed after function docstring (found 1) + commit: Remove blank line(s) after function docstring + fixable: true location: row: 80 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D203_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D203_D.py.snap index 286211e73c..ef53fa1b36 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D203_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D203_D.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - OneBlankLineBeforeClass: - lines: 0 + name: OneBlankLineBeforeClass + body: 1 blank line required before class docstring + commit: Insert 1 blank line before class docstring + fixable: true location: row: 161 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - OneBlankLineBeforeClass: - lines: 0 + name: OneBlankLineBeforeClass + body: 1 blank line required before class docstring + commit: Insert 1 blank line before class docstring + fixable: true location: row: 192 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - OneBlankLineBeforeClass: - lines: 0 + name: OneBlankLineBeforeClass + body: 1 blank line required before class docstring + commit: Insert 1 blank line before class docstring + fixable: true location: row: 526 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D204_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D204_D.py.snap index 5cb60760a5..06ecee814e 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D204_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D204_D.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - OneBlankLineAfterClass: - lines: 0 + name: OneBlankLineAfterClass + body: 1 blank line required after class docstring + commit: Insert 1 blank line after class docstring + fixable: true location: row: 181 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - OneBlankLineAfterClass: - lines: 0 + name: OneBlankLineAfterClass + body: 1 blank line required after class docstring + commit: Insert 1 blank line after class docstring + fixable: true location: row: 192 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D205_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D205_D.py.snap index 0dbfd80eec..5fb1afb049 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D205_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D205_D.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - BlankLineAfterSummary: - num_lines: 0 + name: BlankLineAfterSummary + body: 1 blank line required between summary line and description + commit: ~ + fixable: false location: row: 200 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlankLineAfterSummary: - num_lines: 2 + name: BlankLineAfterSummary + body: 1 blank line required between summary line and description (found 2) + commit: Insert single blank line + fixable: true location: row: 210 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D207_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D207_D.py.snap index cf6d853344..cf3278afc9 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D207_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D207_D.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - NoUnderIndentation: ~ + name: NoUnderIndentation + body: Docstring is under-indented + commit: Increase indentation + fixable: true location: row: 232 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - NoUnderIndentation: ~ + name: NoUnderIndentation + body: Docstring is under-indented + commit: Increase indentation + fixable: true location: row: 244 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - NoUnderIndentation: ~ + name: NoUnderIndentation + body: Docstring is under-indented + commit: Increase indentation + fixable: true location: row: 440 column: 0 @@ -54,7 +63,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - NoUnderIndentation: ~ + name: NoUnderIndentation + body: Docstring is under-indented + commit: Increase indentation + fixable: true location: row: 441 column: 0 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D208_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D208_D.py.snap index e1c74235fb..c98c3ce3bc 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D208_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D208_D.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - NoOverIndentation: ~ + name: NoOverIndentation + body: Docstring is over-indented + commit: Remove over-indentation + fixable: true location: row: 252 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - NoOverIndentation: ~ + name: NoOverIndentation + body: Docstring is over-indented + commit: Remove over-indentation + fixable: true location: row: 264 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - NoOverIndentation: ~ + name: NoOverIndentation + body: Docstring is over-indented + commit: Remove over-indentation + fixable: true location: row: 272 column: 0 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D209_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D209_D.py.snap index acadd84ba8..0c6b70c42e 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D209_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D209_D.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - NewLineAfterLastParagraph: ~ + name: NewLineAfterLastParagraph + body: Multi-line docstring closing quotes should be on a separate line + commit: Move closing quotes to new line + fixable: true location: row: 281 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - NewLineAfterLastParagraph: ~ + name: NewLineAfterLastParagraph + body: Multi-line docstring closing quotes should be on a separate line + commit: Move closing quotes to new line + fixable: true location: row: 588 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D210_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D210_D.py.snap index 01dfefcb3b..3f0df75fea 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D210_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D210_D.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - NoSurroundingWhitespace: ~ + name: NoSurroundingWhitespace + body: No whitespaces allowed surrounding docstring text + commit: Trim surrounding whitespace + fixable: true location: row: 288 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - NoSurroundingWhitespace: ~ + name: NoSurroundingWhitespace + body: No whitespaces allowed surrounding docstring text + commit: Trim surrounding whitespace + fixable: true location: row: 293 column: 4 @@ -37,7 +43,10 @@ expression: diagnostics column: 34 parent: ~ - kind: - NoSurroundingWhitespace: ~ + name: NoSurroundingWhitespace + body: No whitespaces allowed surrounding docstring text + commit: Trim surrounding whitespace + fixable: true location: row: 299 column: 4 @@ -54,7 +63,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - NoSurroundingWhitespace: ~ + name: NoSurroundingWhitespace + body: No whitespaces allowed surrounding docstring text + commit: Trim surrounding whitespace + fixable: true location: row: 581 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D211_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D211_D.py.snap index 0ac6c67fbe..1e5f3ff6a7 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D211_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D211_D.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - NoBlankLineBeforeClass: - lines: 1 + name: NoBlankLineBeforeClass + body: No blank lines allowed before class docstring + commit: Remove blank line(s) before class docstring + fixable: true location: row: 170 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - NoBlankLineBeforeClass: - lines: 1 + name: NoBlankLineBeforeClass + body: No blank lines allowed before class docstring + commit: Remove blank line(s) before class docstring + fixable: true location: row: 181 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D212_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D212_D.py.snap index 5046bebb26..9019c753d5 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D212_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D212_D.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - MultiLineSummaryFirstLine: ~ + name: MultiLineSummaryFirstLine + body: Multi-line docstring summary should start at the first line + commit: Remove whitespace after opening quotes + fixable: true location: row: 129 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - MultiLineSummaryFirstLine: ~ + name: MultiLineSummaryFirstLine + body: Multi-line docstring summary should start at the first line + commit: Remove whitespace after opening quotes + fixable: true location: row: 597 column: 4 @@ -37,7 +43,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - MultiLineSummaryFirstLine: ~ + name: MultiLineSummaryFirstLine + body: Multi-line docstring summary should start at the first line + commit: Remove whitespace after opening quotes + fixable: true location: row: 624 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D213_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D213_D.py.snap index 8cd9fb4fd9..110049c1a6 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D213_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D213_D.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 200 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 210 column: 4 @@ -37,7 +43,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 220 column: 4 @@ -54,7 +63,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 230 column: 4 @@ -71,7 +83,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 240 column: 4 @@ -88,7 +103,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 250 column: 4 @@ -105,7 +123,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 260 column: 4 @@ -122,7 +143,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 270 column: 4 @@ -139,7 +163,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 281 column: 4 @@ -156,7 +183,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 299 column: 4 @@ -173,7 +203,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 343 column: 4 @@ -190,7 +223,10 @@ expression: diagnostics column: 42 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 383 column: 4 @@ -207,7 +243,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 392 column: 4 @@ -224,7 +263,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 438 column: 36 @@ -241,7 +283,10 @@ expression: diagnostics column: 50 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 450 column: 4 @@ -258,7 +303,10 @@ expression: diagnostics column: 71 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 526 column: 4 @@ -275,7 +323,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 546 column: 4 @@ -292,7 +343,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 555 column: 4 @@ -309,7 +363,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 568 column: 4 @@ -326,7 +383,10 @@ expression: diagnostics column: 34 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 588 column: 4 @@ -343,7 +403,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 606 column: 4 @@ -360,7 +423,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - MultiLineSummarySecondLine: ~ + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + commit: Insert line break and indentation after opening quotes + fixable: true location: row: 615 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D214_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D214_sections.py.snap index 06b1d58534..02c672ed2b 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D214_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D214_sections.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - SectionNotOverIndented: - name: Returns + name: SectionNotOverIndented + body: "Section is over-indented (\"Returns\")" + commit: "Remove over-indentation from \"Returns\"" + fixable: true location: row: 135 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D215_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D215_sections.py.snap index 9e975a3810..5f88c91e62 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D215_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D215_sections.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - SectionUnderlineNotOverIndented: - name: Returns + name: SectionUnderlineNotOverIndented + body: "Section underline is over-indented (\"Returns\")" + commit: "Remove over-indentation from \"Returns\" underline" + fixable: true location: row: 147 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - SectionUnderlineNotOverIndented: - name: Returns + name: SectionUnderlineNotOverIndented + body: "Section underline is over-indented (\"Returns\")" + commit: "Remove over-indentation from \"Returns\" underline" + fixable: true location: row: 161 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D300_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D300_D.py.snap index 6146e91259..cddc254cc5 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D300_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D300_D.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - TripleSingleQuotes: ~ + name: TripleSingleQuotes + body: "Use triple double quotes `\"\"\"`" + commit: ~ + fixable: false location: row: 307 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TripleSingleQuotes: ~ + name: TripleSingleQuotes + body: "Use triple double quotes `\"\"\"`" + commit: ~ + fixable: false location: row: 312 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TripleSingleQuotes: ~ + name: TripleSingleQuotes + body: "Use triple double quotes `\"\"\"`" + commit: ~ + fixable: false location: row: 317 column: 4 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TripleSingleQuotes: ~ + name: TripleSingleQuotes + body: "Use triple double quotes `\"\"\"`" + commit: ~ + fixable: false location: row: 322 column: 4 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TripleSingleQuotes: ~ + name: TripleSingleQuotes + body: "Use triple double quotes `\"\"\"`" + commit: ~ + fixable: false location: row: 328 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D301_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D301_D.py.snap index 7ef5940f07..4205e4a4b2 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D301_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D301_D.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - EscapeSequenceInDocstring: ~ + name: EscapeSequenceInDocstring + body: "Use `r\"\"\"` if any backslashes in a docstring" + commit: ~ + fixable: false location: row: 328 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - EscapeSequenceInDocstring: ~ + name: EscapeSequenceInDocstring + body: "Use `r\"\"\"` if any backslashes in a docstring" + commit: ~ + fixable: false location: row: 333 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - EscapeSequenceInDocstring: ~ + name: EscapeSequenceInDocstring + body: "Use `r\"\"\"` if any backslashes in a docstring" + commit: ~ + fixable: false location: row: 338 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D.py.snap index c1e67b2586..1237703715 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 355 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 406 column: 24 @@ -37,7 +43,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 410 column: 4 @@ -54,7 +63,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 416 column: 4 @@ -71,7 +83,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 422 column: 34 @@ -88,7 +103,10 @@ expression: diagnostics column: 46 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 429 column: 48 @@ -105,7 +123,10 @@ expression: diagnostics column: 60 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 470 column: 4 @@ -122,7 +143,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 475 column: 4 @@ -139,7 +163,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 480 column: 4 @@ -156,7 +183,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 487 column: 4 @@ -173,7 +203,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 514 column: 4 @@ -190,7 +223,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 520 column: 4 @@ -207,7 +243,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 581 column: 4 @@ -224,7 +263,10 @@ expression: diagnostics column: 47 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 615 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D400.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D400.py.snap index 1c10546dc2..5db3efbdc4 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D400.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D400.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 2 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 35 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 7 column: 4 @@ -37,7 +43,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 12 column: 4 @@ -54,7 +63,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 20 column: 4 @@ -71,7 +83,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 25 column: 4 @@ -88,7 +103,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 32 column: 4 @@ -105,7 +123,10 @@ expression: diagnostics column: 48 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 39 column: 4 @@ -122,7 +143,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 44 column: 4 @@ -139,7 +163,10 @@ expression: diagnostics column: 38 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 49 column: 4 @@ -156,7 +183,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 57 column: 4 @@ -173,7 +203,10 @@ expression: diagnostics column: 38 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 62 column: 4 @@ -190,7 +223,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - EndsInPeriod: ~ + name: EndsInPeriod + body: First line should end with a period + commit: Add period + fixable: true location: row: 69 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D401_D401.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D401_D401.py.snap index b80dc2ed3f..f13b172ef1 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D401_D401.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D401_D401.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - NonImperativeMood: Returns foo. + name: NonImperativeMood + body: "First line of docstring should be in imperative mood: \"Returns foo.\"" + commit: ~ + fixable: false location: row: 10 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NonImperativeMood: Constructor for a foo. + name: NonImperativeMood + body: "First line of docstring should be in imperative mood: \"Constructor for a foo.\"" + commit: ~ + fixable: false location: row: 14 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NonImperativeMood: Constructor for a boa. + name: NonImperativeMood + body: "First line of docstring should be in imperative mood: \"Constructor for a boa.\"" + commit: ~ + fixable: false location: row: 18 column: 4 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NonImperativeMood: Runs something + name: NonImperativeMood + body: "First line of docstring should be in imperative mood: \"Runs something\"" + commit: ~ + fixable: false location: row: 26 column: 4 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NonImperativeMood: "Runs other things, nested" + name: NonImperativeMood + body: "First line of docstring should be in imperative mood: \"Runs other things, nested\"" + commit: ~ + fixable: false location: row: 29 column: 8 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NonImperativeMood: Writes a logical line that + name: NonImperativeMood + body: "First line of docstring should be in imperative mood: \"Writes a logical line that\"" + commit: ~ + fixable: false location: row: 35 column: 4 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NonImperativeMood: This method docstring should be written in imperative mood. + name: NonImperativeMood + body: "First line of docstring should be in imperative mood: \"This method docstring should be written in imperative mood.\"" + commit: ~ + fixable: false location: row: 74 column: 8 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D402_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D402_D.py.snap index 2bcd62dea5..91b6c9839d 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D402_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D402_D.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - NoSignature: ~ + name: NoSignature + body: "First line should not be the function's signature" + commit: ~ + fixable: false location: row: 378 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D404_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D404_D.py.snap index b506173346..eb5e4896d9 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D404_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D404_D.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - DocstringStartsWithThis: ~ + name: DocstringStartsWithThis + body: "First word of the docstring should not be \"This\"" + commit: ~ + fixable: false location: row: 631 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DocstringStartsWithThis: ~ + name: DocstringStartsWithThis + body: "First word of the docstring should not be \"This\"" + commit: ~ + fixable: false location: row: 636 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D405_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D405_sections.py.snap index 95c482e219..a687e8bc74 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D405_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D405_sections.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - CapitalizeSectionName: - name: returns + name: CapitalizeSectionName + body: "Section name should be properly capitalized (\"returns\")" + commit: "Capitalize \"returns\"" + fixable: true location: row: 17 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - CapitalizeSectionName: - name: Short summary + name: CapitalizeSectionName + body: "Section name should be properly capitalized (\"Short summary\")" + commit: "Capitalize \"Short summary\"" + fixable: true location: row: 207 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D406_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D406_sections.py.snap index b3a70ba78e..b841568304 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D406_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D406_sections.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - NewLineAfterSectionName: - name: Returns + name: NewLineAfterSectionName + body: "Section name should end with a newline (\"Returns\")" + commit: "Add newline after \"Returns\"" + fixable: true location: row: 30 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - NewLineAfterSectionName: - name: Raises + name: NewLineAfterSectionName + body: "Section name should end with a newline (\"Raises\")" + commit: "Add newline after \"Raises\"" + fixable: true location: row: 207 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D407_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D407_sections.py.snap index 29c8a4dc81..2d1b2be2f3 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D407_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D407_sections.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - DashedUnderlineAfterSection: - name: Returns + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Returns\")" + commit: "Add dashed line under \"Returns\"" + fixable: true location: row: 42 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Returns + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Returns\")" + commit: "Add dashed line under \"Returns\"" + fixable: true location: row: 54 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Raises + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Raises\")" + commit: "Add dashed line under \"Raises\"" + fixable: true location: row: 207 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Args + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + commit: "Add dashed line under \"Args\"" + fixable: true location: row: 252 column: 4 @@ -75,8 +83,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Returns + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Returns\")" + commit: "Add dashed line under \"Returns\"" + fixable: true location: row: 252 column: 4 @@ -93,8 +103,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Raises + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Raises\")" + commit: "Add dashed line under \"Raises\"" + fixable: true location: row: 252 column: 4 @@ -111,8 +123,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Args + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + commit: "Add dashed line under \"Args\"" + fixable: true location: row: 269 column: 4 @@ -129,8 +143,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Args + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + commit: "Add dashed line under \"Args\"" + fixable: true location: row: 284 column: 8 @@ -147,8 +163,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Args + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + commit: "Add dashed line under \"Args\"" + fixable: true location: row: 301 column: 4 @@ -165,8 +183,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Args + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + commit: "Add dashed line under \"Args\"" + fixable: true location: row: 313 column: 8 @@ -183,8 +203,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Args + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + commit: "Add dashed line under \"Args\"" + fixable: true location: row: 325 column: 8 @@ -201,8 +223,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Args + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + commit: "Add dashed line under \"Args\"" + fixable: true location: row: 337 column: 8 @@ -219,8 +243,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Args + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + commit: "Add dashed line under \"Args\"" + fixable: true location: row: 350 column: 8 @@ -237,8 +263,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Args + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + commit: "Add dashed line under \"Args\"" + fixable: true location: row: 362 column: 8 @@ -255,8 +283,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Args + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + commit: "Add dashed line under \"Args\"" + fixable: true location: row: 371 column: 8 @@ -273,8 +303,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - DashedUnderlineAfterSection: - name: Args + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + commit: "Add dashed line under \"Args\"" + fixable: true location: row: 490 column: 8 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D408_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D408_sections.py.snap index eb0b1acd44..59edd7afd4 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D408_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D408_sections.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - SectionUnderlineAfterName: - name: Returns + name: SectionUnderlineAfterName + body: "Section underline should be in the line following the section's name (\"Returns\")" + commit: "Add underline to \"Returns\"" + fixable: true location: row: 85 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D409_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D409_sections.py.snap index b7d7e2d17e..70601384db 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D409_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D409_sections.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - SectionUnderlineMatchesSectionLength: - name: Returns + name: SectionUnderlineMatchesSectionLength + body: "Section underline should match the length of its name (\"Returns\")" + commit: "Adjust underline length to match \"Returns\"" + fixable: true location: row: 99 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - SectionUnderlineMatchesSectionLength: - name: Returns + name: SectionUnderlineMatchesSectionLength + body: "Section underline should match the length of its name (\"Returns\")" + commit: "Adjust underline length to match \"Returns\"" + fixable: true location: row: 207 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D410_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D410_sections.py.snap index 7781ad14d1..97117b8005 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D410_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D410_sections.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - BlankLineAfterSection: - name: Returns + name: BlankLineAfterSection + body: "Missing blank line after section (\"Returns\")" + commit: "Add blank line after \"Returns\"" + fixable: true location: row: 67 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - BlankLineAfterSection: - name: Returns + name: BlankLineAfterSection + body: "Missing blank line after section (\"Returns\")" + commit: "Add blank line after \"Returns\"" + fixable: true location: row: 207 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D411_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D411_sections.py.snap index 207fe9b6ce..55da2fd879 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D411_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D411_sections.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - BlankLineBeforeSection: - name: Yields + name: BlankLineBeforeSection + body: "Missing blank line before section (\"Yields\")" + commit: "Add blank line before \"Yields\"" + fixable: true location: row: 67 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - BlankLineBeforeSection: - name: Returns + name: BlankLineBeforeSection + body: "Missing blank line before section (\"Returns\")" + commit: "Add blank line before \"Returns\"" + fixable: true location: row: 122 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - BlankLineBeforeSection: - name: Raises + name: BlankLineBeforeSection + body: "Missing blank line before section (\"Raises\")" + commit: "Add blank line before \"Raises\"" + fixable: true location: row: 207 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D412_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D412_sections.py.snap index 9b6997b758..2550c53b35 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D412_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D412_sections.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - NoBlankLinesBetweenHeaderAndContent: - name: Short summary + name: NoBlankLinesBetweenHeaderAndContent + body: "No blank lines allowed between a section header and its content (\"Short summary\")" + commit: Remove blank line(s) + fixable: true location: row: 207 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D414_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D414_sections.py.snap index 090e68ec5a..ef20bd2e64 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D414_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D414_sections.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - EmptyDocstringSection: - name: Returns + name: EmptyDocstringSection + body: "Section has no content (\"Returns\")" + commit: ~ + fixable: false location: row: 54 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - EmptyDocstringSection: - name: Returns + name: EmptyDocstringSection + body: "Section has no content (\"Returns\")" + commit: ~ + fixable: false location: row: 67 column: 4 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - EmptyDocstringSection: - name: Yields + name: EmptyDocstringSection + body: "Section has no content (\"Yields\")" + commit: ~ + fixable: false location: row: 67 column: 4 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - EmptyDocstringSection: - name: Returns + name: EmptyDocstringSection + body: "Section has no content (\"Returns\")" + commit: ~ + fixable: false location: row: 161 column: 4 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - EmptyDocstringSection: - name: Returns + name: EmptyDocstringSection + body: "Section has no content (\"Returns\")" + commit: ~ + fixable: false location: row: 252 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D415_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D415_D.py.snap index 5a9f4988df..aea2f14734 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D415_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D415_D.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - EndsInPunctuation: ~ + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + commit: Add closing punctuation + fixable: true location: row: 355 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - EndsInPunctuation: ~ + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + commit: Add closing punctuation + fixable: true location: row: 406 column: 24 @@ -37,7 +43,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - EndsInPunctuation: ~ + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + commit: Add closing punctuation + fixable: true location: row: 410 column: 4 @@ -54,7 +63,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - EndsInPunctuation: ~ + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + commit: Add closing punctuation + fixable: true location: row: 416 column: 4 @@ -71,7 +83,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - EndsInPunctuation: ~ + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + commit: Add closing punctuation + fixable: true location: row: 422 column: 34 @@ -88,7 +103,10 @@ expression: diagnostics column: 46 parent: ~ - kind: - EndsInPunctuation: ~ + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + commit: Add closing punctuation + fixable: true location: row: 429 column: 48 @@ -105,7 +123,10 @@ expression: diagnostics column: 60 parent: ~ - kind: - EndsInPunctuation: ~ + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + commit: Add closing punctuation + fixable: true location: row: 470 column: 4 @@ -122,7 +143,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - EndsInPunctuation: ~ + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + commit: Add closing punctuation + fixable: true location: row: 475 column: 4 @@ -139,7 +163,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - EndsInPunctuation: ~ + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + commit: Add closing punctuation + fixable: true location: row: 480 column: 4 @@ -156,7 +183,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - EndsInPunctuation: ~ + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + commit: Add closing punctuation + fixable: true location: row: 487 column: 4 @@ -173,7 +203,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - EndsInPunctuation: ~ + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + commit: Add closing punctuation + fixable: true location: row: 520 column: 4 @@ -190,7 +223,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - EndsInPunctuation: ~ + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + commit: Add closing punctuation + fixable: true location: row: 581 column: 4 @@ -207,7 +243,10 @@ expression: diagnostics column: 47 parent: ~ - kind: - EndsInPunctuation: ~ + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + commit: Add closing punctuation + fixable: true location: row: 615 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_sections.py.snap index d9e0a42252..fc48cc00ab 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_sections.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - UndocumentedParam: - names: - - y + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + commit: ~ + fixable: false location: row: 283 column: 8 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + commit: ~ + fixable: false location: row: 300 column: 4 @@ -27,11 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - test - - y - - z + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `test`, `y`, `z`" + commit: ~ + fixable: false location: row: 324 column: 8 @@ -41,11 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - test - - y - - z + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `test`, `y`, `z`" + commit: ~ + fixable: false location: row: 336 column: 8 @@ -55,11 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - a - - y - - z + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `a`, `y`, `z`" + commit: ~ + fixable: false location: row: 349 column: 8 @@ -69,10 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - a - - b + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `a`, `b`" + commit: ~ + fixable: false location: row: 361 column: 8 @@ -82,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + commit: ~ + fixable: false location: row: 389 column: 4 @@ -94,11 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - test - - y - - z + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `test`, `y`, `z`" + commit: ~ + fixable: false location: row: 425 column: 8 @@ -108,11 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - test - - y - - z + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `test`, `y`, `z`" + commit: ~ + fixable: false location: row: 440 column: 8 @@ -122,10 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - a - - z + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `a`, `z`" + commit: ~ + fixable: false location: row: 459 column: 8 @@ -135,9 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + commit: ~ + fixable: false location: row: 489 column: 8 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D418_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D418_D.py.snap index f8430488ba..c2c4e05648 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D418_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D418_D.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - OverloadWithDocstring: ~ + name: OverloadWithDocstring + body: "Function decorated with `@overload` shouldn't contain a docstring" + commit: ~ + fixable: false location: row: 34 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - OverloadWithDocstring: ~ + name: OverloadWithDocstring + body: "Function decorated with `@overload` shouldn't contain a docstring" + commit: ~ + fixable: false location: row: 90 column: 8 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - OverloadWithDocstring: ~ + name: OverloadWithDocstring + body: "Function decorated with `@overload` shouldn't contain a docstring" + commit: ~ + fixable: false location: row: 110 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D419_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D419_D.py.snap index b76661b3b6..c44c3ee1f1 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D419_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D419_D.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - EmptyDocstring: ~ + name: EmptyDocstring + body: Docstring is empty + commit: ~ + fixable: false location: row: 20 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - EmptyDocstring: ~ + name: EmptyDocstring + body: Docstring is empty + commit: ~ + fixable: false location: row: 74 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - EmptyDocstring: ~ + name: EmptyDocstring + body: Docstring is empty + commit: ~ + fixable: false location: row: 80 column: 8 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__bom.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__bom.snap index c2b961b8c2..53fa1712d4 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__bom.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__bom.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - TripleSingleQuotes: ~ + name: TripleSingleQuotes + body: "Use triple double quotes `\"\"\"`" + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_google.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_google.snap index 421e8a1bc6..e8f2e329a7 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_google.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_google.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - UndocumentedParam: - names: - - y - - z + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + commit: ~ + fixable: false location: row: 1 column: 4 @@ -16,10 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y - - z + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + commit: ~ + fixable: false location: row: 14 column: 4 @@ -29,10 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y - - z + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + commit: ~ + fixable: false location: row: 27 column: 4 @@ -42,10 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y - - z + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + commit: ~ + fixable: false location: row: 39 column: 4 @@ -55,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + commit: ~ + fixable: false location: row: 52 column: 4 @@ -67,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + commit: ~ + fixable: false location: row: 65 column: 4 @@ -79,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + commit: ~ + fixable: false location: row: 77 column: 4 @@ -91,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - x + name: UndocumentedParam + body: "Missing argument description in the docstring: `x`" + commit: ~ + fixable: false location: row: 98 column: 4 @@ -103,9 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - "*args" + name: UndocumentedParam + body: "Missing argument description in the docstring: `*args`" + commit: ~ + fixable: false location: row: 108 column: 4 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_unspecified.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_unspecified.snap index 421e8a1bc6..e8f2e329a7 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_unspecified.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_unspecified.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- - kind: - UndocumentedParam: - names: - - y - - z + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + commit: ~ + fixable: false location: row: 1 column: 4 @@ -16,10 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y - - z + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + commit: ~ + fixable: false location: row: 14 column: 4 @@ -29,10 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y - - z + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + commit: ~ + fixable: false location: row: 27 column: 4 @@ -42,10 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y - - z + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + commit: ~ + fixable: false location: row: 39 column: 4 @@ -55,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + commit: ~ + fixable: false location: row: 52 column: 4 @@ -67,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + commit: ~ + fixable: false location: row: 65 column: 4 @@ -79,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - y + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + commit: ~ + fixable: false location: row: 77 column: 4 @@ -91,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - x + name: UndocumentedParam + body: "Missing argument description in the docstring: `x`" + commit: ~ + fixable: false location: row: 98 column: 4 @@ -103,9 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndocumentedParam: - names: - - "*args" + name: UndocumentedParam + body: "Missing argument description in the docstring: `*args`" + commit: ~ + fixable: false location: row: 108 column: 4 diff --git a/crates/ruff/src/rules/pyflakes/mod.rs b/crates/ruff/src/rules/pyflakes/mod.rs index 7bac0f36d0..faa194e216 100644 --- a/crates/ruff/src/rules/pyflakes/mod.rs +++ b/crates/ruff/src/rules/pyflakes/mod.rs @@ -18,7 +18,7 @@ mod tests { use ruff_python_ast::source_code::{Indexer, Locator, Stylist}; use crate::linter::{check_path, LinterResult}; - use crate::registry::{Linter, Rule}; + use crate::registry::{AsRule, Linter, Rule}; use crate::settings::flags; use crate::test::test_path; use crate::{directives, settings}; diff --git a/crates/ruff/src/rules/pyflakes/rules/f_string_missing_placeholders.rs b/crates/ruff/src/rules/pyflakes/rules/f_string_missing_placeholders.rs index 302a262a45..a856b42812 100644 --- a/crates/ruff/src/rules/pyflakes/rules/f_string_missing_placeholders.rs +++ b/crates/ruff/src/rules/pyflakes/rules/f_string_missing_placeholders.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; /// ## What it does diff --git a/crates/ruff/src/rules/pyflakes/rules/invalid_literal_comparisons.rs b/crates/ruff/src/rules/pyflakes/rules/invalid_literal_comparisons.rs index 7b6ab80268..c53d430d0b 100644 --- a/crates/ruff/src/rules/pyflakes/rules/invalid_literal_comparisons.rs +++ b/crates/ruff/src/rules/pyflakes/rules/invalid_literal_comparisons.rs @@ -11,7 +11,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] diff --git a/crates/ruff/src/rules/pyflakes/rules/raise_not_implemented.rs b/crates/ruff/src/rules/pyflakes/rules/raise_not_implemented.rs index 183c8a2ba9..c8e8fab6e1 100644 --- a/crates/ruff/src/rules/pyflakes/rules/raise_not_implemented.rs +++ b/crates/ruff/src/rules/pyflakes/rules/raise_not_implemented.rs @@ -5,7 +5,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyflakes/rules/repeated_keys.rs b/crates/ruff/src/rules/pyflakes/rules/repeated_keys.rs index ef0534f3fb..7dd446526d 100644 --- a/crates/ruff/src/rules/pyflakes/rules/repeated_keys.rs +++ b/crates/ruff/src/rules/pyflakes/rules/repeated_keys.rs @@ -10,7 +10,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::violation::{AutofixKind, Availability, Violation}; #[violation] diff --git a/crates/ruff/src/rules/pyflakes/rules/strings.rs b/crates/ruff/src/rules/pyflakes/rules/strings.rs index 4e875692a9..dbf2766719 100644 --- a/crates/ruff/src/rules/pyflakes/rules/strings.rs +++ b/crates/ruff/src/rules/pyflakes/rules/strings.rs @@ -8,7 +8,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{AlwaysAutofixableViolation, Violation}; use super::super::cformat::CFormatSummary; diff --git a/crates/ruff/src/rules/pyflakes/rules/unused_variable.rs b/crates/ruff/src/rules/pyflakes/rules/unused_variable.rs index c742f6b9a7..547c634c17 100644 --- a/crates/ruff/src/rules/pyflakes/rules/unused_variable.rs +++ b/crates/ruff/src/rules/pyflakes/rules/unused_variable.rs @@ -11,7 +11,7 @@ use ruff_python_ast::types::{Range, RefEquality, ScopeKind}; use crate::autofix::helpers::delete_stmt; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; /// ## What it does diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_0.py.snap index 149cdb7c0c..6fcae15420 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_0.py.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UnusedImport: - name: functools - ignore_init: false - multiple: false + name: UnusedImport + body: "`functools` imported but unused" + commit: "Remove unused import: `functools`" + fixable: true location: row: 2 column: 7 @@ -23,10 +23,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - UnusedImport: - name: collections.OrderedDict - ignore_init: false - multiple: false + name: UnusedImport + body: "`collections.OrderedDict` imported but unused" + commit: "Remove unused import: `collections.OrderedDict`" + fixable: true location: row: 6 column: 4 @@ -45,10 +45,10 @@ expression: diagnostics row: 4 column: 0 - kind: - UnusedImport: - name: logging.handlers - ignore_init: false - multiple: false + name: UnusedImport + body: "`logging.handlers` imported but unused" + commit: "Remove unused import: `logging.handlers`" + fixable: true location: row: 12 column: 7 @@ -65,10 +65,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedImport: - name: shelve - ignore_init: false - multiple: false + name: UnusedImport + body: "`shelve` imported but unused" + commit: "Remove unused import: `shelve`" + fixable: true location: row: 32 column: 11 @@ -85,10 +85,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedImport: - name: importlib - ignore_init: false - multiple: false + name: UnusedImport + body: "`importlib` imported but unused" + commit: "Remove unused import: `importlib`" + fixable: true location: row: 33 column: 11 @@ -105,10 +105,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - UnusedImport: - name: pathlib - ignore_init: false - multiple: false + name: UnusedImport + body: "`pathlib` imported but unused" + commit: "Remove unused import: `pathlib`" + fixable: true location: row: 37 column: 11 @@ -125,10 +125,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedImport: - name: pickle - ignore_init: false - multiple: false + name: UnusedImport + body: "`pickle` imported but unused" + commit: "Remove unused import: `pickle`" + fixable: true location: row: 52 column: 15 @@ -145,10 +145,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - UnusedImport: - name: x - ignore_init: false - multiple: false + name: UnusedImport + body: "`x` imported but unused" + commit: "Remove unused import: `x`" + fixable: true location: row: 93 column: 15 @@ -165,10 +165,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedImport: - name: y - ignore_init: false - multiple: false + name: UnusedImport + body: "`y` imported but unused" + commit: "Remove unused import: `y`" + fixable: true location: row: 94 column: 15 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_5.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_5.py.snap index 35f29f68ce..4505f3ab9e 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_5.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_5.py.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UnusedImport: - name: a.b.c - ignore_init: false - multiple: false + name: UnusedImport + body: "`a.b.c` imported but unused" + commit: "Remove unused import: `a.b.c`" + fixable: true location: row: 2 column: 16 @@ -23,10 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedImport: - name: d.e.f - ignore_init: false - multiple: false + name: UnusedImport + body: "`d.e.f` imported but unused" + commit: "Remove unused import: `d.e.f`" + fixable: true location: row: 3 column: 16 @@ -43,10 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedImport: - name: h.i - ignore_init: false - multiple: false + name: UnusedImport + body: "`h.i` imported but unused" + commit: "Remove unused import: `h.i`" + fixable: true location: row: 4 column: 7 @@ -63,10 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedImport: - name: j.k - ignore_init: false - multiple: false + name: UnusedImport + body: "`j.k` imported but unused" + commit: "Remove unused import: `j.k`" + fixable: true location: row: 5 column: 7 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_6.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_6.py.snap index b910826bbb..52fd15b17f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_6.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_6.py.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UnusedImport: - name: ".background.BackgroundTasks" - ignore_init: false - multiple: false + name: UnusedImport + body: "`.background.BackgroundTasks` imported but unused" + commit: "Remove unused import: `.background.BackgroundTasks`" + fixable: true location: row: 7 column: 24 @@ -23,10 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedImport: - name: ".datastructures.UploadFile" - ignore_init: false - multiple: false + name: UnusedImport + body: "`.datastructures.UploadFile` imported but unused" + commit: "Remove unused import: `.datastructures.UploadFile`" + fixable: true location: row: 10 column: 28 @@ -43,10 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedImport: - name: background - ignore_init: false - multiple: false + name: UnusedImport + body: "`background` imported but unused" + commit: "Remove unused import: `background`" + fixable: true location: row: 16 column: 7 @@ -63,10 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedImport: - name: datastructures - ignore_init: false - multiple: false + name: UnusedImport + body: "`datastructures` imported but unused" + commit: "Remove unused import: `datastructures`" + fixable: true location: row: 19 column: 7 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_7.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_7.py.snap index 1587019e53..27acd3597f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_7.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_7.py.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UnusedImport: - name: typing.Union - ignore_init: false - multiple: false + name: UnusedImport + body: "`typing.Union` imported but unused" + commit: "Remove unused import: `typing.Union`" + fixable: true location: row: 30 column: 4 @@ -25,10 +25,10 @@ expression: diagnostics row: 28 column: 0 - kind: - UnusedImport: - name: typing.Awaitable - ignore_init: false - multiple: true + name: UnusedImport + body: "`typing.Awaitable` imported but unused" + commit: Remove unused import + fixable: true location: row: 66 column: 19 @@ -45,10 +45,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedImport: - name: typing.AwaitableGenerator - ignore_init: false - multiple: true + name: UnusedImport + body: "`typing.AwaitableGenerator` imported but unused" + commit: Remove unused import + fixable: true location: row: 66 column: 30 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_9.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_9.py.snap index 266661227e..ed23fab9a9 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_9.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_9.py.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UnusedImport: - name: foo.baz - ignore_init: false - multiple: false + name: UnusedImport + body: "`foo.baz` imported but unused" + commit: "Remove unused import: `foo.baz`" + fixable: true location: row: 4 column: 21 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F402_F402.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F402_F402.py.snap index fc07cd2234..5fd19c56cc 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F402_F402.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F402_F402.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - ImportShadowedByLoopVar: - name: os - line: 1 + name: ImportShadowedByLoopVar + body: "Import `os` from line 1 shadowed by loop variable" + commit: ~ + fixable: false location: row: 5 column: 4 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ImportShadowedByLoopVar: - name: path - line: 2 + name: ImportShadowedByLoopVar + body: "Import `path` from line 2 shadowed by loop variable" + commit: ~ + fixable: false location: row: 8 column: 4 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F403_F403.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F403_F403.py.snap index c096227f93..f597784063 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F403_F403.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F403_F403.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - ImportStar: - name: F634 + name: ImportStar + body: "`from F634 import *` used; unable to detect undefined names" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ImportStar: - name: F634 + name: ImportStar + body: "`from F634 import *` used; unable to detect undefined names" + commit: ~ + fixable: false location: row: 2 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F404_F404.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F404_F404.py.snap index 305376bdc5..8d2ee56f09 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F404_F404.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F404_F404.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - LateFutureImport: ~ + name: LateFutureImport + body: "`from __future__` imports must occur at the beginning of the file" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LateFutureImport: ~ + name: LateFutureImport + body: "`from __future__` imports must occur at the beginning of the file" + commit: ~ + fixable: false location: row: 8 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F405_F405.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F405_F405.py.snap index 55a944db64..d6aff2ef54 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F405_F405.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F405_F405.py.snap @@ -1,12 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - ImportStarUsage: - name: name - sources: - - mymodule + name: ImportStarUsage + body: "`name` may be undefined, or defined from star imports: `mymodule`" + commit: ~ + fixable: false location: row: 5 column: 10 @@ -16,10 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ImportStarUsage: - name: a - sources: - - mymodule + name: ImportStarUsage + body: "`a` may be undefined, or defined from star imports: `mymodule`" + commit: ~ + fixable: false location: row: 11 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F406_F406.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F406_F406.py.snap index 77b0180c5e..91df012fcd 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F406_F406.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F406_F406.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - ImportStarNotPermitted: - name: F634 + name: ImportStarNotPermitted + body: "`from F634 import *` only allowed at module level" + commit: ~ + fixable: false location: row: 5 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ImportStarNotPermitted: - name: F634 + name: ImportStarNotPermitted + body: "`from F634 import *` only allowed at module level" + commit: ~ + fixable: false location: row: 9 column: 4 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F407_F407.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F407_F407.py.snap index 384b6af814..5a46b3f0e6 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F407_F407.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F407_F407.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - FutureFeatureNotDefined: - name: non_existent_feature + name: FutureFeatureNotDefined + body: "Future feature `non_existent_feature` is not defined" + commit: ~ + fixable: false location: row: 2 column: 23 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F501_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F501_F50x.py.snap index 93e89e9af9..e6acd61e04 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F501_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F501_F50x.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - PercentFormatInvalidFormat: - message: incomplete format + name: PercentFormatInvalidFormat + body: "`%`-format string has invalid format string: incomplete format" + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F502.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F502.py.snap index 48b9840348..610045767e 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F502.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F502.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - PercentFormatExpectedMapping: ~ + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PercentFormatExpectedMapping: ~ + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PercentFormatExpectedMapping: ~ + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + commit: ~ + fixable: false location: row: 8 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PercentFormatExpectedMapping: ~ + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PercentFormatExpectedMapping: ~ + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + commit: ~ + fixable: false location: row: 11 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PercentFormatExpectedMapping: ~ + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + commit: ~ + fixable: false location: row: 12 column: 0 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PercentFormatExpectedMapping: ~ + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + commit: ~ + fixable: false location: row: 13 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F50x.py.snap index 8f283dd1dc..de35a49ab6 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F50x.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - PercentFormatExpectedMapping: ~ + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + commit: ~ + fixable: false location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F503.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F503.py.snap index accfb81962..2046f54c81 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F503.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F503.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - PercentFormatExpectedSequence: ~ + name: PercentFormatExpectedSequence + body: "`%`-format string expected sequence but got mapping" + commit: ~ + fixable: false location: row: 17 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PercentFormatExpectedSequence: ~ + name: PercentFormatExpectedSequence + body: "`%`-format string expected sequence but got mapping" + commit: ~ + fixable: false location: row: 18 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PercentFormatExpectedSequence: ~ + name: PercentFormatExpectedSequence + body: "`%`-format string expected sequence but got mapping" + commit: ~ + fixable: false location: row: 23 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F50x.py.snap index d1fe547aec..2d4f9bd9a3 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F50x.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - PercentFormatExpectedSequence: ~ + name: PercentFormatExpectedSequence + body: "`%`-format string expected sequence but got mapping" + commit: ~ + fixable: false location: row: 10 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F504.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F504.py.snap index 9440285ce8..3ba845d50f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F504.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F504.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - PercentFormatExtraNamedArguments: - missing: - - b + name: PercentFormatExtraNamedArguments + body: "`%`-format string has unused named argument(s): b" + commit: "Remove extra named arguments: b" + fixable: true location: row: 3 column: 0 @@ -22,9 +23,10 @@ expression: diagnostics column: 34 parent: ~ - kind: - PercentFormatExtraNamedArguments: - missing: - - b + name: PercentFormatExtraNamedArguments + body: "`%`-format string has unused named argument(s): b" + commit: "Remove extra named arguments: b" + fixable: true location: row: 8 column: 0 @@ -41,9 +43,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - PercentFormatExtraNamedArguments: - missing: - - b + name: PercentFormatExtraNamedArguments + body: "`%`-format string has unused named argument(s): b" + commit: "Remove extra named arguments: b" + fixable: true location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F50x.py.snap index 8e60084019..3e12ec3f8a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F50x.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - PercentFormatExtraNamedArguments: - missing: - - baz + name: PercentFormatExtraNamedArguments + body: "`%`-format string has unused named argument(s): baz" + commit: "Remove extra named arguments: baz" + fixable: true location: row: 8 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F50x.py.snap index e8ac484c11..3cfb6c503d 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F50x.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - PercentFormatMissingArgument: - missing: - - bar + name: PercentFormatMissingArgument + body: "`%`-format string is missing argument(s) for placeholder(s): bar" + commit: ~ + fixable: false location: row: 7 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F506_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F506_F50x.py.snap index ced932f60b..ba2c6eb020 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F506_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F506_F50x.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - PercentFormatMixedPositionalAndNamed: ~ + name: PercentFormatMixedPositionalAndNamed + body: "`%`-format string has mixed positional and named placeholders" + commit: ~ + fixable: false location: row: 2 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PercentFormatMixedPositionalAndNamed: ~ + name: PercentFormatMixedPositionalAndNamed + body: "`%`-format string has mixed positional and named placeholders" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PercentFormatMixedPositionalAndNamed: ~ + name: PercentFormatMixedPositionalAndNamed + body: "`%`-format string has mixed positional and named placeholders" + commit: ~ + fixable: false location: row: 11 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F507_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F507_F50x.py.snap index 1071acebe0..5a42f28455 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F507_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F507_F50x.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - PercentFormatPositionalCountMismatch: - wanted: 2 - got: 1 + name: PercentFormatPositionalCountMismatch + body: "`%`-format string has 2 placeholder(s) but 1 substitution(s)" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PercentFormatPositionalCountMismatch: - wanted: 2 - got: 3 + name: PercentFormatPositionalCountMismatch + body: "`%`-format string has 2 placeholder(s) but 3 substitution(s)" + commit: ~ + fixable: false location: row: 6 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F508_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F508_F50x.py.snap index 9310616150..c770c1a9a5 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F508_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F508_F50x.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - PercentFormatStarRequiresSequence: ~ + name: PercentFormatStarRequiresSequence + body: "`%`-format string `*` specifier requires sequence" + commit: ~ + fixable: false location: row: 11 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F509_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F509_F50x.py.snap index cc96044e7b..6cb0785bad 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F509_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F509_F50x.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - PercentFormatUnsupportedFormatCharacter: - char: j + name: PercentFormatUnsupportedFormatCharacter + body: "`%`-format string has unsupported format character `j`" + commit: ~ + fixable: false location: row: 4 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F521_F521.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F521_F521.py.snap index 3a6ae8bd4a..c9ac706c8c 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F521_F521.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F521_F521.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - StringDotFormatInvalidFormat: - message: "Single '{' encountered in format string" + name: StringDotFormatInvalidFormat + body: "`.format` call has invalid format string: Single '{' encountered in format string" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatInvalidFormat: - message: "Single '}' encountered in format string" + name: StringDotFormatInvalidFormat + body: "`.format` call has invalid format string: Single '}' encountered in format string" + commit: ~ + fixable: false location: row: 2 column: 0 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatInvalidFormat: - message: "Expected '}' before end of string" + name: StringDotFormatInvalidFormat + body: "`.format` call has invalid format string: Expected '}' before end of string" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatInvalidFormat: - message: Max string recursion exceeded + name: StringDotFormatInvalidFormat + body: "`.format` call has invalid format string: Max string recursion exceeded" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatInvalidFormat: - message: Empty attribute in format string + name: StringDotFormatInvalidFormat + body: "`.format` call has invalid format string: Empty attribute in format string" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatInvalidFormat: - message: Empty attribute in format string + name: StringDotFormatInvalidFormat + body: "`.format` call has invalid format string: Empty attribute in format string" + commit: ~ + fixable: false location: row: 8 column: 0 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatInvalidFormat: - message: Empty attribute in format string + name: StringDotFormatInvalidFormat + body: "`.format` call has invalid format string: Empty attribute in format string" + commit: ~ + fixable: false location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F522_F522.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F522_F522.py.snap index 9ac9daefff..bd6ddc1160 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F522_F522.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F522_F522.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - StringDotFormatExtraNamedArguments: - missing: - - bar + name: StringDotFormatExtraNamedArguments + body: "`.format` call has unused named argument(s): bar" + commit: "Remove extra named arguments: bar" + fixable: true location: row: 1 column: 0 @@ -22,9 +23,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - StringDotFormatExtraNamedArguments: - missing: - - spam + name: StringDotFormatExtraNamedArguments + body: "`.format` call has unused named argument(s): spam" + commit: "Remove extra named arguments: spam" + fixable: true location: row: 2 column: 0 @@ -41,10 +43,10 @@ expression: diagnostics column: 34 parent: ~ - kind: - StringDotFormatExtraNamedArguments: - missing: - - eggs - - ham + name: StringDotFormatExtraNamedArguments + body: "`.format` call has unused named argument(s): eggs, ham" + commit: "Remove extra named arguments: eggs, ham" + fixable: true location: row: 4 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F523_F523.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F523_F523.py.snap index 22ea486941..1d8d89f087 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F523_F523.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F523_F523.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - StringDotFormatExtraPositionalArguments: - missing: - - "1" + name: StringDotFormatExtraPositionalArguments + body: "`.format` call has unused arguments at position(s): 1" + commit: ~ + fixable: false location: row: 2 column: 0 @@ -15,10 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatExtraPositionalArguments: - missing: - - "0" - - "2" + name: StringDotFormatExtraPositionalArguments + body: "`.format` call has unused arguments at position(s): 0, 2" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -28,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatExtraPositionalArguments: - missing: - - "2" + name: StringDotFormatExtraPositionalArguments + body: "`.format` call has unused arguments at position(s): 2" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -40,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatExtraPositionalArguments: - missing: - - "1" + name: StringDotFormatExtraPositionalArguments + body: "`.format` call has unused arguments at position(s): 1" + commit: ~ + fixable: false location: row: 6 column: 0 @@ -52,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatExtraPositionalArguments: - missing: - - "1" + name: StringDotFormatExtraPositionalArguments + body: "`.format` call has unused arguments at position(s): 1" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -64,10 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatExtraPositionalArguments: - missing: - - "1" - - "2" + name: StringDotFormatExtraPositionalArguments + body: "`.format` call has unused arguments at position(s): 1, 2" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -77,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatExtraPositionalArguments: - missing: - - "2" + name: StringDotFormatExtraPositionalArguments + body: "`.format` call has unused arguments at position(s): 2" + commit: ~ + fixable: false location: row: 12 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F524_F524.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F524_F524.py.snap index dbfb54b57d..c40e458354 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F524_F524.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F524_F524.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - StringDotFormatMissingArguments: - missing: - - "1" + name: StringDotFormatMissingArguments + body: "`.format` call is missing argument(s) for placeholder(s): 1" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatMissingArguments: - missing: - - "2" + name: StringDotFormatMissingArguments + body: "`.format` call is missing argument(s) for placeholder(s): 2" + commit: ~ + fixable: false location: row: 2 column: 0 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatMissingArguments: - missing: - - bar + name: StringDotFormatMissingArguments + body: "`.format` call is missing argument(s) for placeholder(s): bar" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatMissingArguments: - missing: - - bar + name: StringDotFormatMissingArguments + body: "`.format` call is missing argument(s) for placeholder(s): bar" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -51,10 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatMissingArguments: - missing: - - "0" - - bar + name: StringDotFormatMissingArguments + body: "`.format` call is missing argument(s) for placeholder(s): 0, bar" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -64,10 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatMissingArguments: - missing: - - "0" - - bar + name: StringDotFormatMissingArguments + body: "`.format` call is missing argument(s) for placeholder(s): 0, bar" + commit: ~ + fixable: false location: row: 6 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F525_F525.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F525_F525.py.snap index f84ebddd9b..5803331134 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F525_F525.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F525_F525.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - StringDotFormatMixingAutomatic: ~ + name: StringDotFormatMixingAutomatic + body: "`.format` string mixes automatic and manual numbering" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - StringDotFormatMixingAutomatic: ~ + name: StringDotFormatMixingAutomatic + body: "`.format` string mixes automatic and manual numbering" + commit: ~ + fixable: false location: row: 2 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F541_F541.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F541_F541.py.snap index 28108daec5..f3f1da4e3d 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F541_F541.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F541_F541.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 6 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 7 column: 4 @@ -37,7 +43,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 9 column: 4 @@ -54,7 +63,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 13 column: 4 @@ -71,7 +83,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 14 column: 4 @@ -88,7 +103,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 16 column: 4 @@ -105,7 +123,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 17 column: 4 @@ -122,7 +143,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 19 column: 4 @@ -139,7 +163,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 25 column: 12 @@ -156,7 +183,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 34 column: 6 @@ -173,7 +203,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 35 column: 3 @@ -190,7 +223,10 @@ expression: diagnostics column: 6 parent: ~ - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 36 column: 0 @@ -207,7 +243,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 37 column: 0 @@ -224,7 +263,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 38 column: 0 @@ -241,7 +283,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - FStringMissingPlaceholders: ~ + name: FStringMissingPlaceholders + body: f-string without any placeholders + commit: "Remove extraneous `f` prefix" + fixable: true location: row: 39 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F601_F601.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F601_F601.py.snap index 1993de5103..1a522f7e34 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F601_F601.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F601_F601.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: false + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: ~ + fixable: false location: row: 3 column: 4 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "1" - repeated_value: false + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `1` repeated" + commit: ~ + fixable: false location: row: 9 column: 4 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "b\"123\"" - repeated_value: false + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `b\"123\"` repeated" + commit: ~ + fixable: false location: row: 11 column: 4 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: false + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: ~ + fixable: false location: row: 16 column: 4 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: false + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: ~ + fixable: false location: row: 17 column: 4 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: true + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: "Remove repeated key literal `\"a\"`" + fixable: true location: row: 18 column: 4 @@ -82,9 +88,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: false + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: ~ + fixable: false location: row: 23 column: 4 @@ -94,9 +101,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: false + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: ~ + fixable: false location: row: 24 column: 4 @@ -106,9 +114,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: true + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: "Remove repeated key literal `\"a\"`" + fixable: true location: row: 25 column: 4 @@ -125,9 +134,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: false + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: ~ + fixable: false location: row: 26 column: 4 @@ -137,9 +147,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: true + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: "Remove repeated key literal `\"a\"`" + fixable: true location: row: 31 column: 4 @@ -156,9 +167,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: false + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: ~ + fixable: false location: row: 32 column: 4 @@ -168,9 +180,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: false + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: ~ + fixable: false location: row: 33 column: 4 @@ -180,9 +193,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: false + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: ~ + fixable: false location: row: 34 column: 4 @@ -192,9 +206,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: false + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: ~ + fixable: false location: row: 41 column: 4 @@ -204,9 +219,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: false + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: ~ + fixable: false location: row: 43 column: 4 @@ -216,9 +232,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: true + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: "Remove repeated key literal `\"a\"`" + fixable: true location: row: 45 column: 4 @@ -235,9 +252,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: true + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: "Remove repeated key literal `\"a\"`" + fixable: true location: row: 49 column: 13 @@ -254,9 +272,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - MultiValueRepeatedKeyLiteral: - name: "\"a\"" - repeated_value: true + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + commit: "Remove repeated key literal `\"a\"`" + fixable: true location: row: 50 column: 21 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F602_F602.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F602_F602.py.snap index a5dbd00444..9fbd02d42c 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F602_F602.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F602_F602.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: false + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: ~ + fixable: false location: row: 5 column: 4 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: false + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: ~ + fixable: false location: row: 11 column: 4 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: false + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: ~ + fixable: false location: row: 12 column: 4 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: true + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: "Remove repeated key `a`" + fixable: true location: row: 13 column: 4 @@ -58,9 +62,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: false + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: ~ + fixable: false location: row: 18 column: 4 @@ -70,9 +75,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: false + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: ~ + fixable: false location: row: 19 column: 4 @@ -82,9 +88,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: true + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: "Remove repeated key `a`" + fixable: true location: row: 20 column: 4 @@ -101,9 +108,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: false + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: ~ + fixable: false location: row: 21 column: 4 @@ -113,9 +121,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: true + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: "Remove repeated key `a`" + fixable: true location: row: 26 column: 4 @@ -132,9 +141,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: false + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: ~ + fixable: false location: row: 27 column: 4 @@ -144,9 +154,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: false + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: ~ + fixable: false location: row: 28 column: 4 @@ -156,9 +167,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: false + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: ~ + fixable: false location: row: 29 column: 4 @@ -168,9 +180,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: true + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: "Remove repeated key `a`" + fixable: true location: row: 35 column: 4 @@ -187,9 +200,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: false + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: ~ + fixable: false location: row: 37 column: 4 @@ -199,9 +213,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: false + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: ~ + fixable: false location: row: 39 column: 4 @@ -211,9 +226,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: false + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: ~ + fixable: false location: row: 41 column: 4 @@ -223,9 +239,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: true + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: "Remove repeated key `a`" + fixable: true location: row: 44 column: 11 @@ -242,9 +259,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - MultiValueRepeatedKeyVariable: - name: a - repeated_value: true + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + commit: "Remove repeated key `a`" + fixable: true location: row: 45 column: 17 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F622_F622.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F622_F622.py.snap index 5349cd080d..e245f46177 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F622_F622.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F622_F622.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - TwoStarredExpressions: ~ + name: TwoStarredExpressions + body: Two starred expressions in assignment + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F631_F631.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F631_F631.py.snap index 9a92b8fd6b..5a1667fc7f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F631_F631.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F631_F631.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - AssertTuple: ~ + name: AssertTuple + body: "Assert test is a non-empty tuple, which is always `True`" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AssertTuple: ~ + name: AssertTuple + body: "Assert test is a non-empty tuple, which is always `True`" + commit: ~ + fixable: false location: row: 2 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F632_F632.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F632_F632.py.snap index 6cb30ac06c..cc8b28d68f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F632_F632.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F632_F632.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - IsLiteral: - cmpop: Is + name: IsLiteral + body: "Use `==` to compare constant literals" + commit: "Replace `is` with `==`" + fixable: true location: row: 1 column: 3 @@ -21,8 +23,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - IsLiteral: - cmpop: IsNot + name: IsLiteral + body: "Use `!=` to compare constant literals" + commit: "Replace `is not` with `!=`" + fixable: true location: row: 4 column: 3 @@ -39,8 +43,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - IsLiteral: - cmpop: IsNot + name: IsLiteral + body: "Use `!=` to compare constant literals" + commit: "Replace `is not` with `!=`" + fixable: true location: row: 7 column: 3 @@ -57,8 +63,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - IsLiteral: - cmpop: Is + name: IsLiteral + body: "Use `==` to compare constant literals" + commit: "Replace `is` with `==`" + fixable: true location: row: 11 column: 3 @@ -75,8 +83,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - IsLiteral: - cmpop: Is + name: IsLiteral + body: "Use `==` to compare constant literals" + commit: "Replace `is` with `==`" + fixable: true location: row: 14 column: 3 @@ -93,8 +103,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - IsLiteral: - cmpop: Is + name: IsLiteral + body: "Use `==` to compare constant literals" + commit: "Replace `is` with `==`" + fixable: true location: row: 17 column: 3 @@ -111,8 +123,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - IsLiteral: - cmpop: Is + name: IsLiteral + body: "Use `==` to compare constant literals" + commit: "Replace `is` with `==`" + fixable: true location: row: 20 column: 13 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F633_F633.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F633_F633.py.snap index 7dd8fed6de..4db61aaa0f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F633_F633.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F633_F633.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - InvalidPrintSyntax: ~ + name: InvalidPrintSyntax + body: "Use of `>>` is invalid with `print` function" + commit: ~ + fixable: false location: row: 4 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F634_F634.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F634_F634.py.snap index ffe7b6923b..f6302a57c2 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F634_F634.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F634_F634.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - IfTuple: ~ + name: IfTuple + body: "If test is a tuple, which is always `True`" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - IfTuple: ~ + name: IfTuple + body: "If test is a tuple, which is always `True`" + commit: ~ + fixable: false location: row: 7 column: 4 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F701_F701.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F701_F701.py.snap index 1dc95f893e..eeeb98d82c 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F701_F701.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F701_F701.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - BreakOutsideLoop: ~ + name: BreakOutsideLoop + body: "`break` outside loop" + commit: ~ + fixable: false location: row: 4 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BreakOutsideLoop: ~ + name: BreakOutsideLoop + body: "`break` outside loop" + commit: ~ + fixable: false location: row: 16 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BreakOutsideLoop: ~ + name: BreakOutsideLoop + body: "`break` outside loop" + commit: ~ + fixable: false location: row: 20 column: 4 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BreakOutsideLoop: ~ + name: BreakOutsideLoop + body: "`break` outside loop" + commit: ~ + fixable: false location: row: 23 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F702_F702.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F702_F702.py.snap index 7cb35153ed..3350102ab6 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F702_F702.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F702_F702.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - ContinueOutsideLoop: ~ + name: ContinueOutsideLoop + body: "`continue` not properly in loop" + commit: ~ + fixable: false location: row: 4 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ContinueOutsideLoop: ~ + name: ContinueOutsideLoop + body: "`continue` not properly in loop" + commit: ~ + fixable: false location: row: 16 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ContinueOutsideLoop: ~ + name: ContinueOutsideLoop + body: "`continue` not properly in loop" + commit: ~ + fixable: false location: row: 20 column: 4 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ContinueOutsideLoop: ~ + name: ContinueOutsideLoop + body: "`continue` not properly in loop" + commit: ~ + fixable: false location: row: 23 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F704_F704.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F704_F704.py.snap index 3d28069170..a738297955 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F704_F704.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F704_F704.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - YieldOutsideFunction: - keyword: Yield + name: YieldOutsideFunction + body: "`yield` statement outside of a function" + commit: ~ + fixable: false location: row: 6 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - YieldOutsideFunction: - keyword: Yield + name: YieldOutsideFunction + body: "`yield` statement outside of a function" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - YieldOutsideFunction: - keyword: YieldFrom + name: YieldOutsideFunction + body: "`yield from` statement outside of a function" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - YieldOutsideFunction: - keyword: Await + name: YieldOutsideFunction + body: "`await` statement outside of a function" + commit: ~ + fixable: false location: row: 11 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F706_F706.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F706_F706.py.snap index 5f18d824d4..9121dfdddb 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F706_F706.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F706_F706.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - ReturnOutsideFunction: ~ + name: ReturnOutsideFunction + body: "`return` statement outside of a function/method" + commit: ~ + fixable: false location: row: 6 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ReturnOutsideFunction: ~ + name: ReturnOutsideFunction + body: "`return` statement outside of a function/method" + commit: ~ + fixable: false location: row: 9 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F707_F707.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F707_F707.py.snap index 004b700238..5413bf7640 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F707_F707.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F707_F707.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - DefaultExceptNotLast: ~ + name: DefaultExceptNotLast + body: "An `except` block as not the last exception handler" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DefaultExceptNotLast: ~ + name: DefaultExceptNotLast + body: "An `except` block as not the last exception handler" + commit: ~ + fixable: false location: row: 10 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DefaultExceptNotLast: ~ + name: DefaultExceptNotLast + body: "An `except` block as not the last exception handler" + commit: ~ + fixable: false location: row: 19 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F722_F722.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F722_F722.py.snap index 113c438edf..f83a235393 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F722_F722.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F722_F722.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - ForwardAnnotationSyntaxError: - body: /// + name: ForwardAnnotationSyntaxError + body: "Syntax error in forward annotation: `///`" + commit: ~ + fixable: false location: row: 9 column: 11 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_0.py.snap index 42de93e4dc..3c385eaa0a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_0.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - RedefinedWhileUnused: - name: bar - line: 6 + name: RedefinedWhileUnused + body: "Redefinition of unused `bar` from line 6" + commit: ~ + fixable: false location: row: 10 column: 4 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_1.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_1.py.snap index bc08d0213a..23e463e108 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_1.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_1.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - RedefinedWhileUnused: - name: FU - line: 1 + name: RedefinedWhileUnused + body: "Redefinition of unused `FU` from line 1" + commit: ~ + fixable: false location: row: 1 column: 17 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_12.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_12.py.snap index 52982a6b60..e34c74799f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_12.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_12.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - RedefinedWhileUnused: - name: mixer - line: 2 + name: RedefinedWhileUnused + body: "Redefinition of unused `mixer` from line 2" + commit: ~ + fixable: false location: row: 6 column: 19 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_15.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_15.py.snap index 501a4ca139..fcc80ea922 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_15.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_15.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - RedefinedWhileUnused: - name: fu - line: 1 + name: RedefinedWhileUnused + body: "Redefinition of unused `fu` from line 1" + commit: ~ + fixable: false location: row: 4 column: 4 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_16.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_16.py.snap index cac74dd148..49c6bf0f1e 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_16.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_16.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - RedefinedWhileUnused: - name: fu - line: 3 + name: RedefinedWhileUnused + body: "Redefinition of unused `fu` from line 3" + commit: ~ + fixable: false location: row: 8 column: 12 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_17.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_17.py.snap index 98f67d7fee..38d3144809 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_17.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_17.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - RedefinedWhileUnused: - name: fu - line: 2 + name: RedefinedWhileUnused + body: "Redefinition of unused `fu` from line 2" + commit: ~ + fixable: false location: row: 6 column: 11 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedWhileUnused: - name: fu - line: 6 + name: RedefinedWhileUnused + body: "Redefinition of unused `fu` from line 6" + commit: ~ + fixable: false location: row: 9 column: 12 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_2.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_2.py.snap index deddd192a3..8f3a7c6007 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_2.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_2.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - RedefinedWhileUnused: - name: FU - line: 1 + name: RedefinedWhileUnused + body: "Redefinition of unused `FU` from line 1" + commit: ~ + fixable: false location: row: 1 column: 26 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_21.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_21.py.snap index bb00e1918b..ebaf39ec0f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_21.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_21.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - RedefinedWhileUnused: - name: Sequence - line: 26 + name: RedefinedWhileUnused + body: "Redefinition of unused `Sequence` from line 26" + commit: ~ + fixable: false location: row: 32 column: 4 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_3.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_3.py.snap index b183e2fc4a..bd2a44e72f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_3.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_3.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - RedefinedWhileUnused: - name: fu - line: 1 + name: RedefinedWhileUnused + body: "Redefinition of unused `fu` from line 1" + commit: ~ + fixable: false location: row: 1 column: 11 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_4.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_4.py.snap index b183e2fc4a..bd2a44e72f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_4.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_4.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - RedefinedWhileUnused: - name: fu - line: 1 + name: RedefinedWhileUnused + body: "Redefinition of unused `fu` from line 1" + commit: ~ + fixable: false location: row: 1 column: 11 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_5.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_5.py.snap index c397bbe3b6..bfd3290d6d 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_5.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_5.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - RedefinedWhileUnused: - name: fu - line: 1 + name: RedefinedWhileUnused + body: "Redefinition of unused `fu` from line 1" + commit: ~ + fixable: false location: row: 1 column: 12 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_6.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_6.py.snap index ad2d158c51..3019ae248e 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_6.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_6.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - RedefinedWhileUnused: - name: os - line: 5 + name: RedefinedWhileUnused + body: "Redefinition of unused `os` from line 5" + commit: ~ + fixable: false location: row: 6 column: 11 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_8.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_8.py.snap index c355bc38da..e4f9f595b3 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_8.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_8.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - RedefinedWhileUnused: - name: os - line: 4 + name: RedefinedWhileUnused + body: "Redefinition of unused `os` from line 4" + commit: ~ + fixable: false location: row: 5 column: 11 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_0.py.snap index 9659982a51..2ae928577d 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_0.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: self + name: UndefinedName + body: "Undefined name `self`" + commit: ~ + fixable: false location: row: 2 column: 11 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: self + name: UndefinedName + body: "Undefined name `self`" + commit: ~ + fixable: false location: row: 6 column: 12 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: self + name: UndefinedName + body: "Undefined name `self`" + commit: ~ + fixable: false location: row: 10 column: 8 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: numeric_string + name: UndefinedName + body: "Undefined name `numeric_string`" + commit: ~ + fixable: false location: row: 21 column: 11 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: Bar + name: UndefinedName + body: "Undefined name `Bar`" + commit: ~ + fixable: false location: row: 58 column: 3 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: TOMATO + name: UndefinedName + body: "Undefined name `TOMATO`" + commit: ~ + fixable: false location: row: 83 column: 10 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: B + name: UndefinedName + body: "Undefined name `B`" + commit: ~ + fixable: false location: row: 87 column: 7 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: B + name: UndefinedName + body: "Undefined name `B`" + commit: ~ + fixable: false location: row: 90 column: 7 @@ -91,8 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: B + name: UndefinedName + body: "Undefined name `B`" + commit: ~ + fixable: false location: row: 92 column: 10 @@ -102,8 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: B + name: UndefinedName + body: "Undefined name `B`" + commit: ~ + fixable: false location: row: 93 column: 13 @@ -113,8 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: PEP593Test123 + name: UndefinedName + body: "Undefined name `PEP593Test123`" + commit: ~ + fixable: false location: row: 115 column: 8 @@ -124,8 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: foo + name: UndefinedName + body: "Undefined name `foo`" + commit: ~ + fixable: false location: row: 123 column: 13 @@ -135,8 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: bar + name: UndefinedName + body: "Undefined name `bar`" + commit: ~ + fixable: false location: row: 123 column: 20 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_1.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_1.py.snap index 82a439efb1..e39d88bab2 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_1.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_1.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: Model + name: UndefinedName + body: "Undefined name `Model`" + commit: ~ + fixable: false location: row: 11 column: 9 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: Model + name: UndefinedName + body: "Undefined name `Model`" + commit: ~ + fixable: false location: row: 18 column: 16 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: Model + name: UndefinedName + body: "Undefined name `Model`" + commit: ~ + fixable: false location: row: 24 column: 12 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: Model + name: UndefinedName + body: "Undefined name `Model`" + commit: ~ + fixable: false location: row: 30 column: 10 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_11.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_11.py.snap index a9177c79f2..cdea2cb300 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_11.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_11.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: os + name: UndefinedName + body: "Undefined name `os`" + commit: ~ + fixable: false location: row: 18 column: 26 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: Baz + name: UndefinedName + body: "Undefined name `Baz`" + commit: ~ + fixable: false location: row: 23 column: 12 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_12.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_12.py.snap index 68a60b3eb5..9f12e67142 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_12.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_12.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: os + name: UndefinedName + body: "Undefined name `os`" + commit: ~ + fixable: false location: row: 20 column: 26 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: Baz + name: UndefinedName + body: "Undefined name `Baz`" + commit: ~ + fixable: false location: row: 25 column: 12 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_2.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_2.py.snap index 738211c553..df701b14c9 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_2.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_2.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: Model + name: UndefinedName + body: "Undefined name `Model`" + commit: ~ + fixable: false location: row: 5 column: 11 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_3.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_3.py.snap index 727b701e41..fdf346fb33 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_3.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_3.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: key + name: UndefinedName + body: "Undefined name `key`" + commit: ~ + fixable: false location: row: 11 column: 8 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: value + name: UndefinedName + body: "Undefined name `value`" + commit: ~ + fixable: false location: row: 11 column: 15 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_4.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_4.py.snap index 5503b8a1ed..6de1f22c94 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_4.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_4.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: Model + name: UndefinedName + body: "Undefined name `Model`" + commit: ~ + fixable: false location: row: 4 column: 9 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: Model + name: UndefinedName + body: "Undefined name `Model`" + commit: ~ + fixable: false location: row: 9 column: 10 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: Model + name: UndefinedName + body: "Undefined name `Model`" + commit: ~ + fixable: false location: row: 14 column: 14 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: Model + name: UndefinedName + body: "Undefined name `Model`" + commit: ~ + fixable: false location: row: 19 column: 30 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: Model + name: UndefinedName + body: "Undefined name `Model`" + commit: ~ + fixable: false location: row: 24 column: 18 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_5.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_5.py.snap index 2797e3c1da..3e42efe0d8 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_5.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_5.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: InnerClass + name: UndefinedName + body: "Undefined name `InnerClass`" + commit: ~ + fixable: false location: row: 5 column: 29 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_7.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_7.py.snap index 93685d3d42..204ac6783a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_7.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_7.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: Undefined + name: UndefinedName + body: "Undefined name `Undefined`" + commit: ~ + fixable: false location: row: 11 column: 20 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: Undefined + name: UndefinedName + body: "Undefined name `Undefined`" + commit: ~ + fixable: false location: row: 12 column: 25 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: Undefined + name: UndefinedName + body: "Undefined name `Undefined`" + commit: ~ + fixable: false location: row: 13 column: 20 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_9.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_9.py.snap index e25170c57e..b7ab93f034 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_9.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_9.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: captured + name: UndefinedName + body: "Undefined name `captured`" + commit: ~ + fixable: false location: row: 22 column: 19 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_0.py.snap index d40ef04643..96e4228e75 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_0.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedExport: - name: b + name: UndefinedExport + body: "Undefined name `b` in `__all__`" + commit: ~ + fixable: false location: row: 3 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_1.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_1.py.snap index d40ef04643..96e4228e75 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_1.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_1.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedExport: - name: b + name: UndefinedExport + body: "Undefined name `b` in `__all__`" + commit: ~ + fixable: false location: row: 3 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F823_F823.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F823_F823.py.snap index ee2a78e6b4..443f8719b1 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F823_F823.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F823_F823.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedLocal: - name: my_var + name: UndefinedLocal + body: "Local variable `my_var` referenced before assignment" + commit: ~ + fixable: false location: row: 6 column: 4 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_0.py.snap index d178b025fa..d44e197afe 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_0.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UnusedVariable: - name: e + name: UnusedVariable + body: "Local variable `e` is assigned to but never used" + commit: "Remove assignment to unused variable `e`" + fixable: true location: row: 3 column: 21 @@ -21,8 +23,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - UnusedVariable: - name: z + name: UnusedVariable + body: "Local variable `z` is assigned to but never used" + commit: "Remove assignment to unused variable `z`" + fixable: true location: row: 16 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedVariable: - name: foo + name: UnusedVariable + body: "Local variable `foo` is assigned to but never used" + commit: "Remove assignment to unused variable `foo`" + fixable: true location: row: 20 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedVariable: - name: a + name: UnusedVariable + body: "Local variable `a` is assigned to but never used" + commit: "Remove assignment to unused variable `a`" + fixable: true location: row: 21 column: 5 @@ -68,8 +76,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedVariable: - name: b + name: UnusedVariable + body: "Local variable `b` is assigned to but never used" + commit: "Remove assignment to unused variable `b`" + fixable: true location: row: 21 column: 8 @@ -79,8 +89,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedVariable: - name: baz + name: UnusedVariable + body: "Local variable `baz` is assigned to but never used" + commit: "Remove assignment to unused variable `baz`" + fixable: true location: row: 26 column: 13 @@ -97,8 +109,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - UnusedVariable: - name: b + name: UnusedVariable + body: "Local variable `b` is assigned to but never used" + commit: "Remove assignment to unused variable `b`" + fixable: true location: row: 51 column: 8 @@ -115,8 +129,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - UnusedVariable: - name: my_file + name: UnusedVariable + body: "Local variable `my_file` is assigned to but never used" + commit: "Remove assignment to unused variable `my_file`" + fixable: true location: row: 79 column: 25 @@ -133,8 +149,10 @@ expression: diagnostics column: 32 parent: ~ - kind: - UnusedVariable: - name: my_file + name: UnusedVariable + body: "Local variable `my_file` is assigned to but never used" + commit: "Remove assignment to unused variable `my_file`" + fixable: true location: row: 85 column: 24 @@ -151,8 +169,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - UnusedVariable: - name: msg3 + name: UnusedVariable + body: "Local variable `msg3` is assigned to but never used" + commit: "Remove assignment to unused variable `msg3`" + fixable: true location: row: 102 column: 4 @@ -169,8 +189,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedVariable: - name: Baz + name: UnusedVariable + body: "Local variable `Baz` is assigned to but never used" + commit: "Remove assignment to unused variable `Baz`" + fixable: true location: row: 115 column: 4 @@ -187,8 +209,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - UnusedVariable: - name: y + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + commit: "Remove assignment to unused variable `y`" + fixable: true location: row: 122 column: 13 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_1.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_1.py.snap index b2a622cdc7..ad601f322e 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_1.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_1.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UnusedVariable: - name: x + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + commit: "Remove assignment to unused variable `x`" + fixable: true location: row: 6 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedVariable: - name: y + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + commit: "Remove assignment to unused variable `y`" + fixable: true location: row: 6 column: 7 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedVariable: - name: coords + name: UnusedVariable + body: "Local variable `coords` is assigned to but never used" + commit: "Remove assignment to unused variable `coords`" + fixable: true location: row: 16 column: 13 @@ -43,8 +49,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - UnusedVariable: - name: coords + name: UnusedVariable + body: "Local variable `coords` is assigned to but never used" + commit: "Remove assignment to unused variable `coords`" + fixable: true location: row: 20 column: 4 @@ -61,8 +69,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - UnusedVariable: - name: a + name: UnusedVariable + body: "Local variable `a` is assigned to but never used" + commit: "Remove assignment to unused variable `a`" + fixable: true location: row: 24 column: 5 @@ -72,8 +82,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedVariable: - name: b + name: UnusedVariable + body: "Local variable `b` is assigned to but never used" + commit: "Remove assignment to unused variable `b`" + fixable: true location: row: 24 column: 8 @@ -83,8 +95,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedVariable: - name: x + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + commit: "Remove assignment to unused variable `x`" + fixable: true location: row: 24 column: 14 @@ -94,8 +108,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedVariable: - name: y + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + commit: "Remove assignment to unused variable `y`" + fixable: true location: row: 24 column: 17 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_3.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_3.py.snap index c3253d8efa..d35b157ff5 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_3.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_3.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UnusedVariable: - name: x + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + commit: "Remove assignment to unused variable `x`" + fixable: true location: row: 5 column: 4 @@ -21,8 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedVariable: - name: y + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + commit: "Remove assignment to unused variable `y`" + fixable: true location: row: 6 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedVariable: - name: x + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + commit: "Remove assignment to unused variable `x`" + fixable: true location: row: 13 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedVariable: - name: y + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + commit: "Remove assignment to unused variable `y`" + fixable: true location: row: 14 column: 4 @@ -75,8 +83,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedVariable: - name: x1 + name: UnusedVariable + body: "Local variable `x1` is assigned to but never used" + commit: "Remove assignment to unused variable `x1`" + fixable: true location: row: 21 column: 18 @@ -93,8 +103,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - UnusedVariable: - name: x3 + name: UnusedVariable + body: "Local variable `x3` is assigned to but never used" + commit: "Remove assignment to unused variable `x3`" + fixable: true location: row: 27 column: 19 @@ -111,8 +123,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - UnusedVariable: - name: y3 + name: UnusedVariable + body: "Local variable `y3` is assigned to but never used" + commit: "Remove assignment to unused variable `y3`" + fixable: true location: row: 27 column: 32 @@ -129,8 +143,10 @@ expression: diagnostics column: 34 parent: ~ - kind: - UnusedVariable: - name: z3 + name: UnusedVariable + body: "Local variable `z3` is assigned to but never used" + commit: "Remove assignment to unused variable `z3`" + fixable: true location: row: 27 column: 45 @@ -147,8 +163,10 @@ expression: diagnostics column: 47 parent: ~ - kind: - UnusedVariable: - name: x1 + name: UnusedVariable + body: "Local variable `x1` is assigned to but never used" + commit: "Remove assignment to unused variable `x1`" + fixable: true location: row: 32 column: 5 @@ -158,8 +176,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedVariable: - name: y1 + name: UnusedVariable + body: "Local variable `y1` is assigned to but never used" + commit: "Remove assignment to unused variable `y1`" + fixable: true location: row: 32 column: 9 @@ -169,8 +189,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedVariable: - name: coords2 + name: UnusedVariable + body: "Local variable `coords2` is assigned to but never used" + commit: "Remove assignment to unused variable `coords2`" + fixable: true location: row: 33 column: 15 @@ -187,8 +209,10 @@ expression: diagnostics column: 25 parent: ~ - kind: - UnusedVariable: - name: coords3 + name: UnusedVariable + body: "Local variable `coords3` is assigned to but never used" + commit: "Remove assignment to unused variable `coords3`" + fixable: true location: row: 34 column: 4 @@ -205,8 +229,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - UnusedVariable: - name: x1 + name: UnusedVariable + body: "Local variable `x1` is assigned to but never used" + commit: "Remove assignment to unused variable `x1`" + fixable: true location: row: 40 column: 25 @@ -223,8 +249,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - UnusedVariable: - name: x2 + name: UnusedVariable + body: "Local variable `x2` is assigned to but never used" + commit: "Remove assignment to unused variable `x2`" + fixable: true location: row: 45 column: 46 @@ -241,8 +269,10 @@ expression: diagnostics column: 48 parent: ~ - kind: - UnusedVariable: - name: x + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + commit: "Remove assignment to unused variable `x`" + fixable: true location: row: 50 column: 4 @@ -259,8 +289,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - UnusedVariable: - name: y + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + commit: "Remove assignment to unused variable `y`" + fixable: true location: row: 56 column: 4 @@ -277,8 +309,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - UnusedVariable: - name: x + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + commit: "Remove assignment to unused variable `x`" + fixable: true location: row: 61 column: 4 @@ -295,8 +329,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - UnusedVariable: - name: y + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + commit: "Remove assignment to unused variable `y`" + fixable: true location: row: 67 column: 4 @@ -313,8 +349,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedVariable: - name: cm + name: UnusedVariable + body: "Local variable `cm` is assigned to but never used" + commit: "Remove assignment to unused variable `cm`" + fixable: true location: row: 72 column: 23 @@ -331,8 +369,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - UnusedVariable: - name: cm + name: UnusedVariable + body: "Local variable `cm` is assigned to but never used" + commit: "Remove assignment to unused variable `cm`" + fixable: true location: row: 77 column: 24 @@ -349,8 +389,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - UnusedVariable: - name: toplevel + name: UnusedVariable + body: "Local variable `toplevel` is assigned to but never used" + commit: "Remove assignment to unused variable `toplevel`" + fixable: true location: row: 87 column: 4 @@ -367,8 +409,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - UnusedVariable: - name: toplevel + name: UnusedVariable + body: "Local variable `toplevel` is assigned to but never used" + commit: "Remove assignment to unused variable `toplevel`" + fixable: true location: row: 93 column: 4 @@ -385,8 +429,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - UnusedVariable: - name: tt + name: UnusedVariable + body: "Local variable `tt` is assigned to but never used" + commit: "Remove assignment to unused variable `tt`" + fixable: true location: row: 93 column: 15 @@ -403,8 +449,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - UnusedVariable: - name: toplevel + name: UnusedVariable + body: "Local variable `toplevel` is assigned to but never used" + commit: "Remove assignment to unused variable `toplevel`" + fixable: true location: row: 97 column: 4 @@ -421,8 +469,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - UnusedVariable: - name: toplevel + name: UnusedVariable + body: "Local variable `toplevel` is assigned to but never used" + commit: "Remove assignment to unused variable `toplevel`" + fixable: true location: row: 101 column: 13 @@ -439,8 +489,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - UnusedVariable: - name: toplevel + name: UnusedVariable + body: "Local variable `toplevel` is assigned to but never used" + commit: "Remove assignment to unused variable `toplevel`" + fixable: true location: row: 105 column: 4 @@ -457,8 +509,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - UnusedVariable: - name: tt + name: UnusedVariable + body: "Local variable `tt` is assigned to but never used" + commit: "Remove assignment to unused variable `tt`" + fixable: true location: row: 105 column: 15 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F842_F842.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F842_F842.py.snap index a832980b21..a3f367845b 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F842_F842.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F842_F842.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UnusedAnnotation: - name: name + name: UnusedAnnotation + body: "Local variable `name` is annotated but never used" + commit: ~ + fixable: false location: row: 2 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedAnnotation: - name: age + name: UnusedAnnotation + body: "Local variable `age` is annotated but never used" + commit: ~ + fixable: false location: row: 3 column: 4 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F901_F901.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F901_F901.py.snap index 18bb1acaad..1c4edb8bb5 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F901_F901.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F901_F901.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - RaiseNotImplemented: ~ + name: RaiseNotImplemented + body: "`raise NotImplemented` should be `raise NotImplementedError`" + commit: "Use `raise NotImplementedError`" + fixable: true location: row: 2 column: 10 @@ -20,7 +23,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - RaiseNotImplemented: ~ + name: RaiseNotImplemented + body: "`raise NotImplemented` should be `raise NotImplementedError`" + commit: "Use `raise NotImplementedError`" + fixable: true location: row: 6 column: 10 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_builtins.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_builtins.snap index 4428329222..cc68cb95c3 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_builtins.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_builtins.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: _ + name: UndefinedName + body: "Undefined name `_`" + commit: ~ + fixable: false location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_typing_modules.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_typing_modules.snap index 92b9d5df07..601bf6ad50 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_typing_modules.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_typing_modules.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: db + name: UndefinedName + body: "Undefined name `db`" + commit: ~ + fixable: false location: row: 6 column: 34 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_typing_modules.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_typing_modules.snap index 31fae03ad2..9c648f0aa2 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_typing_modules.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_typing_modules.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: Class + name: UndefinedName + body: "Undefined name `Class`" + commit: ~ + fixable: false location: row: 7 column: 13 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__f841_dummy_variable_rgx.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__f841_dummy_variable_rgx.snap index 73e7beebd4..967857a8bb 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__f841_dummy_variable_rgx.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__f841_dummy_variable_rgx.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UnusedVariable: - name: e + name: UnusedVariable + body: "Local variable `e` is assigned to but never used" + commit: "Remove assignment to unused variable `e`" + fixable: true location: row: 3 column: 21 @@ -21,8 +23,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - UnusedVariable: - name: foo + name: UnusedVariable + body: "Local variable `foo` is assigned to but never used" + commit: "Remove assignment to unused variable `foo`" + fixable: true location: row: 20 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedVariable: - name: a + name: UnusedVariable + body: "Local variable `a` is assigned to but never used" + commit: "Remove assignment to unused variable `a`" + fixable: true location: row: 21 column: 5 @@ -50,8 +56,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedVariable: - name: b + name: UnusedVariable + body: "Local variable `b` is assigned to but never used" + commit: "Remove assignment to unused variable `b`" + fixable: true location: row: 21 column: 8 @@ -61,8 +69,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedVariable: - name: baz + name: UnusedVariable + body: "Local variable `baz` is assigned to but never used" + commit: "Remove assignment to unused variable `baz`" + fixable: true location: row: 26 column: 13 @@ -79,8 +89,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - UnusedVariable: - name: _ + name: UnusedVariable + body: "Local variable `_` is assigned to but never used" + commit: "Remove assignment to unused variable `_`" + fixable: true location: row: 35 column: 4 @@ -97,8 +109,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedVariable: - name: __ + name: UnusedVariable + body: "Local variable `__` is assigned to but never used" + commit: "Remove assignment to unused variable `__`" + fixable: true location: row: 36 column: 4 @@ -115,8 +129,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedVariable: - name: _discarded + name: UnusedVariable + body: "Local variable `_discarded` is assigned to but never used" + commit: "Remove assignment to unused variable `_discarded`" + fixable: true location: row: 37 column: 4 @@ -133,8 +149,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - UnusedVariable: - name: b + name: UnusedVariable + body: "Local variable `b` is assigned to but never used" + commit: "Remove assignment to unused variable `b`" + fixable: true location: row: 51 column: 8 @@ -151,8 +169,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - UnusedVariable: - name: my_file + name: UnusedVariable + body: "Local variable `my_file` is assigned to but never used" + commit: "Remove assignment to unused variable `my_file`" + fixable: true location: row: 79 column: 25 @@ -169,8 +189,10 @@ expression: diagnostics column: 32 parent: ~ - kind: - UnusedVariable: - name: my_file + name: UnusedVariable + body: "Local variable `my_file` is assigned to but never used" + commit: "Remove assignment to unused variable `my_file`" + fixable: true location: row: 85 column: 24 @@ -187,8 +209,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - UnusedVariable: - name: msg3 + name: UnusedVariable + body: "Local variable `msg3` is assigned to but never used" + commit: "Remove assignment to unused variable `msg3`" + fixable: true location: row: 102 column: 4 @@ -205,8 +229,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedVariable: - name: Baz + name: UnusedVariable + body: "Local variable `Baz` is assigned to but never used" + commit: "Remove assignment to unused variable `Baz`" + fixable: true location: row: 115 column: 4 @@ -223,8 +249,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - UnusedVariable: - name: y + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + commit: "Remove assignment to unused variable `y`" + fixable: true location: row: 122 column: 13 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__future_annotations.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__future_annotations.snap index 2e62925681..13cf65afef 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__future_annotations.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__future_annotations.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UnusedImport: - name: models.Nut - ignore_init: false - multiple: false + name: UnusedImport + body: "`models.Nut` imported but unused" + commit: "Remove unused import: `models.Nut`" + fixable: true location: row: 8 column: 4 @@ -25,8 +25,10 @@ expression: diagnostics row: 6 column: 0 - kind: - UndefinedName: - name: Bar + name: UndefinedName + body: "Undefined name `Bar`" + commit: ~ + fixable: false location: row: 26 column: 18 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__multi_statement_lines.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__multi_statement_lines.snap index fe03088dce..75d9a20973 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__multi_statement_lines.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__multi_statement_lines.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UnusedImport: - name: foo1 - ignore_init: false - multiple: false + name: UnusedImport + body: "`foo1` imported but unused" + commit: "Remove unused import: `foo1`" + fixable: true location: row: 3 column: 11 @@ -23,10 +23,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - UnusedImport: - name: foo2 - ignore_init: false - multiple: false + name: UnusedImport + body: "`foo2` imported but unused" + commit: "Remove unused import: `foo2`" + fixable: true location: row: 4 column: 11 @@ -43,10 +43,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - UnusedImport: - name: foo3 - ignore_init: false - multiple: false + name: UnusedImport + body: "`foo3` imported but unused" + commit: "Remove unused import: `foo3`" + fixable: true location: row: 7 column: 11 @@ -63,10 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedImport: - name: foo4 - ignore_init: false - multiple: false + name: UnusedImport + body: "`foo4` imported but unused" + commit: "Remove unused import: `foo4`" + fixable: true location: row: 11 column: 11 @@ -83,10 +83,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - UnusedImport: - name: foo5 - ignore_init: false - multiple: false + name: UnusedImport + body: "`foo5` imported but unused" + commit: "Remove unused import: `foo5`" + fixable: true location: row: 16 column: 18 @@ -103,10 +103,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - UnusedImport: - name: foo6 - ignore_init: false - multiple: false + name: UnusedImport + body: "`foo6` imported but unused" + commit: "Remove unused import: `foo6`" + fixable: true location: row: 21 column: 16 @@ -123,10 +123,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - UnusedImport: - name: foo7 - ignore_init: false - multiple: false + name: UnusedImport + body: "`foo7` imported but unused" + commit: "Remove unused import: `foo7`" + fixable: true location: row: 26 column: 17 @@ -143,10 +143,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - UnusedImport: - name: foo8 - ignore_init: false - multiple: false + name: UnusedImport + body: "`foo8` imported but unused" + commit: "Remove unused import: `foo8`" + fixable: true location: row: 30 column: 18 @@ -163,10 +163,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - UnusedImport: - name: foo9 - ignore_init: false - multiple: false + name: UnusedImport + body: "`foo9` imported but unused" + commit: "Remove unused import: `foo9`" + fixable: true location: row: 31 column: 22 @@ -183,10 +183,10 @@ expression: diagnostics column: 32 parent: ~ - kind: - UnusedImport: - name: foo10 - ignore_init: false - multiple: false + name: UnusedImport + body: "`foo10` imported but unused" + commit: "Remove unused import: `foo10`" + fixable: true location: row: 35 column: 15 @@ -203,10 +203,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - UnusedImport: - name: foo11 - ignore_init: false - multiple: false + name: UnusedImport + body: "`foo11` imported but unused" + commit: "Remove unused import: `foo11`" + fixable: true location: row: 40 column: 16 @@ -223,10 +223,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - UnusedImport: - name: foo12 - ignore_init: false - multiple: false + name: UnusedImport + body: "`foo12` imported but unused" + commit: "Remove unused import: `foo12`" + fixable: true location: row: 46 column: 7 @@ -243,10 +243,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - UnusedImport: - name: foo13 - ignore_init: false - multiple: false + name: UnusedImport + body: "`foo13` imported but unused" + commit: "Remove unused import: `foo13`" + fixable: true location: row: 51 column: 7 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__nested_relative_typing_module.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__nested_relative_typing_module.snap index 558cf66a17..27e9e00d7f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__nested_relative_typing_module.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__nested_relative_typing_module.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: foo + name: UndefinedName + body: "Undefined name `foo`" + commit: ~ + fixable: false location: row: 26 column: 15 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UndefinedName: - name: foo + name: UndefinedName + body: "Undefined name `foo`" + commit: ~ + fixable: false location: row: 33 column: 15 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__relative_typing_module.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__relative_typing_module.snap index fe0d50ef18..8188ae0075 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__relative_typing_module.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__relative_typing_module.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- - kind: - UndefinedName: - name: foo + name: UndefinedName + body: "Undefined name `foo`" + commit: ~ + fixable: false location: row: 26 column: 15 diff --git a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_0.py.snap b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_0.py.snap index f6071b5521..ef5505d8c8 100644 --- a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_0.py.snap +++ b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_0.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pygrep_hooks/mod.rs +source: crates/ruff/src/rules/pygrep_hooks/mod.rs expression: diagnostics --- - kind: - NoEval: ~ + name: NoEval + body: "No builtin `eval()` allowed" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NoEval: ~ + name: NoEval + body: "No builtin `eval()` allowed" + commit: ~ + fixable: false location: row: 9 column: 4 diff --git a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_1.py.snap b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_1.py.snap index cc6394ef9f..20ef99b494 100644 --- a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_1.py.snap +++ b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_1.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pygrep_hooks/mod.rs +source: crates/ruff/src/rules/pygrep_hooks/mod.rs expression: diagnostics --- - kind: - DeprecatedLogWarn: ~ + name: DeprecatedLogWarn + body: "`warn` is deprecated in favor of `warning`" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DeprecatedLogWarn: ~ + name: DeprecatedLogWarn + body: "`warn` is deprecated in favor of `warning`" + commit: ~ + fixable: false location: row: 5 column: 0 diff --git a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap index 6887135fd4..4aa5555a4b 100644 --- a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap +++ b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pygrep_hooks/mod.rs +source: crates/ruff/src/rules/pygrep_hooks/mod.rs expression: diagnostics --- - kind: - BlanketTypeIgnore: ~ + name: BlanketTypeIgnore + body: Use specific rule codes when ignoring type issues + commit: ~ + fixable: false location: row: 1 column: 7 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlanketTypeIgnore: ~ + name: BlanketTypeIgnore + body: Use specific rule codes when ignoring type issues + commit: ~ + fixable: false location: row: 2 column: 7 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlanketTypeIgnore: ~ + name: BlanketTypeIgnore + body: Use specific rule codes when ignoring type issues + commit: ~ + fixable: false location: row: 3 column: 7 diff --git a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap index 43e505fd97..cce7b9d88b 100644 --- a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap +++ b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pygrep_hooks/mod.rs +source: crates/ruff/src/rules/pygrep_hooks/mod.rs expression: diagnostics --- - kind: - BlanketNOQA: ~ + name: BlanketNOQA + body: "Use specific rule codes when using `noqa`" + commit: ~ + fixable: false location: row: 1 column: 7 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlanketNOQA: ~ + name: BlanketNOQA + body: "Use specific rule codes when using `noqa`" + commit: ~ + fixable: false location: row: 2 column: 7 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlanketNOQA: ~ + name: BlanketNOQA + body: "Use specific rule codes when using `noqa`" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlanketNOQA: ~ + name: BlanketNOQA + body: "Use specific rule codes when using `noqa`" + commit: ~ + fixable: false location: row: 4 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlanketNOQA: ~ + name: BlanketNOQA + body: "Use specific rule codes when using `noqa`" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BlanketNOQA: ~ + name: BlanketNOQA + body: "Use specific rule codes when using `noqa`" + commit: ~ + fixable: false location: row: 6 column: 0 diff --git a/crates/ruff/src/rules/pylint/rules/consider_using_sys_exit.rs b/crates/ruff/src/rules/pylint/rules/consider_using_sys_exit.rs index 03e648c9a7..89c0c080f0 100644 --- a/crates/ruff/src/rules/pylint/rules/consider_using_sys_exit.rs +++ b/crates/ruff/src/rules/pylint/rules/consider_using_sys_exit.rs @@ -5,7 +5,7 @@ use ruff_python_ast::types::{BindingKind, Range}; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{AutofixKind, Availability, Violation}; #[violation] diff --git a/crates/ruff/src/rules/pylint/rules/use_from_import.rs b/crates/ruff/src/rules/pylint/rules/use_from_import.rs index 81c81cf27f..789435862c 100644 --- a/crates/ruff/src/rules/pylint/rules/use_from_import.rs +++ b/crates/ruff/src/rules/pylint/rules/use_from_import.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{AutofixKind, Availability, Violation}; #[violation] diff --git a/crates/ruff/src/rules/pylint/rules/useless_import_alias.rs b/crates/ruff/src/rules/pylint/rules/useless_import_alias.rs index 03ecef22b6..7eaca116e6 100644 --- a/crates/ruff/src/rules/pylint/rules/useless_import_alias.rs +++ b/crates/ruff/src/rules/pylint/rules/useless_import_alias.rs @@ -5,7 +5,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC0414_import_aliasing.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC0414_import_aliasing.py.snap index fb839b561a..407cc6ab9b 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC0414_import_aliasing.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC0414_import_aliasing.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - UselessImportAlias: ~ + name: UselessImportAlias + body: Import alias does not rename original package + commit: Remove import alias + fixable: true location: row: 6 column: 7 @@ -20,7 +23,10 @@ expression: diagnostics column: 33 parent: ~ - kind: - UselessImportAlias: ~ + name: UselessImportAlias + body: Import alias does not rename original package + commit: Remove import alias + fixable: true location: row: 7 column: 24 @@ -37,7 +43,10 @@ expression: diagnostics column: 50 parent: ~ - kind: - UselessImportAlias: ~ + name: UselessImportAlias + body: Import alias does not rename original package + commit: Remove import alias + fixable: true location: row: 16 column: 14 @@ -54,7 +63,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - UselessImportAlias: ~ + name: UselessImportAlias + body: Import alias does not rename original package + commit: Remove import alias + fixable: true location: row: 19 column: 18 @@ -71,7 +83,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - UselessImportAlias: ~ + name: UselessImportAlias + body: Import alias does not rename original package + commit: Remove import alias + fixable: true location: row: 20 column: 22 @@ -88,7 +103,10 @@ expression: diagnostics column: 38 parent: ~ - kind: - UselessImportAlias: ~ + name: UselessImportAlias + body: Import alias does not rename original package + commit: Remove import alias + fixable: true location: row: 22 column: 14 @@ -105,7 +123,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - UselessImportAlias: ~ + name: UselessImportAlias + body: Import alias does not rename original package + commit: Remove import alias + fixable: true location: row: 23 column: 26 @@ -122,7 +143,10 @@ expression: diagnostics column: 38 parent: ~ - kind: - UselessImportAlias: ~ + name: UselessImportAlias + body: Import alias does not rename original package + commit: Remove import alias + fixable: true location: row: 25 column: 20 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap index 37d5d7d964..8d1cb89839 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - UnnecessaryDirectLambdaCall: ~ + name: UnnecessaryDirectLambdaCall + body: Lambda expression called directly. Execute the expression inline instead. + commit: ~ + fixable: false location: row: 4 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessaryDirectLambdaCall: ~ + name: UnnecessaryDirectLambdaCall + body: Lambda expression called directly. Execute the expression inline instead. + commit: ~ + fixable: false location: row: 5 column: 8 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnnecessaryDirectLambdaCall: ~ + name: UnnecessaryDirectLambdaCall + body: Lambda expression called directly. Execute the expression inline instead. + commit: ~ + fixable: false location: row: 5 column: 29 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0100_yield_in_init.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0100_yield_in_init.py.snap index dadaf449aa..161c363ae1 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0100_yield_in_init.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0100_yield_in_init.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - YieldInInit: ~ + name: YieldInInit + body: "`__init__` method is a generator" + commit: ~ + fixable: false location: row: 9 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - YieldInInit: ~ + name: YieldInInit + body: "`__init__` method is a generator" + commit: ~ + fixable: false location: row: 14 column: 8 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0101_return_in_init.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0101_return_in_init.py.snap index ceb9f59957..e4494fe4f3 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0101_return_in_init.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0101_return_in_init.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - ReturnInInit: ~ + name: ReturnInInit + body: "Explicit return in `__init__`" + commit: ~ + fixable: false location: row: 14 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ReturnInInit: ~ + name: ReturnInInit + body: "Explicit return in `__init__`" + commit: ~ + fixable: false location: row: 22 column: 8 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap index fc1c309948..546ef40612 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - NonlocalWithoutBinding: - name: x + name: NonlocalWithoutBinding + body: "Nonlocal name `x` found without binding" + commit: ~ + fixable: false location: row: 5 column: 13 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NonlocalWithoutBinding: - name: y + name: NonlocalWithoutBinding + body: "Nonlocal name `y` found without binding" + commit: ~ + fixable: false location: row: 9 column: 13 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - NonlocalWithoutBinding: - name: y + name: NonlocalWithoutBinding + body: "Nonlocal name `y` found without binding" + commit: ~ + fixable: false location: row: 19 column: 17 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0118_used_prior_global_declaration.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0118_used_prior_global_declaration.py.snap index a051584a63..2dc7cbaa33 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0118_used_prior_global_declaration.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0118_used_prior_global_declaration.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - UsedPriorGlobalDeclaration: - name: x - line: 7 + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 7" + commit: ~ + fixable: false location: row: 5 column: 10 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UsedPriorGlobalDeclaration: - name: x - line: 17 + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 17" + commit: ~ + fixable: false location: row: 15 column: 10 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UsedPriorGlobalDeclaration: - name: x - line: 25 + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 25" + commit: ~ + fixable: false location: row: 23 column: 10 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UsedPriorGlobalDeclaration: - name: x - line: 35 + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 35" + commit: ~ + fixable: false location: row: 33 column: 10 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UsedPriorGlobalDeclaration: - name: x - line: 43 + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 43" + commit: ~ + fixable: false location: row: 41 column: 4 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UsedPriorGlobalDeclaration: - name: x - line: 53 + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 53" + commit: ~ + fixable: false location: row: 51 column: 4 @@ -75,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UsedPriorGlobalDeclaration: - name: x - line: 61 + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 61" + commit: ~ + fixable: false location: row: 59 column: 8 @@ -87,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UsedPriorGlobalDeclaration: - name: x - line: 71 + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 71" + commit: ~ + fixable: false location: row: 69 column: 8 @@ -99,9 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UsedPriorGlobalDeclaration: - name: x - line: 79 + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 79" + commit: ~ + fixable: false location: row: 77 column: 8 @@ -111,9 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UsedPriorGlobalDeclaration: - name: x - line: 89 + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 89" + commit: ~ + fixable: false location: row: 87 column: 8 @@ -123,9 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UsedPriorGlobalDeclaration: - name: x - line: 97 + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 97" + commit: ~ + fixable: false location: row: 95 column: 8 @@ -135,9 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UsedPriorGlobalDeclaration: - name: x - line: 107 + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 107" + commit: ~ + fixable: false location: row: 105 column: 8 @@ -147,9 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UsedPriorGlobalDeclaration: - name: x - line: 114 + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 114" + commit: ~ + fixable: false location: row: 113 column: 13 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0604_invalid_all_object.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0604_invalid_all_object.py.snap index 5552f55bdc..8adcb98d99 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0604_invalid_all_object.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0604_invalid_all_object.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - InvalidAllObject: ~ + name: InvalidAllObject + body: "Invalid object in `__all__`, must contain only strings" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidAllObject: ~ + name: InvalidAllObject + body: "Invalid object in `__all__`, must contain only strings" + commit: ~ + fixable: false location: row: 7 column: 0 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0605_invalid_all_format.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0605_invalid_all_format.py.snap index a7bd2ae80b..d4aa768ce8 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0605_invalid_all_format.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0605_invalid_all_format.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - InvalidAllFormat: ~ + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + commit: ~ + fixable: false location: row: 1 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidAllFormat: ~ + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidAllFormat: ~ + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + commit: ~ + fixable: false location: row: 5 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidAllFormat: ~ + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + commit: ~ + fixable: false location: row: 7 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidAllFormat: ~ + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + commit: ~ + fixable: false location: row: 9 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidAllFormat: ~ + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + commit: ~ + fixable: false location: row: 11 column: 0 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidAllFormat: ~ + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + commit: ~ + fixable: false location: row: 13 column: 0 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - InvalidAllFormat: ~ + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + commit: ~ + fixable: false location: row: 15 column: 0 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1142_await_outside_async.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1142_await_outside_async.py.snap index e07c4a8163..7528697964 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1142_await_outside_async.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1142_await_outside_async.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - AwaitOutsideAsync: ~ + name: AwaitOutsideAsync + body: "`await` should be used within an async function" + commit: ~ + fixable: false location: row: 12 column: 10 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AwaitOutsideAsync: ~ + name: AwaitOutsideAsync + body: "`await` should be used within an async function" + commit: ~ + fixable: false location: row: 25 column: 8 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap index 87c74fa545..c27bca15d6 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - LoggingTooManyArgs: ~ + name: LoggingTooManyArgs + body: "Too many arguments for `logging` format string" + commit: ~ + fixable: false location: row: 3 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - LoggingTooManyArgs: ~ + name: LoggingTooManyArgs + body: "Too many arguments for `logging` format string" + commit: ~ + fixable: false location: row: 5 column: 0 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap index 3b4a27779f..339fc09583 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - LoggingTooFewArgs: ~ + name: LoggingTooFewArgs + body: "Not enough arguments for `logging` format string" + commit: ~ + fixable: false location: row: 3 column: 0 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap index 2fea45596f..21b2a187d0 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - BadStringFormatType: ~ + name: BadStringFormatType + body: Format type does not match argument type + commit: ~ + fixable: false location: row: 2 column: 6 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStringFormatType: ~ + name: BadStringFormatType + body: Format type does not match argument type + commit: ~ + fixable: false location: row: 4 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStringFormatType: ~ + name: BadStringFormatType + body: Format type does not match argument type + commit: ~ + fixable: false location: row: 6 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStringFormatType: ~ + name: BadStringFormatType + body: Format type does not match argument type + commit: ~ + fixable: false location: row: 7 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStringFormatType: ~ + name: BadStringFormatType + body: Format type does not match argument type + commit: ~ + fixable: false location: row: 8 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStringFormatType: ~ + name: BadStringFormatType + body: Format type does not match argument type + commit: ~ + fixable: false location: row: 9 column: 0 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStringFormatType: ~ + name: BadStringFormatType + body: Format type does not match argument type + commit: ~ + fixable: false location: row: 10 column: 0 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStringFormatType: ~ + name: BadStringFormatType + body: Format type does not match argument type + commit: ~ + fixable: false location: row: 12 column: 0 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStringFormatType: ~ + name: BadStringFormatType + body: Format type does not match argument type + commit: ~ + fixable: false location: row: 13 column: 0 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStringFormatType: ~ + name: BadStringFormatType + body: Format type does not match argument type + commit: ~ + fixable: false location: row: 14 column: 6 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStringFormatType: ~ + name: BadStringFormatType + body: Format type does not match argument type + commit: ~ + fixable: false location: row: 15 column: 0 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap index 4a1f67a26a..c5437f350a 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - BadStrStripCall: - strip: Strip - removal: ~ + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + commit: ~ + fixable: false location: row: 2 column: 20 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: Strip - removal: ~ + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + commit: ~ + fixable: false location: row: 5 column: 20 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: Strip - removal: ~ + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + commit: ~ + fixable: false location: row: 8 column: 20 @@ -39,9 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: Strip - removal: ~ + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + commit: ~ + fixable: false location: row: 11 column: 20 @@ -51,9 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: Strip - removal: ~ + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + commit: ~ + fixable: false location: row: 14 column: 20 @@ -63,9 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: Strip - removal: ~ + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + commit: ~ + fixable: false location: row: 17 column: 20 @@ -75,9 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: Strip - removal: ~ + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + commit: ~ + fixable: false location: row: 20 column: 20 @@ -87,9 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: Strip - removal: ~ + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + commit: ~ + fixable: false location: row: 23 column: 20 @@ -99,9 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: Strip - removal: ~ + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + commit: ~ + fixable: false location: row: 26 column: 20 @@ -111,9 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: Strip - removal: ~ + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + commit: ~ + fixable: false location: row: 30 column: 4 @@ -123,9 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: Strip - removal: ~ + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + commit: ~ + fixable: false location: row: 36 column: 20 @@ -135,9 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: Strip - removal: ~ + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + commit: ~ + fixable: false location: row: 42 column: 4 @@ -147,9 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: Strip - removal: ~ + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + commit: ~ + fixable: false location: row: 49 column: 4 @@ -159,9 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: Strip - removal: ~ + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + commit: ~ + fixable: false location: row: 61 column: 10 @@ -171,9 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: LStrip - removal: RemovePrefix + name: BadStrStripCall + body: "String `lstrip` call contains duplicate characters (did you mean `removeprefix`?)" + commit: ~ + fixable: false location: row: 64 column: 11 @@ -183,9 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BadStrStripCall: - strip: RStrip - removal: RemoveSuffix + name: BadStrStripCall + body: "String `rstrip` call contains duplicate characters (did you mean `removesuffix`?)" + commit: ~ + fixable: false location: row: 67 column: 11 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap index db177fe232..8b10750a4d 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - BidirectionalUnicode: ~ + name: BidirectionalUnicode + body: Contains control characters that can permit obfuscated code + commit: ~ + fixable: false location: row: 2 column: 0 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BidirectionalUnicode: ~ + name: BidirectionalUnicode + body: Contains control characters that can permit obfuscated code + commit: ~ + fixable: false location: row: 5 column: 0 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BidirectionalUnicode: ~ + name: BidirectionalUnicode + body: Contains control characters that can permit obfuscated code + commit: ~ + fixable: false location: row: 8 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - BidirectionalUnicode: ~ + name: BidirectionalUnicode + body: Contains control characters that can permit obfuscated code + commit: ~ + fixable: false location: row: 14 column: 0 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0133_comparison_of_constant.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0133_comparison_of_constant.py.snap index 296c281140..da85413207 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0133_comparison_of_constant.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0133_comparison_of_constant.py.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - ComparisonOfConstant: - left_constant: "100" - op: Eq - right_constant: "100" + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `100 == 100`" + commit: ~ + fixable: false location: row: 3 column: 3 @@ -16,10 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComparisonOfConstant: - left_constant: "1" - op: Eq - right_constant: "3" + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `1 == 3`" + commit: ~ + fixable: false location: row: 6 column: 3 @@ -29,10 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComparisonOfConstant: - left_constant: "1" - op: NotEq - right_constant: "3" + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `1 != 3`" + commit: ~ + fixable: false location: row: 9 column: 3 @@ -42,10 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComparisonOfConstant: - left_constant: "4" - op: Eq - right_constant: "3" + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `4 == 3`" + commit: ~ + fixable: false location: row: 13 column: 3 @@ -55,10 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComparisonOfConstant: - left_constant: "1" - op: Gt - right_constant: "0" + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `1 > 0`" + commit: ~ + fixable: false location: row: 23 column: 3 @@ -68,10 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComparisonOfConstant: - left_constant: "1" - op: GtE - right_constant: "0" + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `1 >= 0`" + commit: ~ + fixable: false location: row: 29 column: 3 @@ -81,10 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComparisonOfConstant: - left_constant: "1" - op: Lt - right_constant: "0" + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `1 < 0`" + commit: ~ + fixable: false location: row: 35 column: 3 @@ -94,10 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComparisonOfConstant: - left_constant: "1" - op: LtE - right_constant: "0" + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `1 <= 0`" + commit: ~ + fixable: false location: row: 41 column: 3 @@ -107,10 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComparisonOfConstant: - left_constant: "\"hello\"" - op: Eq - right_constant: "\"\"" + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `\"hello\" == \"\"`" + commit: ~ + fixable: false location: row: 51 column: 3 @@ -120,10 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ComparisonOfConstant: - left_constant: "True" - op: Eq - right_constant: "False" + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `True == False`" + commit: ~ + fixable: false location: row: 58 column: 3 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0206_property_with_parameters.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0206_property_with_parameters.py.snap index 08dbe29f64..6571eb967d 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0206_property_with_parameters.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0206_property_with_parameters.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - PropertyWithParameters: ~ + name: PropertyWithParameters + body: Cannot have defined parameters for properties + commit: ~ + fixable: false location: row: 7 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PropertyWithParameters: ~ + name: PropertyWithParameters + body: Cannot have defined parameters for properties + commit: ~ + fixable: false location: row: 11 column: 8 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PropertyWithParameters: ~ + name: PropertyWithParameters + body: Cannot have defined parameters for properties + commit: ~ + fixable: false location: row: 15 column: 8 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0402_import_aliasing.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0402_import_aliasing.py.snap index 0567826ac6..a18ad5b133 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0402_import_aliasing.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0402_import_aliasing.py.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - ConsiderUsingFromImport: - module: os - name: path - fixable: true + name: ConsiderUsingFromImport + body: "Use `from os import path` in lieu of alias" + commit: "Replace with `from os import path`" + fixable: true location: row: 9 column: 7 @@ -23,10 +23,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - ConsiderUsingFromImport: - module: foo.bar - name: foobar - fixable: true + name: ConsiderUsingFromImport + body: "Use `from foo.bar import foobar` in lieu of alias" + commit: "Replace with `from foo.bar import foobar`" + fixable: true location: row: 11 column: 7 @@ -43,10 +43,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - ConsiderUsingFromImport: - module: foo.bar - name: foobar - fixable: false + name: ConsiderUsingFromImport + body: "Use `from foo.bar import foobar` in lieu of alias" + commit: ~ + fixable: false location: row: 12 column: 7 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0911_too_many_return_statements.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0911_too_many_return_statements.py.snap index 2628e5bdcc..f0ce57eb4e 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0911_too_many_return_statements.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0911_too_many_return_statements.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - TooManyReturnStatements: - returns: 11 - max_returns: 6 + name: TooManyReturnStatements + body: Too many return statements (11/6) + commit: ~ + fixable: false location: row: 4 column: 4 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0912_too_many_branches.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0912_too_many_branches.py.snap index c200889f85..2eca54b9b0 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0912_too_many_branches.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0912_too_many_branches.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - TooManyBranches: - branches: 13 - max_branches: 12 + name: TooManyBranches + body: Too many branches (13/12) + commit: ~ + fixable: false location: row: 6 column: 4 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0913_too_many_arguments.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0913_too_many_arguments.py.snap index 0605f098e3..9b4f32d754 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0913_too_many_arguments.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0913_too_many_arguments.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - TooManyArguments: - c_args: 8 - max_args: 5 + name: TooManyArguments + body: Too many arguments to function call (8/5) + commit: ~ + fixable: false location: row: 1 column: 4 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TooManyArguments: - c_args: 6 - max_args: 5 + name: TooManyArguments + body: Too many arguments to function call (6/5) + commit: ~ + fixable: false location: row: 17 column: 4 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TooManyArguments: - c_args: 6 - max_args: 5 + name: TooManyArguments + body: Too many arguments to function call (6/5) + commit: ~ + fixable: false location: row: 33 column: 4 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0915_too_many_statements.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0915_too_many_statements.py.snap index 9fd67c3753..c7f743dbea 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0915_too_many_statements.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0915_too_many_statements.py.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - TooManyStatements: - statements: 52 - max_statements: 50 + name: TooManyStatements + body: Too many statements (52/50) + commit: ~ + fixable: false location: row: 5 column: 10 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1701_consider_merging_isinstance.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1701_consider_merging_isinstance.py.snap index 31c008655a..da287fce37 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1701_consider_merging_isinstance.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1701_consider_merging_isinstance.py.snap @@ -1,13 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - ConsiderMergingIsinstance: - obj: "var[3]" - types: - - float - - int + name: ConsiderMergingIsinstance + body: "Merge these isinstance calls: `isinstance(var[3], (float, int))`" + commit: ~ + fixable: false location: row: 15 column: 7 @@ -17,11 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ConsiderMergingIsinstance: - obj: "var[4]" - types: - - float - - int + name: ConsiderMergingIsinstance + body: "Merge these isinstance calls: `isinstance(var[4], (float, int))`" + commit: ~ + fixable: false location: row: 17 column: 13 @@ -31,11 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ConsiderMergingIsinstance: - obj: "var[5]" - types: - - float - - int + name: ConsiderMergingIsinstance + body: "Merge these isinstance calls: `isinstance(var[5], (float, int))`" + commit: ~ + fixable: false location: row: 19 column: 13 @@ -45,11 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ConsiderMergingIsinstance: - obj: "var[10]" - types: - - list - - str + name: ConsiderMergingIsinstance + body: "Merge these isinstance calls: `isinstance(var[10], (list, str))`" + commit: ~ + fixable: false location: row: 23 column: 13 @@ -59,11 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ConsiderMergingIsinstance: - obj: "var[11]" - types: - - float - - int + name: ConsiderMergingIsinstance + body: "Merge these isinstance calls: `isinstance(var[11], (float, int))`" + commit: ~ + fixable: false location: row: 24 column: 13 @@ -73,12 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ConsiderMergingIsinstance: - obj: "var[12]" - types: - - float - - int - - list + name: ConsiderMergingIsinstance + body: "Merge these isinstance calls: `isinstance(var[12], (float, int, list))`" + commit: ~ + fixable: false location: row: 30 column: 13 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_0.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_0.py.snap index 9a95bde461..e9f24a212b 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_0.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_0.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - ConsiderUsingSysExit: - name: exit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + commit: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 1 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ConsiderUsingSysExit: - name: quit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + commit: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 2 column: 0 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ConsiderUsingSysExit: - name: exit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + commit: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 6 column: 4 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ConsiderUsingSysExit: - name: quit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + commit: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 7 column: 4 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_1.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_1.py.snap index e570d45308..7f77ad7d59 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_1.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_1.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - ConsiderUsingSysExit: - name: exit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + commit: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 3 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - ConsiderUsingSysExit: - name: quit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + commit: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 4 column: 0 @@ -39,8 +43,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - ConsiderUsingSysExit: - name: exit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + commit: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 8 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - ConsiderUsingSysExit: - name: quit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + commit: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 9 column: 4 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_2.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_2.py.snap index 5bd8c3d04b..6804a8263b 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_2.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_2.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - ConsiderUsingSysExit: - name: exit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + commit: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 3 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - ConsiderUsingSysExit: - name: quit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + commit: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 4 column: 0 @@ -39,8 +43,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - ConsiderUsingSysExit: - name: exit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + commit: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 8 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - ConsiderUsingSysExit: - name: quit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + commit: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 9 column: 4 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_3.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_3.py.snap index e6a1d56c4c..f540aa4ca2 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_3.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_3.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - ConsiderUsingSysExit: - name: quit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + commit: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 4 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - ConsiderUsingSysExit: - name: quit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + commit: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 9 column: 4 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_4.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_4.py.snap index e76192b62f..9767238a47 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_4.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_4.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - ConsiderUsingSysExit: - name: exit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + commit: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 3 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - ConsiderUsingSysExit: - name: quit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + commit: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 4 column: 0 @@ -39,8 +43,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - ConsiderUsingSysExit: - name: exit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + commit: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 8 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - ConsiderUsingSysExit: - name: quit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + commit: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 9 column: 4 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_5.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_5.py.snap index e6a1d56c4c..f540aa4ca2 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_5.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_5.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - ConsiderUsingSysExit: - name: quit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + commit: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 4 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - ConsiderUsingSysExit: - name: quit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + commit: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 9 column: 4 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_6.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_6.py.snap index 7e2da5e715..ea6dc39fad 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_6.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_6.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - ConsiderUsingSysExit: - name: exit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + commit: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 1 column: 0 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ConsiderUsingSysExit: - name: quit + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + commit: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 2 column: 0 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR2004_magic_value_comparison.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR2004_magic_value_comparison.py.snap index 544da52f34..ea8e6f0acf 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR2004_magic_value_comparison.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR2004_magic_value_comparison.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - MagicValueComparison: - value: "10" + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing 10 with a constant variable" + commit: ~ + fixable: false location: row: 5 column: 3 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MagicValueComparison: - value: "2" + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing 2 with a constant variable" + commit: ~ + fixable: false location: row: 38 column: 11 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MagicValueComparison: - value: "-2" + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing -2 with a constant variable" + commit: ~ + fixable: false location: row: 41 column: 11 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MagicValueComparison: - value: "+2" + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing +2 with a constant variable" + commit: ~ + fixable: false location: row: 44 column: 11 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MagicValueComparison: - value: "3.141592653589793" + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing 3.141592653589793 with a constant variable" + commit: ~ + fixable: false location: row: 65 column: 20 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR5501_collapsible_else_if.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR5501_collapsible_else_if.py.snap index 7011e03963..55f8cae990 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR5501_collapsible_else_if.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR5501_collapsible_else_if.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - CollapsibleElseIf: ~ + name: CollapsibleElseIf + body: "Consider using `elif` instead of `else` then `if` to remove one indentation level" + commit: ~ + fixable: false location: row: 38 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - CollapsibleElseIf: ~ + name: CollapsibleElseIf + body: "Consider using `elif` instead of `else` then `if` to remove one indentation level" + commit: ~ + fixable: false location: row: 46 column: 8 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0120_useless_else_on_loop.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0120_useless_else_on_loop.py.snap index 873ddb0643..8ae5e19a21 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0120_useless_else_on_loop.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0120_useless_else_on_loop.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - UselessElseOnLoop: ~ + name: UselessElseOnLoop + body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" + commit: ~ + fixable: false location: row: 9 column: 4 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessElseOnLoop: ~ + name: UselessElseOnLoop + body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" + commit: ~ + fixable: false location: row: 18 column: 4 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessElseOnLoop: ~ + name: UselessElseOnLoop + body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" + commit: ~ + fixable: false location: row: 30 column: 0 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessElseOnLoop: ~ + name: UselessElseOnLoop + body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" + commit: ~ + fixable: false location: row: 37 column: 0 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessElseOnLoop: ~ + name: UselessElseOnLoop + body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" + commit: ~ + fixable: false location: row: 42 column: 0 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessElseOnLoop: ~ + name: UselessElseOnLoop + body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" + commit: ~ + fixable: false location: row: 88 column: 4 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UselessElseOnLoop: ~ + name: UselessElseOnLoop + body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" + commit: ~ + fixable: false location: row: 98 column: 8 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap index 3cd2563cad..995d894894 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap @@ -1,10 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - GlobalVariableNotAssigned: - name: X + name: GlobalVariableNotAssigned + body: "Using global for `X` but no assignment is done" + commit: ~ + fixable: false location: row: 5 column: 11 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - GlobalVariableNotAssigned: - name: X + name: GlobalVariableNotAssigned + body: "Using global for `X` but no assignment is done" + commit: ~ + fixable: false location: row: 9 column: 11 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0603_global_statement.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0603_global_statement.py.snap index 1a630a7843..99eb7380d8 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0603_global_statement.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0603_global_statement.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - GlobalStatement: - name: CONSTANT + name: GlobalStatement + body: "Using the global statement to update `CONSTANT` is discouraged" + commit: ~ + fixable: false location: row: 17 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - GlobalStatement: - name: sys + name: GlobalStatement + body: "Using the global statement to update `sys` is discouraged" + commit: ~ + fixable: false location: row: 24 column: 4 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - GlobalStatement: - name: namedtuple + name: GlobalStatement + body: "Using the global statement to update `namedtuple` is discouraged" + commit: ~ + fixable: false location: row: 30 column: 4 @@ -36,8 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - GlobalStatement: - name: CONSTANT + name: GlobalStatement + body: "Using the global statement to update `CONSTANT` is discouraged" + commit: ~ + fixable: false location: row: 36 column: 4 @@ -47,8 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - GlobalStatement: - name: CONSTANT + name: GlobalStatement + body: "Using the global statement to update `CONSTANT` is discouraged" + commit: ~ + fixable: false location: row: 43 column: 4 @@ -58,8 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - GlobalStatement: - name: CONSTANT + name: GlobalStatement + body: "Using the global statement to update `CONSTANT` is discouraged" + commit: ~ + fixable: false location: row: 50 column: 4 @@ -69,8 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - GlobalStatement: - name: FUNC + name: GlobalStatement + body: "Using the global statement to update `FUNC` is discouraged" + commit: ~ + fixable: false location: row: 60 column: 4 @@ -80,8 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - GlobalStatement: - name: CLASS + name: GlobalStatement + body: "Using the global statement to update `CLASS` is discouraged" + commit: ~ + fixable: false location: row: 70 column: 4 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap index b3423f8c79..417d472e99 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - RedefinedLoopName: - name: i - outer_kind: For - inner_kind: For + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + commit: ~ + fixable: false location: row: 3 column: 8 @@ -16,10 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: With - inner_kind: For + name: RedefinedLoopName + body: "`with` statement variable `i` overwritten by `for` loop target" + commit: ~ + fixable: false location: row: 8 column: 8 @@ -29,10 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: For - inner_kind: With + name: RedefinedLoopName + body: "`for` loop variable `i` overwritten by `with` statement target" + commit: ~ + fixable: false location: row: 13 column: 17 @@ -42,10 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: With - inner_kind: With + name: RedefinedLoopName + body: "Outer `with` statement variable `i` overwritten by inner `with` statement target" + commit: ~ + fixable: false location: row: 18 column: 17 @@ -55,10 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: For - inner_kind: For + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + commit: ~ + fixable: false location: row: 34 column: 12 @@ -68,10 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: For - inner_kind: For + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + commit: ~ + fixable: false location: row: 40 column: 12 @@ -81,10 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: j - outer_kind: For - inner_kind: For + name: RedefinedLoopName + body: "Outer `for` loop variable `j` overwritten by inner `for` loop target" + commit: ~ + fixable: false location: row: 41 column: 16 @@ -94,10 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: For - inner_kind: Assignment + name: RedefinedLoopName + body: "`for` loop variable `i` overwritten by assignment target" + commit: ~ + fixable: false location: row: 46 column: 4 @@ -107,10 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: For - inner_kind: Assignment + name: RedefinedLoopName + body: "`for` loop variable `i` overwritten by assignment target" + commit: ~ + fixable: false location: row: 50 column: 4 @@ -120,10 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: For - inner_kind: Assignment + name: RedefinedLoopName + body: "`for` loop variable `i` overwritten by assignment target" + commit: ~ + fixable: false location: row: 54 column: 4 @@ -133,10 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: For - inner_kind: For + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + commit: ~ + fixable: false location: row: 58 column: 8 @@ -146,10 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: For - inner_kind: For + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + commit: ~ + fixable: false location: row: 63 column: 14 @@ -159,10 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: For - inner_kind: For + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + commit: ~ + fixable: false location: row: 68 column: 8 @@ -172,10 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: For - inner_kind: For + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + commit: ~ + fixable: false location: row: 73 column: 8 @@ -185,10 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: For - inner_kind: For + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + commit: ~ + fixable: false location: row: 78 column: 8 @@ -198,10 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: j - outer_kind: For - inner_kind: For + name: RedefinedLoopName + body: "Outer `for` loop variable `j` overwritten by inner `for` loop target" + commit: ~ + fixable: false location: row: 78 column: 11 @@ -211,10 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: j - outer_kind: For - inner_kind: For + name: RedefinedLoopName + body: "Outer `for` loop variable `j` overwritten by inner `for` loop target" + commit: ~ + fixable: false location: row: 95 column: 8 @@ -224,10 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: For - inner_kind: Assignment + name: RedefinedLoopName + body: "`for` loop variable `i` overwritten by assignment target" + commit: ~ + fixable: false location: row: 112 column: 12 @@ -237,10 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: i - outer_kind: For - inner_kind: For + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + commit: ~ + fixable: false location: row: 118 column: 16 @@ -250,10 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: "a[0]" - outer_kind: For - inner_kind: Assignment + name: RedefinedLoopName + body: "`for` loop variable `a[0]` overwritten by assignment target" + commit: ~ + fixable: false location: row: 133 column: 4 @@ -263,10 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: "a['i']" - outer_kind: For - inner_kind: Assignment + name: RedefinedLoopName + body: "`for` loop variable `a['i']` overwritten by assignment target" + commit: ~ + fixable: false location: row: 138 column: 4 @@ -276,10 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: a.i - outer_kind: For - inner_kind: Assignment + name: RedefinedLoopName + body: "`for` loop variable `a.i` overwritten by assignment target" + commit: ~ + fixable: false location: row: 143 column: 4 @@ -289,10 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: a.i.j - outer_kind: For - inner_kind: Assignment + name: RedefinedLoopName + body: "`for` loop variable `a.i.j` overwritten by assignment target" + commit: ~ + fixable: false location: row: 148 column: 4 @@ -302,10 +302,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: a.i - outer_kind: For - inner_kind: Assignment + name: RedefinedLoopName + body: "`for` loop variable `a.i` overwritten by assignment target" + commit: ~ + fixable: false location: row: 153 column: 4 @@ -315,10 +315,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RedefinedLoopName: - name: a.i - outer_kind: For - inner_kind: Assignment + name: RedefinedLoopName + body: "`for` loop variable `a.i` overwritten by assignment target" + commit: ~ + fixable: false location: row: 155 column: 4 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__allow_magic_value_types.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__allow_magic_value_types.snap index c29d17304c..cdc2b2e921 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__allow_magic_value_types.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__allow_magic_value_types.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - MagicValueComparison: - value: "\"Hunter2\"" + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing \"Hunter2\" with a constant variable" + commit: ~ + fixable: false location: row: 59 column: 21 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MagicValueComparison: - value: "3.141592653589793" + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing 3.141592653589793 with a constant variable" + commit: ~ + fixable: false location: row: 65 column: 20 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - MagicValueComparison: - value: "b\"something\"" + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing b\"something\" with a constant variable" + commit: ~ + fixable: false location: row: 74 column: 17 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args.snap index e679f5ce35..56f237a4d4 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - TooManyArguments: - c_args: 6 - max_args: 4 + name: TooManyArguments + body: Too many arguments to function call (6/4) + commit: ~ + fixable: false location: row: 3 column: 4 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TooManyArguments: - c_args: 6 - max_args: 4 + name: TooManyArguments + body: Too many arguments to function call (6/4) + commit: ~ + fixable: false location: row: 9 column: 4 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args_with_dummy_variables.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args_with_dummy_variables.snap index 69474d8791..32ab910faf 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args_with_dummy_variables.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args_with_dummy_variables.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - TooManyArguments: - c_args: 6 - max_args: 5 + name: TooManyArguments + body: Too many arguments to function call (6/5) + commit: ~ + fixable: false location: row: 9 column: 4 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_branches.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_branches.snap index 4167e6ffa8..0816a58db5 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_branches.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_branches.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - TooManyBranches: - branches: 2 - max_branches: 1 + name: TooManyBranches + body: Too many branches (2/1) + commit: ~ + fixable: false location: row: 6 column: 4 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TooManyBranches: - branches: 2 - max_branches: 1 + name: TooManyBranches + body: Too many branches (2/1) + commit: ~ + fixable: false location: row: 15 column: 8 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_return_statements.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_return_statements.snap index 0619b609b0..7c632aebc7 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_return_statements.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_return_statements.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - TooManyReturnStatements: - returns: 2 - max_returns: 1 + name: TooManyReturnStatements + body: Too many return statements (2/1) + commit: ~ + fixable: false location: row: 1 column: 4 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_statements.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_statements.snap index f0dd60d2e7..4f5543d2cd 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_statements.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_statements.snap @@ -1,11 +1,12 @@ --- -source: src/rules/pylint/mod.rs +source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- - kind: - TooManyStatements: - statements: 2 - max_statements: 1 + name: TooManyStatements + body: Too many statements (2/1) + commit: ~ + fixable: false location: row: 2 column: 4 @@ -15,9 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TooManyStatements: - statements: 3 - max_statements: 1 + name: TooManyStatements + body: Too many statements (3/1) + commit: ~ + fixable: false location: row: 6 column: 4 @@ -27,9 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - TooManyStatements: - statements: 2 - max_statements: 1 + name: TooManyStatements + body: Too many statements (2/1) + commit: ~ + fixable: false location: row: 7 column: 8 diff --git a/crates/ruff/src/rules/pyupgrade/rules/convert_named_tuple_functional_to_class.rs b/crates/ruff/src/rules/pyupgrade/rules/convert_named_tuple_functional_to_class.rs index fff5e6a425..ffec5de293 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/convert_named_tuple_functional_to_class.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/convert_named_tuple_functional_to_class.rs @@ -11,7 +11,7 @@ use ruff_python_stdlib::keyword::KWLIST; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{Availability, Violation}; use crate::AutofixKind; diff --git a/crates/ruff/src/rules/pyupgrade/rules/convert_typed_dict_functional_to_class.rs b/crates/ruff/src/rules/pyupgrade/rules/convert_typed_dict_functional_to_class.rs index ae5457bb09..81724df5d0 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/convert_typed_dict_functional_to_class.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/convert_typed_dict_functional_to_class.rs @@ -11,7 +11,7 @@ use ruff_python_stdlib::keyword::KWLIST; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{Availability, Violation}; use crate::AutofixKind; diff --git a/crates/ruff/src/rules/pyupgrade/rules/datetime_utc_alias.rs b/crates/ruff/src/rules/pyupgrade/rules/datetime_utc_alias.rs index cb80bdb673..98889f95d4 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/datetime_utc_alias.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/datetime_utc_alias.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{AutofixKind, Availability, Violation}; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/deprecated_unittest_alias.rs b/crates/ruff/src/rules/pyupgrade/rules/deprecated_unittest_alias.rs index d6dd539003..6b992c0aa7 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/deprecated_unittest_alias.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/deprecated_unittest_alias.rs @@ -7,7 +7,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/f_strings.rs b/crates/ruff/src/rules/pyupgrade/rules/f_strings.rs index dbe7099ea1..0ea7f6d121 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/f_strings.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/f_strings.rs @@ -11,7 +11,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::pyflakes::format::FormatSummary; use crate::rules::pyupgrade::helpers::curly_escape; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/pyupgrade/rules/format_literals.rs b/crates/ruff/src/rules/pyupgrade/rules/format_literals.rs index f2550e4a31..0fda8a52f5 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/format_literals.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/format_literals.rs @@ -11,7 +11,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::cst::matchers::{match_call, match_expression}; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::pyflakes::format::FormatSummary; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/pyupgrade/rules/functools_cache.rs b/crates/ruff/src/rules/pyupgrade/rules/functools_cache.rs index 34f7e37f47..b4a37b8383 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/functools_cache.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/functools_cache.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/lru_cache_without_parameters.rs b/crates/ruff/src/rules/pyupgrade/rules/lru_cache_without_parameters.rs index 5adeb36e68..3fe6023847 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/lru_cache_without_parameters.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/lru_cache_without_parameters.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/native_literals.rs b/crates/ruff/src/rules/pyupgrade/rules/native_literals.rs index eadf79d4c0..0c0dd502b9 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/native_literals.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/native_literals.rs @@ -9,7 +9,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] diff --git a/crates/ruff/src/rules/pyupgrade/rules/open_alias.rs b/crates/ruff/src/rules/pyupgrade/rules/open_alias.rs index 4f1eaeac7b..749467160f 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/open_alias.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/open_alias.rs @@ -5,7 +5,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/os_error_alias.rs b/crates/ruff/src/rules/pyupgrade/rules/os_error_alias.rs index d229fcc9e0..82b8c1902d 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/os_error_alias.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/os_error_alias.rs @@ -7,7 +7,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/outdated_version_block.rs b/crates/ruff/src/rules/pyupgrade/rules/outdated_version_block.rs index 04d1f00f1e..662605dda4 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/outdated_version_block.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/outdated_version_block.rs @@ -13,7 +13,7 @@ use ruff_python_ast::whitespace::indentation; use crate::autofix::helpers::delete_stmt; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::pyupgrade::fixes::adjust_indentation; use crate::settings::types::PythonVersion; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/pyupgrade/rules/printf_string_formatting.rs b/crates/ruff/src/rules/pyupgrade/rules/printf_string_formatting.rs index d83a8f5683..23d0615a05 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/printf_string_formatting.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/printf_string_formatting.rs @@ -15,7 +15,7 @@ use ruff_python_stdlib::keyword::KWLIST; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::pyupgrade::helpers::curly_escape; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/pyupgrade/rules/replace_stdout_stderr.rs b/crates/ruff/src/rules/pyupgrade/rules/replace_stdout_stderr.rs index 45d65ba29b..dcd33d1bdd 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/replace_stdout_stderr.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/replace_stdout_stderr.rs @@ -8,7 +8,7 @@ use ruff_python_ast::whitespace::indentation; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/replace_universal_newlines.rs b/crates/ruff/src/rules/pyupgrade/rules/replace_universal_newlines.rs index 3441f99e5f..e97479c232 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/replace_universal_newlines.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/replace_universal_newlines.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/rewrite_c_element_tree.rs b/crates/ruff/src/rules/pyupgrade/rules/rewrite_c_element_tree.rs index d27a6b3441..63b1eba94a 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/rewrite_c_element_tree.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/rewrite_c_element_tree.rs @@ -5,7 +5,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/rewrite_mock_import.rs b/crates/ruff/src/rules/pyupgrade/rules/rewrite_mock_import.rs index 464ba8ec89..fca2245046 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/rewrite_mock_import.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/rewrite_mock_import.rs @@ -16,7 +16,7 @@ use ruff_python_ast::whitespace::indentation; use crate::checkers::ast::Checker; use crate::cst::matchers::{match_import, match_import_from, match_module}; use crate::fix::Fix; -use crate::registry::{Diagnostic, Rule}; +use crate::registry::{AsRule, Diagnostic, Rule}; use crate::violation::AlwaysAutofixableViolation; #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] diff --git a/crates/ruff/src/rules/pyupgrade/rules/rewrite_unicode_literal.rs b/crates/ruff/src/rules/pyupgrade/rules/rewrite_unicode_literal.rs index 320c9a4757..4ec7cbeb39 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/rewrite_unicode_literal.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/rewrite_unicode_literal.rs @@ -5,7 +5,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/rewrite_yield_from.rs b/crates/ruff/src/rules/pyupgrade/rules/rewrite_yield_from.rs index 93f056e698..bb1ac1b497 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/rewrite_yield_from.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/rewrite_yield_from.rs @@ -8,7 +8,7 @@ use ruff_python_ast::visitor::Visitor; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/super_call_with_parameters.rs b/crates/ruff/src/rules/pyupgrade/rules/super_call_with_parameters.rs index 0072d3df2b..043520fd96 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/super_call_with_parameters.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/super_call_with_parameters.rs @@ -4,7 +4,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::{Range, ScopeKind}; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::rules::pyupgrade::fixes; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/pyupgrade/rules/type_of_primitive.rs b/crates/ruff/src/rules/pyupgrade/rules/type_of_primitive.rs index 697ddf4377..ffa9e1cf6a 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/type_of_primitive.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/type_of_primitive.rs @@ -5,7 +5,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; use super::super::types::Primitive; diff --git a/crates/ruff/src/rules/pyupgrade/rules/typing_text_str_alias.rs b/crates/ruff/src/rules/pyupgrade/rules/typing_text_str_alias.rs index 703e426d77..8ee075d354 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/typing_text_str_alias.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/typing_text_str_alias.rs @@ -5,7 +5,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/unnecessary_builtin_import.rs b/crates/ruff/src/rules/pyupgrade/rules/unnecessary_builtin_import.rs index 92f5444458..6e96bf8acb 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/unnecessary_builtin_import.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/unnecessary_builtin_import.rs @@ -7,7 +7,7 @@ use ruff_python_ast::types::Range; use crate::autofix; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/unnecessary_future_import.rs b/crates/ruff/src/rules/pyupgrade/rules/unnecessary_future_import.rs index 27b5c28cbe..fb76e25f7f 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/unnecessary_future_import.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/unnecessary_future_import.rs @@ -7,7 +7,7 @@ use ruff_python_ast::types::Range; use crate::autofix; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/unpack_list_comprehension.rs b/crates/ruff/src/rules/pyupgrade/rules/unpack_list_comprehension.rs index da73258a51..cffb72ba56 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/unpack_list_comprehension.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/unpack_list_comprehension.rs @@ -5,7 +5,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/use_pep585_annotation.rs b/crates/ruff/src/rules/pyupgrade/rules/use_pep585_annotation.rs index 507fcfd718..638e0f1c11 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/use_pep585_annotation.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/use_pep585_annotation.rs @@ -5,7 +5,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; // TODO: document referencing [PEP 585]: https://peps.python.org/pep-0585/ diff --git a/crates/ruff/src/rules/pyupgrade/rules/use_pep604_annotation.rs b/crates/ruff/src/rules/pyupgrade/rules/use_pep604_annotation.rs index 307d2d16dc..e475b90002 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/use_pep604_annotation.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/use_pep604_annotation.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; // TODO: document referencing [PEP 604]: https://peps.python.org/pep-0604/ diff --git a/crates/ruff/src/rules/pyupgrade/rules/use_pep604_isinstance.rs b/crates/ruff/src/rules/pyupgrade/rules/use_pep604_isinstance.rs index 3d4753326f..d888b64342 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/use_pep604_isinstance.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/use_pep604_isinstance.rs @@ -9,7 +9,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] diff --git a/crates/ruff/src/rules/pyupgrade/rules/useless_metaclass_type.rs b/crates/ruff/src/rules/pyupgrade/rules/useless_metaclass_type.rs index caa0f77ca6..15135b3530 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/useless_metaclass_type.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/useless_metaclass_type.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::autofix::helpers; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; #[violation] diff --git a/crates/ruff/src/rules/pyupgrade/rules/useless_object_inheritance.rs b/crates/ruff/src/rules/pyupgrade/rules/useless_object_inheritance.rs index 6e1ac650ba..05f52cb81a 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/useless_object_inheritance.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/useless_object_inheritance.rs @@ -4,7 +4,7 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::types::{Binding, BindingKind, Range, Scope}; use crate::checkers::ast::Checker; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::AlwaysAutofixableViolation; use super::super::fixes; diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP001.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP001.py.snap index 1fa73a2e95..1b476f0dd6 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP001.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP001.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - UselessMetaclassType: ~ + name: UselessMetaclassType + body: "`__metaclass__ = type` is implied" + commit: "Remove `__metaclass__ = type`" + fixable: true location: row: 2 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - UselessMetaclassType: ~ + name: UselessMetaclassType + body: "`__metaclass__ = type` is implied" + commit: "Remove `__metaclass__ = type`" + fixable: true location: row: 6 column: 4 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP003.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP003.py.snap index 5a96de6e06..8bde8dd3e0 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP003.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP003.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - TypeOfPrimitive: - primitive: Str + name: TypeOfPrimitive + body: "Use `str` instead of `type(...)`" + commit: "Replace `type(...)` with `str`" + fixable: true location: row: 1 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - TypeOfPrimitive: - primitive: Bytes + name: TypeOfPrimitive + body: "Use `bytes` instead of `type(...)`" + commit: "Replace `type(...)` with `bytes`" + fixable: true location: row: 2 column: 0 @@ -39,8 +43,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - TypeOfPrimitive: - primitive: Int + name: TypeOfPrimitive + body: "Use `int` instead of `type(...)`" + commit: "Replace `type(...)` with `int`" + fixable: true location: row: 3 column: 0 @@ -57,8 +63,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - TypeOfPrimitive: - primitive: Float + name: TypeOfPrimitive + body: "Use `float` instead of `type(...)`" + commit: "Replace `type(...)` with `float`" + fixable: true location: row: 4 column: 0 @@ -75,8 +83,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - TypeOfPrimitive: - primitive: Complex + name: TypeOfPrimitive + body: "Use `complex` instead of `type(...)`" + commit: "Replace `type(...)` with `complex`" + fixable: true location: row: 5 column: 0 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP004.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP004.py.snap index a95cd5f0a7..a1fcb7040a 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP004.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP004.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - UselessObjectInheritance: - name: A + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 5 column: 8 @@ -21,8 +23,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - UselessObjectInheritance: - name: A + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 10 column: 4 @@ -39,8 +43,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UselessObjectInheritance: - name: A + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 16 column: 4 @@ -57,8 +63,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UselessObjectInheritance: - name: A + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 24 column: 4 @@ -75,8 +83,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UselessObjectInheritance: - name: A + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 31 column: 4 @@ -93,8 +103,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UselessObjectInheritance: - name: A + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 37 column: 4 @@ -111,8 +123,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UselessObjectInheritance: - name: A + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 45 column: 4 @@ -129,8 +143,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UselessObjectInheritance: - name: A + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 53 column: 4 @@ -147,8 +163,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UselessObjectInheritance: - name: A + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 61 column: 4 @@ -165,8 +183,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UselessObjectInheritance: - name: A + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 69 column: 4 @@ -183,8 +203,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UselessObjectInheritance: - name: B + name: UselessObjectInheritance + body: "Class `B` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 75 column: 11 @@ -201,8 +223,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - UselessObjectInheritance: - name: B + name: UselessObjectInheritance + body: "Class `B` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 79 column: 8 @@ -219,8 +243,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - UselessObjectInheritance: - name: B + name: UselessObjectInheritance + body: "Class `B` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 84 column: 4 @@ -237,8 +263,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - UselessObjectInheritance: - name: B + name: UselessObjectInheritance + body: "Class `B` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 92 column: 4 @@ -255,8 +283,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - UselessObjectInheritance: - name: B + name: UselessObjectInheritance + body: "Class `B` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 98 column: 4 @@ -273,8 +303,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - UselessObjectInheritance: - name: B + name: UselessObjectInheritance + body: "Class `B` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 108 column: 4 @@ -291,8 +323,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - UselessObjectInheritance: - name: A + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 114 column: 12 @@ -309,8 +343,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - UselessObjectInheritance: - name: A + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 119 column: 4 @@ -327,8 +363,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UselessObjectInheritance: - name: A + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 125 column: 4 @@ -345,8 +383,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UselessObjectInheritance: - name: A + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + commit: "Remove `object` inheritance" + fixable: true location: row: 131 column: 4 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP005.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP005.py.snap index 07544cf0f8..b448f474ac 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP005.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP005.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - DeprecatedUnittestAlias: - alias: assertEquals - target: assertEqual + name: DeprecatedUnittestAlias + body: "`assertEquals` is deprecated, use `assertEqual`" + commit: "Replace `assertEqual` with `assertEquals`" + fixable: true location: row: 6 column: 8 @@ -22,9 +23,10 @@ expression: diagnostics column: 25 parent: ~ - kind: - DeprecatedUnittestAlias: - alias: assertEquals - target: assertEqual + name: DeprecatedUnittestAlias + body: "`assertEquals` is deprecated, use `assertEqual`" + commit: "Replace `assertEqual` with `assertEquals`" + fixable: true location: row: 7 column: 8 @@ -41,9 +43,10 @@ expression: diagnostics column: 25 parent: ~ - kind: - DeprecatedUnittestAlias: - alias: failUnlessAlmostEqual - target: assertAlmostEqual + name: DeprecatedUnittestAlias + body: "`failUnlessAlmostEqual` is deprecated, use `assertAlmostEqual`" + commit: "Replace `assertAlmostEqual` with `failUnlessAlmostEqual`" + fixable: true location: row: 9 column: 8 @@ -60,9 +63,10 @@ expression: diagnostics column: 34 parent: ~ - kind: - DeprecatedUnittestAlias: - alias: assertNotRegexpMatches - target: assertNotRegex + name: DeprecatedUnittestAlias + body: "`assertNotRegexpMatches` is deprecated, use `assertNotRegex`" + commit: "Replace `assertNotRegex` with `assertNotRegexpMatches`" + fixable: true location: row: 10 column: 8 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP006.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP006.py.snap index 7ea2bf8ceb..a18fc068d3 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP006.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP006.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - DeprecatedCollectionType: - name: List + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + commit: "Replace `List` with `list`" + fixable: true location: row: 4 column: 9 @@ -21,8 +23,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - DeprecatedCollectionType: - name: List + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + commit: "Replace `List` with `list`" + fixable: true location: row: 11 column: 9 @@ -39,8 +43,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - DeprecatedCollectionType: - name: List + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + commit: "Replace `List` with `list`" + fixable: true location: row: 18 column: 9 @@ -57,8 +63,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - DeprecatedCollectionType: - name: List + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + commit: "Replace `List` with `list`" + fixable: true location: row: 25 column: 9 @@ -75,8 +83,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - DeprecatedCollectionType: - name: List + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + commit: "Replace `List` with `list`" + fixable: true location: row: 36 column: 9 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP007.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP007.py.snap index 8583dc3057..c136617e2f 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP007.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP007.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - TypingUnion: ~ + name: TypingUnion + body: "Use `X | Y` for type annotations" + commit: "Convert to `X | Y`" + fixable: true location: row: 6 column: 9 @@ -20,7 +23,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - TypingUnion: ~ + name: TypingUnion + body: "Use `X | Y` for type annotations" + commit: "Convert to `X | Y`" + fixable: true location: row: 10 column: 9 @@ -37,7 +43,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - TypingUnion: ~ + name: TypingUnion + body: "Use `X | Y` for type annotations" + commit: "Convert to `X | Y`" + fixable: true location: row: 14 column: 9 @@ -54,7 +63,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - TypingUnion: ~ + name: TypingUnion + body: "Use `X | Y` for type annotations" + commit: "Convert to `X | Y`" + fixable: true location: row: 14 column: 25 @@ -71,7 +83,10 @@ expression: diagnostics column: 44 parent: ~ - kind: - TypingUnion: ~ + name: TypingUnion + body: "Use `X | Y` for type annotations" + commit: "Convert to `X | Y`" + fixable: true location: row: 18 column: 9 @@ -88,7 +103,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - TypingUnion: ~ + name: TypingUnion + body: "Use `X | Y` for type annotations" + commit: "Convert to `X | Y`" + fixable: true location: row: 22 column: 9 @@ -105,7 +123,10 @@ expression: diagnostics column: 33 parent: ~ - kind: - TypingUnion: ~ + name: TypingUnion + body: "Use `X | Y` for type annotations" + commit: "Convert to `X | Y`" + fixable: true location: row: 26 column: 9 @@ -122,7 +143,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - TypingUnion: ~ + name: TypingUnion + body: "Use `X | Y` for type annotations" + commit: "Convert to `X | Y`" + fixable: true location: row: 47 column: 7 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP008.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP008.py.snap index cd4742f710..2228fb0fd2 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP008.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP008.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - SuperCallWithParameters: ~ + name: SuperCallWithParameters + body: "Use `super()` instead of `super(__class__, self)`" + commit: "Remove `__super__` parameters" + fixable: true location: row: 17 column: 17 @@ -20,7 +23,10 @@ expression: diagnostics column: 35 parent: ~ - kind: - SuperCallWithParameters: ~ + name: SuperCallWithParameters + body: "Use `super()` instead of `super(__class__, self)`" + commit: "Remove `__super__` parameters" + fixable: true location: row: 18 column: 8 @@ -37,7 +43,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - SuperCallWithParameters: ~ + name: SuperCallWithParameters + body: "Use `super()` instead of `super(__class__, self)`" + commit: "Remove `__super__` parameters" + fixable: true location: row: 19 column: 8 @@ -54,7 +63,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - SuperCallWithParameters: ~ + name: SuperCallWithParameters + body: "Use `super()` instead of `super(__class__, self)`" + commit: "Remove `__super__` parameters" + fixable: true location: row: 36 column: 8 @@ -71,7 +83,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - SuperCallWithParameters: ~ + name: SuperCallWithParameters + body: "Use `super()` instead of `super(__class__, self)`" + commit: "Remove `__super__` parameters" + fixable: true location: row: 50 column: 12 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_0.py.snap index 1cc2ec239c..3e7aee7b5c 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_0.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - UTF8EncodingDeclaration: ~ + name: UTF8EncodingDeclaration + body: UTF-8 encoding declaration is unnecessary + commit: Remove unnecessary coding comment + fixable: true location: row: 1 column: 0 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_1.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_1.py.snap index 417a288723..e8a69d34ea 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_1.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_1.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - UTF8EncodingDeclaration: ~ + name: UTF8EncodingDeclaration + body: UTF-8 encoding declaration is unnecessary + commit: Remove unnecessary coding comment + fixable: true location: row: 2 column: 0 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP010.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP010.py.snap index 5fb1427cc8..c294dd095a 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP010.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP010.py.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - UnnecessaryFutureImport: - names: - - generators - - nested_scopes + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` imports `generators`, `nested_scopes` for target Python version" + commit: "Remove unnecessary `__future__` import" + fixable: true location: row: 1 column: 0 @@ -23,10 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryFutureImport: - names: - - unicode_literals - - with_statement + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` imports `unicode_literals`, `with_statement` for target Python version" + commit: "Remove unnecessary `__future__` import" + fixable: true location: row: 2 column: 0 @@ -43,10 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryFutureImport: - names: - - absolute_import - - division + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` imports `absolute_import`, `division` for target Python version" + commit: "Remove unnecessary `__future__` import" + fixable: true location: row: 3 column: 0 @@ -63,9 +63,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryFutureImport: - names: - - generator_stop + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` import `generator_stop` for target Python version" + commit: "Remove unnecessary `__future__` import" + fixable: true location: row: 4 column: 0 @@ -82,10 +83,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryFutureImport: - names: - - generator_stop - - print_function + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` imports `generator_stop`, `print_function` for target Python version" + commit: "Remove unnecessary `__future__` import" + fixable: true location: row: 5 column: 0 @@ -102,9 +103,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryFutureImport: - names: - - generators + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` import `generators` for target Python version" + commit: "Remove unnecessary `__future__` import" + fixable: true location: row: 6 column: 0 @@ -121,9 +123,10 @@ expression: diagnostics column: 49 parent: ~ - kind: - UnnecessaryFutureImport: - names: - - generator_stop + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` import `generator_stop` for target Python version" + commit: "Remove unnecessary `__future__` import" + fixable: true location: row: 9 column: 4 @@ -140,9 +143,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryFutureImport: - names: - - generators + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` import `generators` for target Python version" + commit: "Remove unnecessary `__future__` import" + fixable: true location: row: 10 column: 4 @@ -159,9 +163,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - UnnecessaryFutureImport: - names: - - generator_stop + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` import `generator_stop` for target Python version" + commit: "Remove unnecessary `__future__` import" + fixable: true location: row: 13 column: 4 @@ -178,9 +183,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryFutureImport: - names: - - generators + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` import `generators` for target Python version" + commit: "Remove unnecessary `__future__` import" + fixable: true location: row: 14 column: 4 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP011.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP011.py.snap index 9985d60ebc..8cd61f5d72 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP011.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP011.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - LRUCacheWithoutParameters: ~ + name: LRUCacheWithoutParameters + body: "Unnecessary parameters to `functools.lru_cache`" + commit: Remove unnecessary parameters + fixable: true location: row: 5 column: 20 @@ -20,7 +23,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - LRUCacheWithoutParameters: ~ + name: LRUCacheWithoutParameters + body: "Unnecessary parameters to `functools.lru_cache`" + commit: Remove unnecessary parameters + fixable: true location: row: 10 column: 10 @@ -37,7 +43,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - LRUCacheWithoutParameters: ~ + name: LRUCacheWithoutParameters + body: "Unnecessary parameters to `functools.lru_cache`" + commit: Remove unnecessary parameters + fixable: true location: row: 16 column: 20 @@ -54,7 +63,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - LRUCacheWithoutParameters: ~ + name: LRUCacheWithoutParameters + body: "Unnecessary parameters to `functools.lru_cache`" + commit: Remove unnecessary parameters + fixable: true location: row: 21 column: 20 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP012.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP012.py.snap index b90f8536b5..e80529cfaa 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP012.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP012.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 2 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 3 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 4 column: 0 @@ -54,7 +63,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 5 column: 0 @@ -71,7 +83,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 6 column: 0 @@ -88,7 +103,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 7 column: 0 @@ -105,7 +123,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 8 column: 0 @@ -122,7 +143,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 16 column: 4 @@ -139,7 +163,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 20 column: 4 @@ -156,7 +183,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 24 column: 4 @@ -173,7 +203,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 32 column: 0 @@ -190,7 +223,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 50 column: 0 @@ -207,7 +243,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 52 column: 0 @@ -224,7 +263,10 @@ expression: diagnostics column: 38 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 54 column: 0 @@ -241,7 +283,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 55 column: 0 @@ -258,7 +303,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 56 column: 0 @@ -275,7 +323,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 57 column: 0 @@ -292,7 +343,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - UnnecessaryEncodeUTF8: ~ + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + commit: "Remove unnecessary `encode`" + fixable: true location: row: 58 column: 6 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP013.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP013.py.snap index b4ac653305..c43332ad7b 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP013.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP013.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - ConvertTypedDictFunctionalToClass: - name: MyType - fixable: true + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 5 column: 0 @@ -22,9 +23,10 @@ expression: diagnostics column: 50 parent: ~ - kind: - ConvertTypedDictFunctionalToClass: - name: MyType - fixable: true + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 8 column: 0 @@ -41,9 +43,10 @@ expression: diagnostics column: 48 parent: ~ - kind: - ConvertTypedDictFunctionalToClass: - name: MyType - fixable: true + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 11 column: 0 @@ -60,9 +63,10 @@ expression: diagnostics column: 42 parent: ~ - kind: - ConvertTypedDictFunctionalToClass: - name: MyType - fixable: true + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 14 column: 0 @@ -79,9 +83,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - ConvertTypedDictFunctionalToClass: - name: MyType - fixable: true + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 17 column: 0 @@ -98,9 +103,10 @@ expression: diagnostics column: 44 parent: ~ - kind: - ConvertTypedDictFunctionalToClass: - name: MyType - fixable: true + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 18 column: 0 @@ -117,9 +123,10 @@ expression: diagnostics column: 39 parent: ~ - kind: - ConvertTypedDictFunctionalToClass: - name: MyType - fixable: true + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 21 column: 0 @@ -136,9 +143,10 @@ expression: diagnostics column: 54 parent: ~ - kind: - ConvertTypedDictFunctionalToClass: - name: MyType - fixable: true + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 24 column: 0 @@ -155,9 +163,10 @@ expression: diagnostics column: 63 parent: ~ - kind: - ConvertTypedDictFunctionalToClass: - name: MyType - fixable: true + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 27 column: 0 @@ -174,9 +183,10 @@ expression: diagnostics column: 55 parent: ~ - kind: - ConvertTypedDictFunctionalToClass: - name: MyType - fixable: true + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 30 column: 0 @@ -193,9 +203,10 @@ expression: diagnostics column: 49 parent: ~ - kind: - ConvertTypedDictFunctionalToClass: - name: MyType - fixable: true + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 40 column: 0 @@ -212,9 +223,10 @@ expression: diagnostics column: 32 parent: ~ - kind: - ConvertTypedDictFunctionalToClass: - name: MyType - fixable: true + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 43 column: 0 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP014.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP014.py.snap index 4871c56f67..e885bd6f36 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP014.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP014.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - ConvertNamedTupleFunctionalToClass: - name: MyType - fixable: true + name: ConvertNamedTupleFunctionalToClass + body: "Convert `MyType` from `NamedTuple` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 5 column: 0 @@ -22,9 +23,10 @@ expression: diagnostics column: 67 parent: ~ - kind: - ConvertNamedTupleFunctionalToClass: - name: MyType - fixable: true + name: ConvertNamedTupleFunctionalToClass + body: "Convert `MyType` from `NamedTuple` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 8 column: 0 @@ -41,9 +43,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - ConvertNamedTupleFunctionalToClass: - name: MyType - fixable: true + name: ConvertNamedTupleFunctionalToClass + body: "Convert `MyType` from `NamedTuple` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 15 column: 0 @@ -60,9 +63,10 @@ expression: diagnostics column: 62 parent: ~ - kind: - ConvertNamedTupleFunctionalToClass: - name: MyType - fixable: true + name: ConvertNamedTupleFunctionalToClass + body: "Convert `MyType` from `NamedTuple` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 28 column: 0 @@ -79,9 +83,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - ConvertNamedTupleFunctionalToClass: - name: MyType - fixable: true + name: ConvertNamedTupleFunctionalToClass + body: "Convert `MyType` from `NamedTuple` functional to class syntax" + commit: "Convert `MyType` to class syntax" + fixable: true location: row: 31 column: 0 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP015.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP015.py.snap index 3d5a65fa07..6c1d928872 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP015.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP015.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 1 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 2 column: 0 @@ -39,8 +43,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 3 column: 0 @@ -57,8 +63,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 4 column: 0 @@ -75,8 +83,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 5 column: 0 @@ -93,8 +103,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 6 column: 0 @@ -111,8 +123,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 7 column: 0 @@ -129,8 +143,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"w\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"w\"\"" + commit: "Replace with \"\"w\"\"" + fixable: true location: row: 8 column: 0 @@ -147,8 +163,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 10 column: 5 @@ -165,8 +183,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 12 column: 5 @@ -183,8 +203,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 14 column: 5 @@ -201,8 +223,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 16 column: 5 @@ -219,8 +243,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 18 column: 5 @@ -237,8 +263,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 20 column: 5 @@ -255,8 +283,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 22 column: 5 @@ -273,8 +303,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"w\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"w\"\"" + commit: "Replace with \"\"w\"\"" + fixable: true location: row: 24 column: 5 @@ -291,8 +323,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 27 column: 0 @@ -309,8 +343,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 28 column: 0 @@ -327,8 +363,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 30 column: 5 @@ -345,8 +383,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 32 column: 5 @@ -363,8 +403,10 @@ expression: diagnostics column: 32 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 35 column: 5 @@ -381,8 +423,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 35 column: 29 @@ -399,8 +443,10 @@ expression: diagnostics column: 44 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 37 column: 5 @@ -417,8 +463,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 37 column: 30 @@ -435,8 +483,10 @@ expression: diagnostics column: 46 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 40 column: 0 @@ -453,8 +503,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 41 column: 0 @@ -471,8 +523,10 @@ expression: diagnostics column: 25 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 42 column: 0 @@ -489,8 +543,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 44 column: 5 @@ -507,8 +563,10 @@ expression: diagnostics column: 25 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 46 column: 5 @@ -525,8 +583,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 48 column: 5 @@ -543,8 +603,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 51 column: 0 @@ -561,8 +623,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 52 column: 0 @@ -579,8 +643,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 53 column: 0 @@ -597,8 +663,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 55 column: 5 @@ -615,8 +683,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 57 column: 5 @@ -633,8 +703,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 59 column: 5 @@ -651,8 +723,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 62 column: 0 @@ -669,8 +743,10 @@ expression: diagnostics column: 25 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 63 column: 0 @@ -687,8 +763,10 @@ expression: diagnostics column: 109 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 64 column: 0 @@ -705,8 +783,10 @@ expression: diagnostics column: 68 parent: ~ - kind: - RedundantOpenModes: - replacement: ~ + name: RedundantOpenModes + body: Unnecessary open mode parameters + commit: Remove open mode parameters + fixable: true location: row: 65 column: 0 @@ -723,8 +803,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 67 column: 0 @@ -741,8 +823,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 68 column: 0 @@ -759,8 +843,10 @@ expression: diagnostics column: 110 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 69 column: 0 @@ -777,8 +863,10 @@ expression: diagnostics column: 69 parent: ~ - kind: - RedundantOpenModes: - replacement: "\"rb\"" + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + commit: "Replace with \"\"rb\"\"" + fixable: true location: row: 70 column: 0 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP018.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP018.py.snap index a74f2924c1..6671503371 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP018.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP018.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - NativeLiterals: - literal_type: Str + name: NativeLiterals + body: "Unnecessary call to `str`" + commit: "Replace with `str`" + fixable: true location: row: 20 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - NativeLiterals: - literal_type: Str + name: NativeLiterals + body: "Unnecessary call to `str`" + commit: "Replace with `str`" + fixable: true location: row: 21 column: 0 @@ -39,8 +43,10 @@ expression: diagnostics column: 10 parent: ~ - kind: - NativeLiterals: - literal_type: Str + name: NativeLiterals + body: "Unnecessary call to `str`" + commit: "Replace with `str`" + fixable: true location: row: 22 column: 0 @@ -57,8 +63,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - NativeLiterals: - literal_type: Bytes + name: NativeLiterals + body: "Unnecessary call to `bytes`" + commit: "Replace with `bytes`" + fixable: true location: row: 24 column: 0 @@ -75,8 +83,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - NativeLiterals: - literal_type: Bytes + name: NativeLiterals + body: "Unnecessary call to `bytes`" + commit: "Replace with `bytes`" + fixable: true location: row: 25 column: 0 @@ -93,8 +103,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - NativeLiterals: - literal_type: Bytes + name: NativeLiterals + body: "Unnecessary call to `bytes`" + commit: "Replace with `bytes`" + fixable: true location: row: 26 column: 0 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP019.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP019.py.snap index 9b395c2f39..0cb2021d78 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP019.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP019.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - TypingTextStrAlias: ~ + name: TypingTextStrAlias + body: "`typing.Text` is deprecated, use `str`" + commit: "Replace with `str`" + fixable: true location: row: 7 column: 21 @@ -20,7 +23,10 @@ expression: diagnostics column: 25 parent: ~ - kind: - TypingTextStrAlias: ~ + name: TypingTextStrAlias + body: "`typing.Text` is deprecated, use `str`" + commit: "Replace with `str`" + fixable: true location: row: 11 column: 28 @@ -37,7 +43,10 @@ expression: diagnostics column: 39 parent: ~ - kind: - TypingTextStrAlias: ~ + name: TypingTextStrAlias + body: "`typing.Text` is deprecated, use `str`" + commit: "Replace with `str`" + fixable: true location: row: 15 column: 27 @@ -54,7 +63,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - TypingTextStrAlias: ~ + name: TypingTextStrAlias + body: "`typing.Text` is deprecated, use `str`" + commit: "Replace with `str`" + fixable: true location: row: 19 column: 28 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP021.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP021.py.snap index cc292036fd..afcddccfa3 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP021.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP021.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - ReplaceUniversalNewlines: ~ + name: ReplaceUniversalNewlines + body: "`universal_newlines` is deprecated, use `text`" + commit: "Replace with `text` keyword argument" + fixable: true location: row: 6 column: 24 @@ -20,7 +23,10 @@ expression: diagnostics column: 42 parent: ~ - kind: - ReplaceUniversalNewlines: ~ + name: ReplaceUniversalNewlines + body: "`universal_newlines` is deprecated, use `text`" + commit: "Replace with `text` keyword argument" + fixable: true location: row: 7 column: 22 @@ -37,7 +43,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - ReplaceUniversalNewlines: ~ + name: ReplaceUniversalNewlines + body: "`universal_newlines` is deprecated, use `text`" + commit: "Replace with `text` keyword argument" + fixable: true location: row: 9 column: 13 @@ -54,7 +63,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - ReplaceUniversalNewlines: ~ + name: ReplaceUniversalNewlines + body: "`universal_newlines` is deprecated, use `text`" + commit: "Replace with `text` keyword argument" + fixable: true location: row: 10 column: 21 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP022.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP022.py.snap index 4e3d369f44..000d3dcc88 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP022.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP022.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - ReplaceStdoutStderr: ~ + name: ReplaceStdoutStderr + body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" + commit: "Replace with `capture_output` keyword argument" + fixable: true location: row: 4 column: 9 @@ -20,7 +23,10 @@ expression: diagnostics column: 68 parent: ~ - kind: - ReplaceStdoutStderr: ~ + name: ReplaceStdoutStderr + body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" + commit: "Replace with `capture_output` keyword argument" + fixable: true location: row: 6 column: 9 @@ -37,7 +43,10 @@ expression: diagnostics column: 79 parent: ~ - kind: - ReplaceStdoutStderr: ~ + name: ReplaceStdoutStderr + body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" + commit: "Replace with `capture_output` keyword argument" + fixable: true location: row: 8 column: 9 @@ -54,7 +63,10 @@ expression: diagnostics column: 85 parent: ~ - kind: - ReplaceStdoutStderr: ~ + name: ReplaceStdoutStderr + body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" + commit: "Replace with `capture_output` keyword argument" + fixable: true location: row: 10 column: 9 @@ -71,7 +83,10 @@ expression: diagnostics column: 71 parent: ~ - kind: - ReplaceStdoutStderr: ~ + name: ReplaceStdoutStderr + body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" + commit: "Replace with `capture_output` keyword argument" + fixable: true location: row: 14 column: 9 @@ -88,7 +103,10 @@ expression: diagnostics column: 71 parent: ~ - kind: - ReplaceStdoutStderr: ~ + name: ReplaceStdoutStderr + body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" + commit: "Replace with `capture_output` keyword argument" + fixable: true location: row: 18 column: 9 @@ -105,7 +123,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - ReplaceStdoutStderr: ~ + name: ReplaceStdoutStderr + body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" + commit: "Replace with `capture_output` keyword argument" + fixable: true location: row: 29 column: 13 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP023.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP023.py.snap index 0263189224..671cd10b15 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP023.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP023.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - RewriteCElementTree: ~ + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + commit: "Replace with `ElementTree`" + fixable: true location: row: 2 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 59 parent: ~ - kind: - RewriteCElementTree: ~ + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + commit: "Replace with `ElementTree`" + fixable: true location: row: 3 column: 7 @@ -37,7 +43,10 @@ expression: diagnostics column: 35 parent: ~ - kind: - RewriteCElementTree: ~ + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + commit: "Replace with `ElementTree`" + fixable: true location: row: 6 column: 0 @@ -54,7 +63,10 @@ expression: diagnostics column: 44 parent: ~ - kind: - RewriteCElementTree: ~ + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + commit: "Replace with `ElementTree`" + fixable: true location: row: 7 column: 10 @@ -71,7 +83,10 @@ expression: diagnostics column: 49 parent: ~ - kind: - RewriteCElementTree: ~ + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + commit: "Replace with `ElementTree`" + fixable: true location: row: 10 column: 0 @@ -88,7 +103,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - RewriteCElementTree: ~ + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + commit: "Replace with `ElementTree`" + fixable: true location: row: 16 column: 11 @@ -105,7 +123,10 @@ expression: diagnostics column: 39 parent: ~ - kind: - RewriteCElementTree: ~ + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + commit: "Replace with `ElementTree`" + fixable: true location: row: 17 column: 26 @@ -122,7 +143,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - RewriteCElementTree: ~ + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + commit: "Replace with `ElementTree`" + fixable: true location: row: 19 column: 22 @@ -139,7 +163,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - RewriteCElementTree: ~ + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + commit: "Replace with `ElementTree`" + fixable: true location: row: 21 column: 19 @@ -156,7 +183,10 @@ expression: diagnostics column: 47 parent: ~ - kind: - RewriteCElementTree: ~ + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + commit: "Replace with `ElementTree`" + fixable: true location: row: 24 column: 31 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_0.py.snap index c6283a424e..9f6bd8b79b 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_0.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - OSErrorAlias: - name: EnvironmentError + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `EnvironmentError` with builtin `OSError`" + fixable: true location: row: 6 column: 7 @@ -21,8 +23,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - OSErrorAlias: - name: IOError + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `IOError` with builtin `OSError`" + fixable: true location: row: 11 column: 7 @@ -39,8 +43,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - OSErrorAlias: - name: WindowsError + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `WindowsError` with builtin `OSError`" + fixable: true location: row: 16 column: 7 @@ -57,8 +63,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - OSErrorAlias: - name: mmap.error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `mmap.error` with builtin `OSError`" + fixable: true location: row: 21 column: 7 @@ -75,8 +83,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - OSErrorAlias: - name: select.error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `select.error` with builtin `OSError`" + fixable: true location: row: 26 column: 7 @@ -93,8 +103,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - OSErrorAlias: - name: socket.error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `socket.error` with builtin `OSError`" + fixable: true location: row: 31 column: 7 @@ -111,8 +123,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - OSErrorAlias: - name: error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `error` with builtin `OSError`" + fixable: true location: row: 36 column: 7 @@ -129,8 +143,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - OSErrorAlias: - name: ~ + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace with builtin `OSError`" + fixable: true location: row: 43 column: 7 @@ -147,8 +163,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - OSErrorAlias: - name: ~ + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace with builtin `OSError`" + fixable: true location: row: 47 column: 7 @@ -165,8 +183,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - OSErrorAlias: - name: ~ + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace with builtin `OSError`" + fixable: true location: row: 51 column: 7 @@ -183,8 +203,10 @@ expression: diagnostics column: 57 parent: ~ - kind: - OSErrorAlias: - name: ~ + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace with builtin `OSError`" + fixable: true location: row: 58 column: 7 @@ -201,8 +223,10 @@ expression: diagnostics column: 35 parent: ~ - kind: - OSErrorAlias: - name: ~ + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace with builtin `OSError`" + fixable: true location: row: 65 column: 7 @@ -219,8 +243,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - OSErrorAlias: - name: mmap.error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `mmap.error` with builtin `OSError`" + fixable: true location: row: 87 column: 7 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_1.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_1.py.snap index 0046a9c37d..a5dece1b30 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_1.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_1.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - OSErrorAlias: - name: ~ + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace with builtin `OSError`" + fixable: true location: row: 5 column: 7 @@ -21,8 +23,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - OSErrorAlias: - name: ~ + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace with builtin `OSError`" + fixable: true location: row: 7 column: 7 @@ -39,8 +43,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - OSErrorAlias: - name: ~ + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace with builtin `OSError`" + fixable: true location: row: 12 column: 7 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_2.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_2.py.snap index 7f5945a5e5..9870d40e38 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_2.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_2.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - OSErrorAlias: - name: socket.error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `socket.error` with builtin `OSError`" + fixable: true location: row: 10 column: 6 @@ -21,8 +23,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - OSErrorAlias: - name: mmap.error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `mmap.error` with builtin `OSError`" + fixable: true location: row: 11 column: 6 @@ -39,8 +43,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - OSErrorAlias: - name: select.error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `select.error` with builtin `OSError`" + fixable: true location: row: 12 column: 6 @@ -57,8 +63,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - OSErrorAlias: - name: socket.error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `socket.error` with builtin `OSError`" + fixable: true location: row: 14 column: 6 @@ -75,8 +83,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - OSErrorAlias: - name: mmap.error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `mmap.error` with builtin `OSError`" + fixable: true location: row: 15 column: 6 @@ -93,8 +103,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - OSErrorAlias: - name: select.error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `select.error` with builtin `OSError`" + fixable: true location: row: 16 column: 6 @@ -111,8 +123,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - OSErrorAlias: - name: socket.error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `socket.error` with builtin `OSError`" + fixable: true location: row: 18 column: 6 @@ -129,8 +143,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - OSErrorAlias: - name: error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `error` with builtin `OSError`" + fixable: true location: row: 25 column: 6 @@ -147,8 +163,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - OSErrorAlias: - name: error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `error` with builtin `OSError`" + fixable: true location: row: 28 column: 6 @@ -165,8 +183,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - OSErrorAlias: - name: error + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `error` with builtin `OSError`" + fixable: true location: row: 31 column: 6 @@ -183,8 +203,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - OSErrorAlias: - name: EnvironmentError + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `EnvironmentError` with builtin `OSError`" + fixable: true location: row: 34 column: 6 @@ -201,8 +223,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - OSErrorAlias: - name: IOError + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `IOError` with builtin `OSError`" + fixable: true location: row: 35 column: 6 @@ -219,8 +243,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - OSErrorAlias: - name: WindowsError + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `WindowsError` with builtin `OSError`" + fixable: true location: row: 36 column: 6 @@ -237,8 +263,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - OSErrorAlias: - name: EnvironmentError + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `EnvironmentError` with builtin `OSError`" + fixable: true location: row: 38 column: 6 @@ -255,8 +283,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - OSErrorAlias: - name: IOError + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `IOError` with builtin `OSError`" + fixable: true location: row: 39 column: 6 @@ -273,8 +303,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - OSErrorAlias: - name: WindowsError + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `WindowsError` with builtin `OSError`" + fixable: true location: row: 40 column: 6 @@ -291,8 +323,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - OSErrorAlias: - name: EnvironmentError + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `EnvironmentError` with builtin `OSError`" + fixable: true location: row: 42 column: 6 @@ -309,8 +343,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - OSErrorAlias: - name: WindowsError + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `WindowsError` with builtin `OSError`" + fixable: true location: row: 48 column: 6 @@ -327,8 +363,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - OSErrorAlias: - name: EnvironmentError + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `EnvironmentError` with builtin `OSError`" + fixable: true location: row: 49 column: 6 @@ -345,8 +383,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - OSErrorAlias: - name: IOError + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + commit: "Replace `IOError` with builtin `OSError`" + fixable: true location: row: 50 column: 6 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP025.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP025.py.snap index 24bf39cc6a..95ec52c59d 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP025.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP025.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - RewriteUnicodeLiteral: ~ + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + commit: Remove unicode prefix + fixable: true location: row: 2 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - RewriteUnicodeLiteral: ~ + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + commit: Remove unicode prefix + fixable: true location: row: 4 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - RewriteUnicodeLiteral: ~ + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + commit: Remove unicode prefix + fixable: true location: row: 6 column: 6 @@ -54,7 +63,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - RewriteUnicodeLiteral: ~ + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + commit: Remove unicode prefix + fixable: true location: row: 8 column: 6 @@ -71,7 +83,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - RewriteUnicodeLiteral: ~ + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + commit: Remove unicode prefix + fixable: true location: row: 12 column: 4 @@ -88,7 +103,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - RewriteUnicodeLiteral: ~ + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + commit: Remove unicode prefix + fixable: true location: row: 12 column: 14 @@ -105,7 +123,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - RewriteUnicodeLiteral: ~ + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + commit: Remove unicode prefix + fixable: true location: row: 12 column: 26 @@ -122,7 +143,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - RewriteUnicodeLiteral: ~ + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + commit: Remove unicode prefix + fixable: true location: row: 12 column: 38 @@ -139,7 +163,10 @@ expression: diagnostics column: 39 parent: ~ - kind: - RewriteUnicodeLiteral: ~ + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + commit: Remove unicode prefix + fixable: true location: row: 16 column: 4 @@ -156,7 +183,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - RewriteUnicodeLiteral: ~ + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + commit: Remove unicode prefix + fixable: true location: row: 17 column: 4 @@ -173,7 +203,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - RewriteUnicodeLiteral: ~ + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + commit: Remove unicode prefix + fixable: true location: row: 18 column: 4 @@ -190,7 +223,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - RewriteUnicodeLiteral: ~ + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + commit: Remove unicode prefix + fixable: true location: row: 19 column: 4 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP026.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP026.py.snap index a14a09a3a4..05062535d4 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP026.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP026.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 3 column: 11 @@ -21,8 +23,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 6 column: 11 @@ -39,8 +43,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 9 column: 7 @@ -57,8 +63,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 12 column: 19 @@ -75,8 +83,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 15 column: 7 @@ -93,8 +103,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 19 column: 0 @@ -111,8 +123,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 22 column: 0 @@ -129,8 +143,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 28 column: 0 @@ -147,8 +163,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 36 column: 0 @@ -165,8 +183,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 42 column: 0 @@ -183,8 +203,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 48 column: 0 @@ -201,8 +223,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 49 column: 0 @@ -219,8 +243,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 53 column: 8 @@ -237,8 +263,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 64 column: 7 @@ -255,8 +283,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 64 column: 13 @@ -273,8 +303,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 67 column: 7 @@ -291,8 +323,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 70 column: 0 @@ -309,8 +343,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 74 column: 11 @@ -327,8 +363,10 @@ expression: diagnostics column: 41 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 74 column: 24 @@ -345,8 +383,10 @@ expression: diagnostics column: 41 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 74 column: 37 @@ -363,8 +403,10 @@ expression: diagnostics column: 41 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 77 column: 11 @@ -381,8 +423,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 77 column: 24 @@ -399,8 +443,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 77 column: 37 @@ -417,8 +463,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - RewriteMockImport: - reference_type: Import + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Import from `unittest.mock` instead" + fixable: true location: row: 81 column: 4 @@ -435,8 +483,10 @@ expression: diagnostics column: 51 parent: ~ - kind: - RewriteMockImport: - reference_type: Attribute + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + commit: "Replace `mock.mock` with `mock`" + fixable: true location: row: 88 column: 4 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP027.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP027.py.snap index cdbfe7e6a7..c4d9928992 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP027.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP027.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - RewriteListComprehension: ~ + name: RewriteListComprehension + body: Replace unpacked list comprehension with a generator expression + commit: Replace with generator expression + fixable: true location: row: 2 column: 16 @@ -20,7 +23,10 @@ expression: diagnostics column: 38 parent: ~ - kind: - RewriteListComprehension: ~ + name: RewriteListComprehension + body: Replace unpacked list comprehension with a generator expression + commit: Replace with generator expression + fixable: true location: row: 4 column: 15 @@ -37,7 +43,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - RewriteListComprehension: ~ + name: RewriteListComprehension + body: Replace unpacked list comprehension with a generator expression + commit: Replace with generator expression + fixable: true location: row: 6 column: 25 @@ -54,7 +63,10 @@ expression: diagnostics column: 47 parent: ~ - kind: - RewriteListComprehension: ~ + name: RewriteListComprehension + body: Replace unpacked list comprehension with a generator expression + commit: Replace with generator expression + fixable: true location: row: 8 column: 16 @@ -71,7 +83,10 @@ expression: diagnostics column: 51 parent: ~ - kind: - RewriteListComprehension: ~ + name: RewriteListComprehension + body: Replace unpacked list comprehension with a generator expression + commit: Replace with generator expression + fixable: true location: row: 10 column: 16 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_0.py.snap index a877c9b71a..f152b41875 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_0.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - RewriteYieldFrom: ~ + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + commit: "Replace with `yield from`" + fixable: true location: row: 2 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - RewriteYieldFrom: ~ + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + commit: "Replace with `yield from`" + fixable: true location: row: 7 column: 4 @@ -37,7 +43,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - RewriteYieldFrom: ~ + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + commit: "Replace with `yield from`" + fixable: true location: row: 12 column: 4 @@ -54,7 +63,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - RewriteYieldFrom: ~ + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + commit: "Replace with `yield from`" + fixable: true location: row: 17 column: 4 @@ -71,7 +83,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - RewriteYieldFrom: ~ + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + commit: "Replace with `yield from`" + fixable: true location: row: 22 column: 4 @@ -88,7 +103,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - RewriteYieldFrom: ~ + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + commit: "Replace with `yield from`" + fixable: true location: row: 27 column: 4 @@ -105,7 +123,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - RewriteYieldFrom: ~ + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + commit: "Replace with `yield from`" + fixable: true location: row: 33 column: 4 @@ -122,7 +143,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - RewriteYieldFrom: ~ + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + commit: "Replace with `yield from`" + fixable: true location: row: 44 column: 4 @@ -139,7 +163,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - RewriteYieldFrom: ~ + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + commit: "Replace with `yield from`" + fixable: true location: row: 49 column: 4 @@ -156,7 +183,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - RewriteYieldFrom: ~ + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + commit: "Replace with `yield from`" + fixable: true location: row: 55 column: 8 @@ -173,7 +203,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - RewriteYieldFrom: ~ + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + commit: "Replace with `yield from`" + fixable: true location: row: 67 column: 4 @@ -190,7 +223,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - RewriteYieldFrom: ~ + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + commit: "Replace with `yield from`" + fixable: true location: row: 72 column: 4 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP029.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP029.py.snap index 87243f2e75..2c5ff30133 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP029.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP029.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - UnnecessaryBuiltinImport: - names: - - "*" + name: UnnecessaryBuiltinImport + body: "Unnecessary builtin import: `*`" + commit: Remove unnecessary builtin import + fixable: true location: row: 1 column: 0 @@ -22,10 +23,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnnecessaryBuiltinImport: - names: - - ascii - - bytes + name: UnnecessaryBuiltinImport + body: "Unnecessary builtin imports: `ascii`, `bytes`" + commit: Remove unnecessary builtin import + fixable: true location: row: 2 column: 0 @@ -42,10 +43,10 @@ expression: diagnostics column: 42 parent: ~ - kind: - UnnecessaryBuiltinImport: - names: - - filter - - zip + name: UnnecessaryBuiltinImport + body: "Unnecessary builtin imports: `filter`, `zip`" + commit: Remove unnecessary builtin import + fixable: true location: row: 4 column: 0 @@ -62,9 +63,10 @@ expression: diagnostics column: 46 parent: ~ - kind: - UnnecessaryBuiltinImport: - names: - - open + name: UnnecessaryBuiltinImport + body: "Unnecessary builtin import: `open`" + commit: Remove unnecessary builtin import + fixable: true location: row: 5 column: 0 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_0.py.snap index f0a0b813fc..5bf48988cd 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_0.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 3 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 33 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 5 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 9 column: 0 @@ -54,7 +63,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 11 column: 0 @@ -71,7 +83,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 13 column: 4 @@ -88,7 +103,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 15 column: 0 @@ -105,7 +123,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 17 column: 4 @@ -122,7 +143,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 20 column: 0 @@ -139,7 +163,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 22 column: 0 @@ -156,7 +183,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 24 column: 0 @@ -166,7 +196,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 29 column: 4 @@ -176,7 +209,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 34 column: 4 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_2.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_2.py.snap index 87dcaf6ec2..209dd34ccb 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_2.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_2.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 6 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 8 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 10 column: 0 @@ -54,7 +63,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 12 column: 0 @@ -71,7 +83,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 14 column: 0 @@ -81,7 +96,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 16 column: 0 @@ -98,7 +116,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 18 column: 0 @@ -115,7 +136,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 20 column: 0 @@ -132,7 +156,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 22 column: 0 @@ -149,7 +176,10 @@ expression: diagnostics column: 33 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 24 column: 0 @@ -166,7 +196,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 26 column: 0 @@ -183,7 +216,10 @@ expression: diagnostics column: 39 parent: ~ - kind: - FormatLiterals: ~ + name: FormatLiterals + body: Use implicit references for positional format fields + commit: Remove explicit positional indexes + fixable: true location: row: 28 column: 0 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_0.py.snap index db63c11a3f..67821c7e9d 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_0.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 4 column: 6 @@ -20,7 +23,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 6 column: 6 @@ -37,7 +43,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 8 column: 6 @@ -54,7 +63,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 10 column: 6 @@ -71,7 +83,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 12 column: 6 @@ -88,7 +103,10 @@ expression: diagnostics column: 34 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 12 column: 14 @@ -105,7 +123,10 @@ expression: diagnostics column: 32 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 14 column: 6 @@ -122,7 +143,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 16 column: 6 @@ -139,7 +163,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 18 column: 6 @@ -156,7 +183,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 20 column: 6 @@ -173,7 +203,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 22 column: 6 @@ -190,7 +223,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 24 column: 6 @@ -207,7 +243,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 26 column: 6 @@ -224,7 +263,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 28 column: 6 @@ -241,7 +283,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 30 column: 6 @@ -258,7 +303,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 33 column: 2 @@ -275,7 +323,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 38 column: 6 @@ -292,7 +343,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 40 column: 6 @@ -309,7 +363,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 42 column: 6 @@ -326,7 +383,10 @@ expression: diagnostics column: 1 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 47 column: 6 @@ -343,7 +403,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 49 column: 6 @@ -360,7 +423,10 @@ expression: diagnostics column: 43 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 51 column: 6 @@ -377,7 +443,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 53 column: 6 @@ -394,7 +463,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 56 column: 4 @@ -411,7 +483,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 61 column: 4 @@ -428,7 +503,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 67 column: 4 @@ -445,7 +523,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 71 column: 6 @@ -462,7 +543,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 73 column: 6 @@ -479,7 +563,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - PrintfStringFormatting: ~ + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + commit: Replace with format specifiers + fixable: true location: row: 75 column: 6 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP032.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP032.py.snap index 95e09d6b5a..a6e6ae5e10 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP032.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP032.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 5 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 7 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 9 column: 0 @@ -54,7 +63,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 11 column: 0 @@ -71,7 +83,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 13 column: 0 @@ -88,7 +103,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 15 column: 0 @@ -105,7 +123,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 17 column: 0 @@ -122,7 +143,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 19 column: 0 @@ -139,7 +163,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 21 column: 0 @@ -156,7 +183,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 23 column: 0 @@ -173,7 +203,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 25 column: 0 @@ -190,7 +223,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 27 column: 0 @@ -207,7 +243,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 29 column: 0 @@ -224,7 +263,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 31 column: 0 @@ -241,7 +283,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 33 column: 0 @@ -258,7 +303,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 35 column: 4 @@ -275,7 +323,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 37 column: 6 @@ -292,7 +343,10 @@ expression: diagnostics column: 25 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 39 column: 0 @@ -309,7 +363,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 41 column: 0 @@ -326,7 +383,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 43 column: 0 @@ -343,7 +403,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 45 column: 0 @@ -360,7 +423,10 @@ expression: diagnostics column: 14 parent: ~ - kind: - FString: ~ + name: FString + body: "Use f-string instead of `format` call" + commit: Convert to f-string + fixable: true location: row: 47 column: 0 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033.py.snap index 7a1b50d870..dccf49568f 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - FunctoolsCache: ~ + name: FunctoolsCache + body: "Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)`" + commit: "Rewrite with `@functools.cache" + fixable: true location: row: 5 column: 20 @@ -20,7 +23,10 @@ expression: diagnostics column: 34 parent: ~ - kind: - FunctoolsCache: ~ + name: FunctoolsCache + body: "Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)`" + commit: "Rewrite with `@functools.cache" + fixable: true location: row: 10 column: 10 @@ -30,7 +36,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - FunctoolsCache: ~ + name: FunctoolsCache + body: "Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)`" + commit: "Rewrite with `@functools.cache" + fixable: true location: row: 16 column: 20 @@ -47,7 +56,10 @@ expression: diagnostics column: 34 parent: ~ - kind: - FunctoolsCache: ~ + name: FunctoolsCache + body: "Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)`" + commit: "Rewrite with `@functools.cache" + fixable: true location: row: 21 column: 20 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP034.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP034.py.snap index 55d295cb4e..2d545775f5 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP034.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP034.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - ExtraneousParentheses: ~ + name: ExtraneousParentheses + body: Avoid extraneous parentheses + commit: Remove extraneous parentheses + fixable: true location: row: 2 column: 6 @@ -20,7 +23,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - ExtraneousParentheses: ~ + name: ExtraneousParentheses + body: Avoid extraneous parentheses + commit: Remove extraneous parentheses + fixable: true location: row: 5 column: 6 @@ -37,7 +43,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - ExtraneousParentheses: ~ + name: ExtraneousParentheses + body: Avoid extraneous parentheses + commit: Remove extraneous parentheses + fixable: true location: row: 8 column: 6 @@ -54,7 +63,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - ExtraneousParentheses: ~ + name: ExtraneousParentheses + body: Avoid extraneous parentheses + commit: Remove extraneous parentheses + fixable: true location: row: 11 column: 6 @@ -71,7 +83,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - ExtraneousParentheses: ~ + name: ExtraneousParentheses + body: Avoid extraneous parentheses + commit: Remove extraneous parentheses + fixable: true location: row: 14 column: 6 @@ -88,7 +103,10 @@ expression: diagnostics column: 25 parent: ~ - kind: - ExtraneousParentheses: ~ + name: ExtraneousParentheses + body: Avoid extraneous parentheses + commit: Remove extraneous parentheses + fixable: true location: row: 18 column: 4 @@ -105,7 +123,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - ExtraneousParentheses: ~ + name: ExtraneousParentheses + body: Avoid extraneous parentheses + commit: Remove extraneous parentheses + fixable: true location: row: 23 column: 4 @@ -122,7 +143,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - ExtraneousParentheses: ~ + name: ExtraneousParentheses + body: Avoid extraneous parentheses + commit: Remove extraneous parentheses + fixable: true location: row: 30 column: 12 @@ -139,7 +163,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - ExtraneousParentheses: ~ + name: ExtraneousParentheses + body: Avoid extraneous parentheses + commit: Remove extraneous parentheses + fixable: true location: row: 35 column: 8 @@ -156,7 +183,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - ExtraneousParentheses: ~ + name: ExtraneousParentheses + body: Avoid extraneous parentheses + commit: Remove extraneous parentheses + fixable: true location: row: 39 column: 6 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP035.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP035.py.snap index dd75b66d8d..9206a81b94 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP035.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP035.py.snap @@ -3,11 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`" + commit: "Import from `collections.abc`" + fixable: true location: row: 2 column: 0 @@ -24,11 +23,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`" + commit: "Import from `collections.abc`" + fixable: true location: row: 4 column: 0 @@ -45,12 +43,10 @@ expression: diagnostics column: 38 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - - Sequence - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`, `Sequence`" + commit: "Import from `collections.abc`" + fixable: true location: row: 6 column: 0 @@ -67,11 +63,10 @@ expression: diagnostics column: 41 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`" + commit: "Import from `collections.abc`" + fixable: true location: row: 8 column: 0 @@ -88,11 +83,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`" + commit: "Import from `collections.abc`" + fixable: true location: row: 10 column: 0 @@ -109,11 +103,10 @@ expression: diagnostics column: 42 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`" + commit: "Import from `collections.abc`" + fixable: true location: row: 12 column: 0 @@ -130,11 +123,10 @@ expression: diagnostics column: 33 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`" + commit: "Import from `collections.abc`" + fixable: true location: row: 15 column: 0 @@ -151,12 +143,10 @@ expression: diagnostics column: 32 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - - Sequence - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`, `Sequence`" + commit: "Import from `collections.abc`" + fixable: true location: row: 18 column: 0 @@ -173,11 +163,10 @@ expression: diagnostics column: 50 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`" + commit: "Import from `collections.abc`" + fixable: true location: row: 20 column: 0 @@ -194,11 +183,10 @@ expression: diagnostics column: 51 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`" + commit: "Import from `collections.abc`" + fixable: true location: row: 23 column: 4 @@ -215,11 +203,10 @@ expression: diagnostics column: 44 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`" + commit: "Import from `collections.abc`" + fixable: true location: row: 28 column: 4 @@ -236,11 +223,10 @@ expression: diagnostics column: 44 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`" + commit: "Import from `collections.abc`" + fixable: true location: row: 30 column: 9 @@ -257,11 +243,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`" + commit: "Import from `collections.abc`" + fixable: true location: row: 33 column: 0 @@ -278,12 +263,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - - Callable - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`, `Callable`" + commit: "Import from `collections.abc`" + fixable: true location: row: 37 column: 4 @@ -300,11 +283,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Callable - fixable: true + name: ImportReplacements + body: "Import from `collections.abc` instead: `Callable`" + commit: "Import from `collections.abc`" + fixable: true location: row: 44 column: 0 @@ -321,11 +303,10 @@ expression: diagnostics column: 62 parent: ~ - kind: - ImportReplacements: - module: collections - members: - - OrderedDict - fixable: true + name: ImportReplacements + body: "Import from `collections` instead: `OrderedDict`" + commit: "Import from `collections`" + fixable: true location: row: 44 column: 0 @@ -342,12 +323,10 @@ expression: diagnostics column: 62 parent: ~ - kind: - ImportReplacements: - module: re - members: - - Match - - Pattern - fixable: true + name: ImportReplacements + body: "Import from `re` instead: `Match`, `Pattern`" + commit: "Import from `re`" + fixable: true location: row: 44 column: 0 @@ -364,11 +343,10 @@ expression: diagnostics column: 62 parent: ~ - kind: - ImportReplacements: - module: collections.abc - members: - - Mapping - fixable: false + name: ImportReplacements + body: "Import from `collections.abc` instead: `Mapping`" + commit: ~ + fixable: false location: row: 46 column: 9 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_0.py.snap index b9de62a0d8..b1faa6b0d7 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_0.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 3 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 8 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 16 column: 0 @@ -54,7 +63,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 20 column: 4 @@ -71,7 +83,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 25 column: 0 @@ -88,7 +103,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 29 column: 0 @@ -105,7 +123,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 37 column: 0 @@ -122,7 +143,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 45 column: 0 @@ -139,7 +163,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 53 column: 0 @@ -156,7 +183,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 56 column: 0 @@ -173,7 +203,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 62 column: 4 @@ -190,7 +223,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 67 column: 0 @@ -207,7 +243,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 73 column: 4 @@ -224,7 +263,10 @@ expression: diagnostics column: 13 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 86 column: 4 @@ -241,7 +283,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 97 column: 4 @@ -258,7 +303,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 104 column: 0 @@ -275,7 +323,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 116 column: 4 @@ -292,7 +343,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 122 column: 4 @@ -309,7 +363,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 125 column: 4 @@ -326,7 +383,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 130 column: 4 @@ -343,7 +403,10 @@ expression: diagnostics column: 9 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 140 column: 0 @@ -360,7 +423,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 150 column: 0 @@ -377,7 +443,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 163 column: 0 @@ -394,7 +463,10 @@ expression: diagnostics column: 6 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 166 column: 0 @@ -411,7 +483,10 @@ expression: diagnostics column: 49 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 168 column: 0 @@ -428,7 +503,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 172 column: 4 @@ -445,7 +523,10 @@ expression: diagnostics column: 6 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 176 column: 4 @@ -462,7 +543,10 @@ expression: diagnostics column: 53 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 179 column: 4 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_1.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_1.py.snap index 9b4af647b5..9cd9572345 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_1.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_1.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 3 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 8 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 13 column: 0 @@ -54,7 +63,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 18 column: 0 @@ -71,7 +83,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 23 column: 0 @@ -88,7 +103,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 28 column: 0 @@ -105,7 +123,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 35 column: 0 @@ -122,7 +143,10 @@ expression: diagnostics column: 5 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 42 column: 0 @@ -139,7 +163,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 49 column: 0 @@ -156,7 +183,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 56 column: 0 @@ -173,7 +203,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 62 column: 4 @@ -190,7 +223,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 67 column: 0 @@ -207,7 +243,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 75 column: 4 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_2.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_2.py.snap index e3c31ee7da..02cb9d271c 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_2.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_2.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 4 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 9 column: 0 @@ -37,7 +43,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 14 column: 0 @@ -54,7 +63,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 19 column: 0 @@ -71,7 +83,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 24 column: 0 @@ -88,7 +103,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 29 column: 0 @@ -105,7 +123,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 34 column: 0 @@ -122,7 +143,10 @@ expression: diagnostics column: 7 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 39 column: 0 @@ -139,7 +163,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 42 column: 0 @@ -156,7 +183,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 46 column: 4 @@ -173,7 +203,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 49 column: 0 @@ -190,7 +223,10 @@ expression: diagnostics column: 2 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 54 column: 0 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_3.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_3.py.snap index 30487b708f..fc062de507 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_3.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_3.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 3 column: 0 @@ -20,7 +23,10 @@ expression: diagnostics column: 28 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 13 column: 4 @@ -37,7 +43,10 @@ expression: diagnostics column: 32 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 23 column: 0 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_4.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_4.py.snap index b623c103af..6a75ffea9f 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_4.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_4.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 4 column: 4 @@ -20,7 +23,10 @@ expression: diagnostics column: 53 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 11 column: 4 @@ -37,7 +43,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 17 column: 4 @@ -54,7 +63,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 24 column: 4 @@ -71,7 +83,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 27 column: 4 @@ -88,7 +103,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 32 column: 4 @@ -105,7 +123,10 @@ expression: diagnostics column: 4 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 37 column: 4 @@ -122,7 +143,10 @@ expression: diagnostics column: 51 parent: ~ - kind: - OutdatedVersionBlock: ~ + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + commit: Remove outdated version block + fixable: true location: row: 42 column: 4 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP037.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP037.py.snap index 276fbfba31..09a33f3351 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP037.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP037.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 18 column: 13 @@ -20,7 +23,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 18 column: 27 @@ -37,7 +43,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 19 column: 7 @@ -54,7 +63,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 22 column: 20 @@ -71,7 +83,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 26 column: 15 @@ -88,7 +103,10 @@ expression: diagnostics column: 20 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 26 column: 32 @@ -105,7 +123,10 @@ expression: diagnostics column: 37 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 30 column: 9 @@ -122,7 +143,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 32 column: 13 @@ -139,7 +163,10 @@ expression: diagnostics column: 22 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 36 column: 7 @@ -156,7 +183,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 40 column: 26 @@ -173,7 +203,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 44 column: 30 @@ -190,7 +223,10 @@ expression: diagnostics column: 35 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 47 column: 13 @@ -207,7 +243,10 @@ expression: diagnostics column: 18 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 49 column: 7 @@ -224,7 +263,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 51 column: 14 @@ -241,7 +283,10 @@ expression: diagnostics column: 19 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 53 column: 12 @@ -258,7 +303,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 55 column: 19 @@ -275,7 +323,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 57 column: 19 @@ -292,7 +343,10 @@ expression: diagnostics column: 24 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 59 column: 10 @@ -309,7 +363,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 61 column: 18 @@ -326,7 +383,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 63 column: 28 @@ -343,7 +403,10 @@ expression: diagnostics column: 33 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 63 column: 44 @@ -360,7 +423,10 @@ expression: diagnostics column: 49 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 65 column: 28 @@ -377,7 +443,10 @@ expression: diagnostics column: 33 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 65 column: 35 @@ -394,7 +463,10 @@ expression: diagnostics column: 40 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 65 column: 44 @@ -411,7 +483,10 @@ expression: diagnostics column: 49 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 65 column: 51 @@ -428,7 +503,10 @@ expression: diagnostics column: 56 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 67 column: 23 @@ -445,7 +523,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 67 column: 37 @@ -462,7 +543,10 @@ expression: diagnostics column: 42 parent: ~ - kind: - QuotedAnnotation: ~ + name: QuotedAnnotation + body: Remove quotes from type annotation + commit: Remove quotes + fixable: true location: row: 67 column: 44 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP038.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP038.py.snap index 098c753706..5d5603509e 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP038.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP038.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - IsinstanceWithTuple: - kind: Isinstance + name: IsinstanceWithTuple + body: "Use `X | Y` in `isinstance` call instead of `(X, Y)`" + commit: "Convert to `X | Y`" + fixable: true location: row: 1 column: 0 @@ -21,8 +23,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - IsinstanceWithTuple: - kind: Issubclass + name: IsinstanceWithTuple + body: "Use `X | Y` in `issubclass` call instead of `(X, Y)`" + commit: "Convert to `X | Y`" + fixable: true location: row: 2 column: 0 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__datetime_utc_alias_py311.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__datetime_utc_alias_py311.snap index 2c66d3090a..079fe0afed 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__datetime_utc_alias_py311.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__datetime_utc_alias_py311.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - DatetimeTimezoneUTC: - straight_import: false + name: DatetimeTimezoneUTC + body: "Use `datetime.UTC` alias" + commit: ~ + fixable: false location: row: 7 column: 6 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DatetimeTimezoneUTC: - straight_import: false + name: DatetimeTimezoneUTC + body: "Use `datetime.UTC` alias" + commit: ~ + fixable: false location: row: 8 column: 6 @@ -25,8 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - DatetimeTimezoneUTC: - straight_import: true + name: DatetimeTimezoneUTC + body: "Use `datetime.UTC` alias" + commit: "Convert to `datetime.UTC` alias" + fixable: true location: row: 10 column: 6 @@ -43,8 +49,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - DatetimeTimezoneUTC: - straight_import: false + name: DatetimeTimezoneUTC + body: "Use `datetime.UTC` alias" + commit: ~ + fixable: false location: row: 11 column: 6 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_p37.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_p37.snap index b5e74afafb..c6bcac13db 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_p37.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_p37.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - DeprecatedCollectionType: - name: List + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + commit: "Replace `List` with `list`" + fixable: true location: row: 34 column: 17 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap index d4b5397212..4a66e21b89 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - DeprecatedCollectionType: - name: List + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + commit: "Replace `List` with `list`" + fixable: true location: row: 34 column: 17 @@ -21,8 +23,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - DeprecatedCollectionType: - name: List + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + commit: "Replace `List` with `list`" + fixable: true location: row: 35 column: 8 @@ -39,8 +43,10 @@ expression: diagnostics column: 12 parent: ~ - kind: - DeprecatedCollectionType: - name: List + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + commit: "Replace `List` with `list`" + fixable: true location: row: 42 column: 26 @@ -57,8 +63,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - DeprecatedCollectionType: - name: List + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + commit: "Replace `List` with `list`" + fixable: true location: row: 42 column: 37 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap index 0250b3c4bd..782f04f0a9 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - TypingUnion: ~ + name: TypingUnion + body: "Use `X | Y` for type annotations" + commit: "Convert to `X | Y`" + fixable: true location: row: 40 column: 3 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap index fd253d6a64..94c765e693 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- - kind: - TypingUnion: ~ + name: TypingUnion + body: "Use `X | Y` for type annotations" + commit: "Convert to `X | Y`" + fixable: true location: row: 40 column: 3 @@ -20,7 +23,10 @@ expression: diagnostics column: 16 parent: ~ - kind: - TypingUnion: ~ + name: TypingUnion + body: "Use `X | Y` for type annotations" + commit: "Convert to `X | Y`" + fixable: true location: row: 42 column: 20 diff --git a/crates/ruff/src/rules/ruff/rules/ambiguous_unicode_character.rs b/crates/ruff/src/rules/ruff/rules/ambiguous_unicode_character.rs index e3e5330e9f..1d2ed95c7d 100644 --- a/crates/ruff/src/rules/ruff/rules/ambiguous_unicode_character.rs +++ b/crates/ruff/src/rules/ruff/rules/ambiguous_unicode_character.rs @@ -7,7 +7,7 @@ use ruff_python_ast::types::Range; use crate::fix::Fix; use crate::message::Location; -use crate::registry::{Diagnostic, DiagnosticKind}; +use crate::registry::{AsRule, Diagnostic, DiagnosticKind}; use crate::rules::ruff::rules::Context; use crate::settings::{flags, Settings}; use crate::violation::AlwaysAutofixableViolation; diff --git a/crates/ruff/src/rules/ruff/rules/unpack_instead_of_concatenating_to_collection_literal.rs b/crates/ruff/src/rules/ruff/rules/unpack_instead_of_concatenating_to_collection_literal.rs index 7b39df6a33..31ecf6e2fd 100644 --- a/crates/ruff/src/rules/ruff/rules/unpack_instead_of_concatenating_to_collection_literal.rs +++ b/crates/ruff/src/rules/ruff/rules/unpack_instead_of_concatenating_to_collection_literal.rs @@ -6,7 +6,7 @@ use ruff_python_ast::types::Range; use crate::checkers::ast::Checker; use crate::fix::Fix; -use crate::registry::Diagnostic; +use crate::registry::{AsRule, Diagnostic}; use crate::violation::{AutofixKind, Availability, Violation}; #[violation] diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF005_RUF005.py.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF005_RUF005.py.snap index 88f222f6a6..470fd07156 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF005_RUF005.py.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF005_RUF005.py.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- - kind: - UnpackInsteadOfConcatenatingToCollectionLiteral: - expr: "[1, 2, 3, *foo]" - fixable: true + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `[1, 2, 3, *foo]` instead of concatenation" + commit: "Replace with `[1, 2, 3, *foo]`" + fixable: true location: row: 10 column: 6 @@ -22,9 +23,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - UnpackInsteadOfConcatenatingToCollectionLiteral: - expr: "(7, 8, 9, *zoob)" - fixable: true + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `(7, 8, 9, *zoob)` instead of concatenation" + commit: "Replace with `(7, 8, 9, *zoob)`" + fixable: true location: row: 12 column: 7 @@ -41,9 +43,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - UnpackInsteadOfConcatenatingToCollectionLiteral: - expr: "(*quux, 10, 11, 12)" - fixable: true + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `(*quux, 10, 11, 12)` instead of concatenation" + commit: "Replace with `(*quux, 10, 11, 12)`" + fixable: true location: row: 13 column: 7 @@ -60,9 +63,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - UnpackInsteadOfConcatenatingToCollectionLiteral: - expr: "[*spom, 13, 14, 15]" - fixable: true + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `[*spom, 13, 14, 15]` instead of concatenation" + commit: "Replace with `[*spom, 13, 14, 15]`" + fixable: true location: row: 15 column: 7 @@ -79,9 +83,10 @@ expression: diagnostics column: 26 parent: ~ - kind: - UnpackInsteadOfConcatenatingToCollectionLiteral: - expr: "(\"we all say\", *yay())" - fixable: true + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `(\"we all say\", *yay())` instead of concatenation" + commit: "Replace with `(\"we all say\", *yay())`" + fixable: true location: row: 16 column: 12 @@ -98,9 +103,10 @@ expression: diagnostics column: 36 parent: ~ - kind: - UnpackInsteadOfConcatenatingToCollectionLiteral: - expr: "(\"we all think\", *Fun().yay())" - fixable: true + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `(\"we all think\", *Fun().yay())` instead of concatenation" + commit: "Replace with `(\"we all think\", *Fun().yay())`" + fixable: true location: row: 17 column: 13 @@ -117,9 +123,10 @@ expression: diagnostics column: 45 parent: ~ - kind: - UnpackInsteadOfConcatenatingToCollectionLiteral: - expr: "(\"we all feel\", *Fun.words)" - fixable: true + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `(\"we all feel\", *Fun.words)` instead of concatenation" + commit: "Replace with `(\"we all feel\", *Fun.words)`" + fixable: true location: row: 18 column: 15 @@ -136,9 +143,10 @@ expression: diagnostics column: 44 parent: ~ - kind: - UnpackInsteadOfConcatenatingToCollectionLiteral: - expr: "[\"a\", \"b\", \"c\", *eggs]" - fixable: true + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `[\"a\", \"b\", \"c\", *eggs]` instead of concatenation" + commit: "Replace with `[\"a\", \"b\", \"c\", *eggs]`" + fixable: true location: row: 20 column: 8 @@ -155,9 +163,10 @@ expression: diagnostics column: 30 parent: ~ - kind: - UnpackInsteadOfConcatenatingToCollectionLiteral: - expr: "(\"yes\", \"no\", \"pants\", *zoob)" - fixable: true + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `(\"yes\", \"no\", \"pants\", *zoob)` instead of concatenation" + commit: "Replace with `(\"yes\", \"no\", \"pants\", *zoob)`" + fixable: true location: row: 20 column: 38 @@ -174,9 +183,10 @@ expression: diagnostics column: 67 parent: ~ - kind: - UnpackInsteadOfConcatenatingToCollectionLiteral: - expr: "(*zoob,)" - fixable: true + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `(*zoob,)` instead of concatenation" + commit: "Replace with `(*zoob,)`" + fixable: true location: row: 22 column: 6 @@ -193,9 +203,10 @@ expression: diagnostics column: 15 parent: ~ - kind: - UnpackInsteadOfConcatenatingToCollectionLiteral: - expr: "[*first, 4, 5, 6]" - fixable: false + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `[*first, 4, 5, 6]` instead of concatenation" + commit: ~ + fixable: false location: row: 32 column: 9 @@ -205,9 +216,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnpackInsteadOfConcatenatingToCollectionLiteral: - expr: "[*foo]" - fixable: true + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `[*foo]` instead of concatenation" + commit: "Replace with `[*foo]`" + fixable: true location: row: 41 column: 0 @@ -224,9 +236,10 @@ expression: diagnostics column: 8 parent: ~ - kind: - UnpackInsteadOfConcatenatingToCollectionLiteral: - expr: "[*foo]" - fixable: true + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `[*foo]` instead of concatenation" + commit: "Replace with `[*foo]`" + fixable: true location: row: 44 column: 0 diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF006_RUF006.py.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF006_RUF006.py.snap index 84887db365..add7ca05b0 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF006_RUF006.py.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF006_RUF006.py.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- - kind: - AsyncioDanglingTask: - method: CreateTask + name: AsyncioDanglingTask + body: "Store a reference to the return value of `asyncio.create_task`" + commit: ~ + fixable: false location: row: 6 column: 4 @@ -14,8 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - AsyncioDanglingTask: - method: EnsureFuture + name: AsyncioDanglingTask + body: "Store a reference to the return value of `asyncio.ensure_future`" + commit: ~ + fixable: false location: row: 11 column: 4 diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__confusables.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__confusables.snap index 90a0e73578..94e4a8a403 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__confusables.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__confusables.snap @@ -3,9 +3,10 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- - kind: - AmbiguousUnicodeCharacterString: - confusable: 𝐁 - representant: B + name: AmbiguousUnicodeCharacterString + body: "String contains ambiguous unicode character `𝐁` (did you mean `B`?)" + commit: "Replace `𝐁` with `B`" + fixable: true location: row: 1 column: 5 @@ -22,9 +23,10 @@ expression: diagnostics column: 6 parent: ~ - kind: - AmbiguousUnicodeCharacterDocstring: - confusable: ) - representant: ) + name: AmbiguousUnicodeCharacterDocstring + body: "Docstring contains ambiguous unicode character `)` (did you mean `)`?)" + commit: "Replace `)` with `)`" + fixable: true location: row: 6 column: 55 @@ -41,9 +43,10 @@ expression: diagnostics column: 56 parent: ~ - kind: - AmbiguousUnicodeCharacterComment: - confusable: ᜵ - representant: / + name: AmbiguousUnicodeCharacterComment + body: "Comment contains ambiguous unicode character `᜵` (did you mean `/`?)" + commit: "Replace `᜵` with `/`" + fixable: true location: row: 7 column: 61 diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_0.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_0.snap index d83ac3c685..a4da72f0a0 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_0.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_0.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- - kind: - UnusedNOQA: - codes: ~ + name: UnusedNOQA + body: "Unused blanket `noqa` directive" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 9 column: 11 @@ -21,12 +23,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - UnusedNOQA: - codes: - unknown: [] - disabled: [] - unmatched: - - E501 + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `E501`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 13 column: 11 @@ -43,13 +43,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - UnusedNOQA: - codes: - unknown: [] - disabled: [] - unmatched: - - F841 - - E501 + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F841`, `E501`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 16 column: 11 @@ -66,14 +63,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - UnusedNOQA: - codes: - unknown: [] - disabled: - - F821 - unmatched: - - F841 - - W191 + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F841`, `W191`; non-enabled: `F821`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 19 column: 11 @@ -90,13 +83,10 @@ expression: diagnostics column: 35 parent: ~ - kind: - UnusedNOQA: - codes: - unknown: - - V101 - disabled: [] - unmatched: - - F841 + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F841`; unknown: `V101`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 22 column: 11 @@ -113,12 +103,10 @@ expression: diagnostics column: 29 parent: ~ - kind: - UnusedNOQA: - codes: - unknown: [] - disabled: [] - unmatched: - - E501 + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `E501`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 26 column: 9 @@ -135,8 +123,10 @@ expression: diagnostics column: 21 parent: ~ - kind: - UnusedVariable: - name: d + name: UnusedVariable + body: "Local variable `d` is assigned to but never used" + commit: "Remove assignment to unused variable `d`" + fixable: true location: row: 29 column: 4 @@ -153,12 +143,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - UnusedNOQA: - codes: - unknown: [] - disabled: [] - unmatched: - - E501 + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `E501`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 29 column: 32 @@ -175,12 +163,10 @@ expression: diagnostics column: 44 parent: ~ - kind: - UnusedNOQA: - codes: - unknown: [] - disabled: [] - unmatched: - - F841 + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F841`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 55 column: 5 @@ -197,12 +183,10 @@ expression: diagnostics column: 23 parent: ~ - kind: - UnusedNOQA: - codes: - unknown: [] - disabled: [] - unmatched: - - E501 + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `E501`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 63 column: 5 @@ -219,8 +203,10 @@ expression: diagnostics column: 17 parent: ~ - kind: - UnusedNOQA: - codes: ~ + name: UnusedNOQA + body: "Unused blanket `noqa` directive" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 71 column: 5 @@ -237,10 +223,10 @@ expression: diagnostics column: 11 parent: ~ - kind: - UnusedImport: - name: shelve - ignore_init: false - multiple: false + name: UnusedImport + body: "`shelve` imported but unused" + commit: "Remove unused import: `shelve`" + fixable: true location: row: 85 column: 7 @@ -257,9 +243,10 @@ expression: diagnostics column: 0 parent: ~ - kind: - LineTooLong: - - 103 - - 88 + name: LineTooLong + body: Line too long (103 > 88 characters) + commit: ~ + fixable: false location: row: 90 column: 88 @@ -269,12 +256,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - UnusedNOQA: - codes: - unknown: [] - disabled: [] - unmatched: - - F401 + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F401`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 90 column: 91 diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_1.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_1.snap index a1e231f228..bd58773f65 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_1.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_1.snap @@ -3,10 +3,10 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- - kind: - UnusedImport: - name: typing.Union - ignore_init: false - multiple: false + name: UnusedImport + body: "`typing.Union` imported but unused" + commit: "Remove unused import: `typing.Union`" + fixable: true location: row: 37 column: 8 @@ -25,12 +25,10 @@ expression: diagnostics row: 35 column: 4 - kind: - UnusedNOQA: - codes: - unknown: [] - disabled: [] - unmatched: - - F401 + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F401`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 52 column: 19 @@ -47,12 +45,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - UnusedNOQA: - codes: - unknown: [] - disabled: [] - unmatched: - - F401 + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F401`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 59 column: 19 @@ -69,12 +65,10 @@ expression: diagnostics column: 31 parent: ~ - kind: - UnusedNOQA: - codes: - unknown: [] - disabled: - - F501 - unmatched: [] + name: UnusedNOQA + body: "Unused `noqa` directive (non-enabled: `F501`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 66 column: 15 @@ -91,12 +85,10 @@ expression: diagnostics column: 27 parent: ~ - kind: - UnusedNOQA: - codes: - unknown: [] - disabled: - - F501 - unmatched: [] + name: UnusedNOQA + body: "Unused `noqa` directive (non-enabled: `F501`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 72 column: 26 @@ -113,10 +105,10 @@ expression: diagnostics column: 38 parent: ~ - kind: - UnusedImport: - name: typing.Awaitable - ignore_init: false - multiple: true + name: UnusedImport + body: "`typing.Awaitable` imported but unused" + commit: Remove unused import + fixable: true location: row: 89 column: 23 @@ -133,10 +125,10 @@ expression: diagnostics column: 52 parent: ~ - kind: - UnusedImport: - name: typing.AwaitableGenerator - ignore_init: false - multiple: true + name: UnusedImport + body: "`typing.AwaitableGenerator` imported but unused" + commit: Remove unused import + fixable: true location: row: 89 column: 34 @@ -153,12 +145,10 @@ expression: diagnostics column: 52 parent: ~ - kind: - UnusedNOQA: - codes: - unknown: [] - disabled: - - F501 - unmatched: [] + name: UnusedNOQA + body: "Unused `noqa` directive (non-enabled: `F501`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 89 column: 54 diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_2.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_2.snap index 98310cce37..5d164ada2b 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_2.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_2.snap @@ -3,12 +3,10 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- - kind: - UnusedNOQA: - codes: - unknown: [] - disabled: [] - unmatched: - - F401 + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F401`)" + commit: "Remove unused `noqa` directive" + fixable: true location: row: 1 column: 18 diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_targeted_noqa.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_targeted_noqa.snap index 49786a6e1a..47f48a2119 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_targeted_noqa.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_targeted_noqa.snap @@ -3,8 +3,10 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- - kind: - UnusedVariable: - name: x + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + commit: "Remove assignment to unused variable `x`" + fixable: true location: row: 8 column: 4 diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap index 99cf19c4a9..ed5e7e7e92 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/tryceratops/mod.rs +source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- - kind: - ErrorInsteadOfException: ~ + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + commit: ~ + fixable: false location: row: 15 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ErrorInsteadOfException: ~ + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + commit: ~ + fixable: false location: row: 18 column: 12 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ErrorInsteadOfException: ~ + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + commit: ~ + fixable: false location: row: 25 column: 8 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ErrorInsteadOfException: ~ + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + commit: ~ + fixable: false location: row: 28 column: 12 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ErrorInsteadOfException: ~ + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + commit: ~ + fixable: false location: row: 35 column: 8 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ErrorInsteadOfException: ~ + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + commit: ~ + fixable: false location: row: 38 column: 12 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ErrorInsteadOfException: ~ + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + commit: ~ + fixable: false location: row: 45 column: 8 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ErrorInsteadOfException: ~ + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + commit: ~ + fixable: false location: row: 48 column: 12 diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__prefer-type-error_TRY004.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__prefer-type-error_TRY004.py.snap index d63cfd6475..d0b0bf6e0d 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__prefer-type-error_TRY004.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__prefer-type-error_TRY004.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 12 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 19 column: 8 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 30 column: 8 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 37 column: 8 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 44 column: 8 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 51 column: 8 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 58 column: 8 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 65 column: 8 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 72 column: 8 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 79 column: 8 @@ -103,7 +133,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 86 column: 8 @@ -113,7 +146,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 95 column: 8 @@ -123,7 +159,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 104 column: 8 @@ -133,7 +172,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 111 column: 8 @@ -143,7 +185,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 118 column: 8 @@ -153,7 +198,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 125 column: 8 @@ -163,7 +211,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 132 column: 8 @@ -173,7 +224,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 139 column: 8 @@ -183,7 +237,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 146 column: 8 @@ -193,7 +250,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 153 column: 8 @@ -203,7 +263,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 160 column: 8 @@ -213,7 +276,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 167 column: 8 @@ -223,7 +289,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 174 column: 8 @@ -233,7 +302,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 181 column: 8 @@ -243,7 +315,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 188 column: 8 @@ -253,7 +328,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 195 column: 8 @@ -263,7 +341,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 202 column: 8 @@ -273,7 +354,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 209 column: 8 @@ -283,7 +367,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 216 column: 8 @@ -293,7 +380,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 223 column: 8 @@ -303,7 +393,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 230 column: 8 @@ -313,7 +406,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 267 column: 8 @@ -323,7 +419,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 277 column: 8 @@ -333,7 +432,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - PreferTypeError: ~ + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + commit: ~ + fixable: false location: row: 288 column: 8 diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap index 7a187531c3..9f6fd16fed 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/tryceratops/mod.rs +source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- - kind: - RaiseVanillaArgs: ~ + name: RaiseVanillaArgs + body: Avoid specifying long messages outside the exception class + commit: ~ + fixable: false location: row: 8 column: 14 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaiseVanillaArgs: ~ + name: RaiseVanillaArgs + body: Avoid specifying long messages outside the exception class + commit: ~ + fixable: false location: row: 34 column: 14 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaiseVanillaArgs: ~ + name: RaiseVanillaArgs + body: Avoid specifying long messages outside the exception class + commit: ~ + fixable: false location: row: 39 column: 14 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaiseVanillaArgs: ~ + name: RaiseVanillaArgs + body: Avoid specifying long messages outside the exception class + commit: ~ + fixable: false location: row: 44 column: 14 diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap index a5cbd7c9c3..44e22d7338 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/tryceratops/mod.rs +source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- - kind: - RaiseVanillaClass: ~ + name: RaiseVanillaClass + body: Create your own exception + commit: ~ + fixable: false location: row: 13 column: 14 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaiseVanillaClass: ~ + name: RaiseVanillaClass + body: Create your own exception + commit: ~ + fixable: false location: row: 17 column: 14 diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-within-try_TRY301.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-within-try_TRY301.py.snap index 36ef87ee14..025ea95f54 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-within-try_TRY301.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-within-try_TRY301.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- - kind: - RaiseWithinTry: ~ + name: RaiseWithinTry + body: "Abstract `raise` to an inner function" + commit: ~ + fixable: false location: row: 9 column: 12 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaiseWithinTry: ~ + name: RaiseWithinTry + body: "Abstract `raise` to an inner function" + commit: ~ + fixable: false location: row: 11 column: 8 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaiseWithinTry: ~ + name: RaiseWithinTry + body: "Abstract `raise` to an inner function" + commit: ~ + fixable: false location: row: 16 column: 16 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaiseWithinTry: ~ + name: RaiseWithinTry + body: "Abstract `raise` to an inner function" + commit: ~ + fixable: false location: row: 27 column: 12 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaiseWithinTry: ~ + name: RaiseWithinTry + body: "Abstract `raise` to an inner function" + commit: ~ + fixable: false location: row: 29 column: 8 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - RaiseWithinTry: ~ + name: RaiseWithinTry + body: "Abstract `raise` to an inner function" + commit: ~ + fixable: false location: row: 34 column: 16 diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__reraise-no-cause_TRY200.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__reraise-no-cause_TRY200.py.snap index 9a452955c6..5b77bfccc6 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__reraise-no-cause_TRY200.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__reraise-no-cause_TRY200.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/tryceratops/mod.rs +source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- - kind: - ReraiseNoCause: ~ + name: ReraiseNoCause + body: "Use `raise from` to specify exception cause" + commit: ~ + fixable: false location: row: 15 column: 8 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - ReraiseNoCause: ~ + name: ReraiseNoCause + body: "Use `raise from` to specify exception cause" + commit: ~ + fixable: false location: row: 23 column: 12 diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__try-consider-else_TRY300.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__try-consider-else_TRY300.py.snap index 07a6db2f9c..faf71c3d5e 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__try-consider-else_TRY300.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__try-consider-else_TRY300.py.snap @@ -1,9 +1,12 @@ --- -source: src/rules/tryceratops/mod.rs +source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- - kind: - TryConsiderElse: ~ + name: TryConsiderElse + body: "Consider moving this statement to an `else` block" + commit: ~ + fixable: false location: row: 20 column: 8 diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap index 6d5266790f..34464672d6 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- - kind: - VerboseLogMessage: ~ + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + commit: ~ + fixable: false location: row: 8 column: 44 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - VerboseLogMessage: ~ + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + commit: ~ + fixable: false location: row: 19 column: 52 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - VerboseLogMessage: ~ + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + commit: ~ + fixable: false location: row: 21 column: 44 @@ -33,7 +42,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - VerboseLogMessage: ~ + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + commit: ~ + fixable: false location: row: 21 column: 50 @@ -43,7 +55,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - VerboseLogMessage: ~ + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + commit: ~ + fixable: false location: row: 23 column: 44 @@ -53,7 +68,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - VerboseLogMessage: ~ + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + commit: ~ + fixable: false location: row: 24 column: 44 @@ -63,7 +81,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - VerboseLogMessage: ~ + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + commit: ~ + fixable: false location: row: 27 column: 48 @@ -73,7 +94,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - VerboseLogMessage: ~ + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + commit: ~ + fixable: false location: row: 39 column: 46 @@ -83,7 +107,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - VerboseLogMessage: ~ + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + commit: ~ + fixable: false location: row: 46 column: 52 @@ -93,7 +120,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - VerboseLogMessage: ~ + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + commit: ~ + fixable: false location: row: 53 column: 46 diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-raise_TRY201.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-raise_TRY201.py.snap index f230c296b6..cbe03c1bc2 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-raise_TRY201.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-raise_TRY201.py.snap @@ -3,7 +3,10 @@ source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- - kind: - VerboseRaise: ~ + name: VerboseRaise + body: "Use `raise` without specifying exception name" + commit: ~ + fixable: false location: row: 20 column: 14 @@ -13,7 +16,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - VerboseRaise: ~ + name: VerboseRaise + body: "Use `raise` without specifying exception name" + commit: ~ + fixable: false location: row: 63 column: 18 @@ -23,7 +29,10 @@ expression: diagnostics fix: ~ parent: ~ - kind: - VerboseRaise: ~ + name: VerboseRaise + body: "Use `raise` without specifying exception name" + commit: ~ + fixable: false location: row: 74 column: 22 diff --git a/crates/ruff/src/settings/mod.rs b/crates/ruff/src/settings/mod.rs index 8f9ae8246e..6a19f8faa2 100644 --- a/crates/ruff/src/settings/mod.rs +++ b/crates/ruff/src/settings/mod.rs @@ -372,7 +372,7 @@ impl From<&Configuration> for RuleTable { for rule in select_set { let fix = fixable_set.contains(&rule); - rules.enable(rule.clone(), fix); + rules.enable(rule, fix); } // If a docstring convention is specified, force-disable any incompatible error diff --git a/crates/ruff_cli/src/printer.rs b/crates/ruff_cli/src/printer.rs index 51eca8c9ff..df73b8ca37 100644 --- a/crates/ruff_cli/src/printer.rs +++ b/crates/ruff_cli/src/printer.rs @@ -8,6 +8,7 @@ use std::path::Path; use annotate_snippets::display_list::{DisplayList, FormatOptions}; use annotate_snippets::snippet::{Annotation, AnnotationType, Slice, Snippet, SourceAnnotation}; use anyhow::Result; +use bitflags::bitflags; use colored::control::SHOULD_COLORIZE; use colored::Colorize; use itertools::{iterate, Itertools}; @@ -15,12 +16,11 @@ use rustc_hash::FxHashMap; use serde::Serialize; use serde_json::json; -use bitflags::bitflags; use ruff::fs::relativize_path; use ruff::linter::FixTable; use ruff::logging::LogLevel; use ruff::message::{Location, Message}; -use ruff::registry::Rule; +use ruff::registry::{AsRule, Rule}; use ruff::settings::types::SerializationFormat; use ruff::{fix, notify_user}; @@ -37,7 +37,7 @@ bitflags! { #[derive(Serialize)] struct ExpandedFix<'a> { content: &'a str, - message: Option, + message: Option<&'a str>, location: &'a Location, end_location: &'a Location, } @@ -131,7 +131,7 @@ impl Printer { let num_fixable = diagnostics .messages .iter() - .filter(|message| message.kind.fixable()) + .filter(|message| message.kind.fixable) .count(); if num_fixable > 0 { writeln!( @@ -188,12 +188,12 @@ impl Printer { .iter() .map(|message| ExpandedMessage { code: message.kind.rule().into(), - message: message.kind.body(), + message: message.kind.body.clone(), fix: message.fix.as_ref().map(|fix| ExpandedFix { content: &fix.content, location: &fix.location, end_location: &fix.end_location, - message: message.kind.commit(), + message: message.kind.commit.as_deref(), }), location: message.location, end_location: message.end_location, @@ -215,12 +215,12 @@ impl Printer { .insert("package".to_string(), "org.ruff".to_string()); for message in messages { let mut status = TestCaseStatus::non_success(NonSuccessKind::Failure); - status.set_message(message.kind.body()); + status.set_message(message.kind.body.clone()); status.set_description(format!( "line {}, col {}, {}", message.location.row(), message.location.column(), - message.kind.body() + message.kind.body )); let mut case = TestCase::new( format!("org.ruff.{}", message.kind.rule().noqa_code()), @@ -316,7 +316,7 @@ impl Printer { message.location.column(), ":", message.kind.rule().noqa_code(), - message.kind.body(), + message.kind.body, ); writeln!( stdout, @@ -343,7 +343,7 @@ impl Printer { .iter() .map(|message| { json!({ - "description": format!("({}) {}", message.kind.rule().noqa_code(), message.kind.body()), + "description": format!("({}) {}", message.kind.rule().noqa_code(), message.kind.body), "severity": "major", "fingerprint": message.kind.rule().noqa_code().to_string(), "location": { @@ -369,7 +369,7 @@ impl Printer { relativize_path(Path::new(&message.filename)), message.location.row(), message.kind.rule().noqa_code(), - message.kind.body(), + message.kind.body, ); writeln!(stdout, "{label}")?; } @@ -386,7 +386,7 @@ impl Printer { message.location.row(), message.location.column(), message.kind.rule().noqa_code(), - message.kind.body(), + message.kind.body, )?; } } @@ -398,7 +398,7 @@ impl Printer { } pub fn write_statistics(&self, diagnostics: &Diagnostics) -> Result<()> { - let violations = diagnostics + let violations: Vec<&Rule> = diagnostics .messages .iter() .map(|message| message.kind.rule()) @@ -422,14 +422,14 @@ impl Printer { .messages .iter() .find(|message| message.kind.rule() == *rule) - .map(|message| message.kind.body()) + .map(|message| message.kind.body.clone()) .unwrap(), fixable: diagnostics .messages .iter() .find(|message| message.kind.rule() == *rule) .iter() - .any(|message| message.kind.fixable()), + .any(|message| message.kind.fixable), }) .collect::>(); @@ -552,20 +552,20 @@ struct CodeAndBody<'a>(&'a Message, fix::FixMode); impl Display for CodeAndBody<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - if show_fix_status(self.1) && self.0.kind.fixable() { + if show_fix_status(self.1) && self.0.kind.fixable { write!( f, "{code} {autofix}{body}", code = self.0.kind.rule().noqa_code().to_string().red().bold(), autofix = format_args!("[{}] ", "*".cyan()), - body = self.0.kind.body(), + body = self.0.kind.body, ) } else { write!( f, "{code} {body}", code = self.0.kind.rule().noqa_code().to_string().red().bold(), - body = self.0.kind.body(), + body = self.0.kind.body, ) } } @@ -597,7 +597,7 @@ fn print_message( ); writeln!(stdout, "{label}")?; if let Some(source) = &message.source { - let commit = message.kind.commit(); + let commit = message.kind.commit.clone(); let footer = if commit.is_some() { vec![Annotation { id: None, @@ -703,7 +703,7 @@ fn print_grouped_message( ); writeln!(stdout, "{label}")?; if let Some(source) = &message.source { - let commit = message.kind.commit(); + let commit = message.kind.commit.clone(); let footer = if commit.is_some() { vec![Annotation { id: None, diff --git a/crates/ruff_macros/src/register_rules.rs b/crates/ruff_macros/src/register_rules.rs index 4bc003d64e..7f4f775a6f 100644 --- a/crates/ruff_macros/src/register_rules.rs +++ b/crates/ruff_macros/src/register_rules.rs @@ -4,14 +4,10 @@ use syn::{Attribute, Ident, Path, Token}; pub fn register_rules(input: &Input) -> proc_macro2::TokenStream { let mut rule_variants = quote!(); - let mut diagnostic_kind_variants = quote!(); let mut rule_message_formats_match_arms = quote!(); let mut rule_autofixable_match_arms = quote!(); let mut rule_explanation_match_arms = quote!(); - let mut diagnostic_kind_code_match_arms = quote!(); - let mut diagnostic_kind_body_match_arms = quote!(); - let mut diagnostic_kind_fixable_match_arms = quote!(); - let mut diagnostic_kind_commit_match_arms = quote!(); + let mut from_impls_for_diagnostic_kind = quote!(); for (path, name, attr) in &input.entries { @@ -19,31 +15,16 @@ pub fn register_rules(input: &Input) -> proc_macro2::TokenStream { #(#attr)* #name, }); - diagnostic_kind_variants.extend(quote! {#(#attr)* #name(#path),}); - // Apply the `attrs` to each arm, like `[cfg(feature = "foo")]`. rule_message_formats_match_arms .extend(quote! {#(#attr)* Self::#name => <#path as Violation>::message_formats(),}); rule_autofixable_match_arms .extend(quote! {#(#attr)* Self::#name => <#path as Violation>::AUTOFIX,}); rule_explanation_match_arms.extend(quote! {#(#attr)* Self::#name => #path::explanation(),}); - diagnostic_kind_code_match_arms - .extend(quote! {#(#attr)* Self::#name(..) => &Rule::#name, }); - diagnostic_kind_body_match_arms - .extend(quote! {#(#attr)* Self::#name(x) => Violation::message(x), }); - diagnostic_kind_fixable_match_arms - .extend(quote! {#(#attr)* Self::#name(x) => x.autofix_title_formatter().is_some(),}); - diagnostic_kind_commit_match_arms.extend( - quote! {#(#attr)* Self::#name(x) => x.autofix_title_formatter().map(|f| f(x)), }, - ); - from_impls_for_diagnostic_kind.extend(quote! { - #(#attr)* - impl From<#path> for DiagnosticKind { - fn from(x: #path) -> Self { - DiagnosticKind::#name(x) - } - } - }); + + // Enable conversion from `DiagnosticKind` to `Rule`. + from_impls_for_diagnostic_kind + .extend(quote! {#(#attr)* stringify!(#name) => &Rule::#name,}); } quote! { @@ -63,47 +44,35 @@ pub fn register_rules(input: &Input) -> proc_macro2::TokenStream { #[strum(serialize_all = "kebab-case")] pub enum Rule { #rule_variants } - #[derive(AsRefStr, Debug, PartialEq, Eq, Serialize, Deserialize)] - pub enum DiagnosticKind { #diagnostic_kind_variants } - impl Rule { /// Returns the format strings used to report violations of this rule. pub fn message_formats(&self) -> &'static [&'static str] { match self { #rule_message_formats_match_arms } } + /// Returns the documentation for this rule. pub fn explanation(&self) -> Option<&'static str> { match self { #rule_explanation_match_arms } } + /// Returns the autofix status of this rule. pub fn autofixable(&self) -> Option { match self { #rule_autofixable_match_arms } } } - impl DiagnosticKind { - /// The rule of the diagnostic. - pub fn rule(&self) -> &'static Rule { - match self { #diagnostic_kind_code_match_arms } - } - - /// The body text for the diagnostic. - pub fn body(&self) -> String { - match self { #diagnostic_kind_body_match_arms } - } - - /// Whether the diagnostic is (potentially) fixable. - pub fn fixable(&self) -> bool { - match self { #diagnostic_kind_fixable_match_arms } - } - - /// The message used to describe the fix action for a given `DiagnosticKind`. - pub fn commit(&self) -> Option { - match self { #diagnostic_kind_commit_match_arms } - } + pub trait AsRule { + fn rule(&self) -> &'static Rule; } - #from_impls_for_diagnostic_kind + impl AsRule for DiagnosticKind { + fn rule(&self) -> &'static Rule { + match self.name.as_str() { + #from_impls_for_diagnostic_kind + _ => unreachable!("invalid rule name: {}", self.name), + } + } + } } } diff --git a/crates/ruff_macros/src/violation.rs b/crates/ruff_macros/src/violation.rs index 39b6602584..85b3117228 100644 --- a/crates/ruff_macros/src/violation.rs +++ b/crates/ruff_macros/src/violation.rs @@ -46,6 +46,19 @@ pub fn violation(violation: &ItemStruct) -> Result { quote! { #[derive(Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)] #violation + + impl From<#ident> for crate::registry::DiagnosticKind { + fn from(value: #ident) -> Self { + use crate::violation::Violation; + + Self { + body: Violation::message(&value), + fixable: value.autofix_title_formatter().is_some(), + commit: value.autofix_title_formatter().map(|f| f(&value)), + name: stringify!(#ident).to_string(), + } + } + } } } else { quote! { @@ -57,6 +70,19 @@ pub fn violation(violation: &ItemStruct) -> Result { Some(#explanation) } } + + impl From<#ident> for crate::registry::DiagnosticKind { + fn from(value: #ident) -> Self { + use crate::violation::Violation; + + Self { + body: Violation::message(&value), + fixable: value.autofix_title_formatter().is_some(), + commit: value.autofix_title_formatter().map(|f| f(&value)), + name: stringify!(#ident).to_string(), + } + } + } } }; Ok(violation)