diff --git a/src/autofix/fixer.rs b/src/autofix/fixer.rs index 8ad61cfc62..2bd84917d6 100644 --- a/src/autofix/fixer.rs +++ b/src/autofix/fixer.rs @@ -42,33 +42,34 @@ impl From for Mode { /// Auto-fix errors in a file, and write the fixed source code to disk. pub fn fix_file<'a>( - checks: &'a mut [Check], + checks: &'a [Check], locator: &'a SourceCodeLocator<'a>, -) -> Option> { +) -> Option<(Cow<'a, str>, usize)> { if checks.iter().all(|check| check.fix.is_none()) { return None; } Some(apply_fixes( - checks.iter_mut().filter_map(|check| check.fix.as_mut()), + checks.iter().filter_map(|check| check.fix.as_ref()), locator, )) } /// Apply a series of fixes. fn apply_fixes<'a>( - fixes: impl Iterator, + fixes: impl Iterator, locator: &'a SourceCodeLocator<'a>, -) -> Cow<'a, str> { +) -> (Cow<'a, str>, usize) { let mut output = RopeBuilder::new(); let mut last_pos: Location = Location::new(1, 0); let mut applied: BTreeSet<&Patch> = BTreeSet::default(); + let mut num_fixed: usize = 0; for fix in fixes.sorted_by_key(|fix| fix.patch.location) { // If we already applied an identical fix as part of another correction, skip // any re-application. if applied.contains(&fix.patch) { - fix.applied = true; + num_fixed += 1; continue; } @@ -91,14 +92,14 @@ fn apply_fixes<'a>( // Track that the fix was applied. last_pos = fix.patch.end_location; applied.insert(&fix.patch); - fix.applied = true; + num_fixed += 1; } // Add the remaining content. let slice = locator.slice_source_code_at(last_pos); output.append(&slice); - Cow::from(output.finish()) + (Cow::from(output.finish()), num_fixed) } #[cfg(test)] @@ -112,78 +113,84 @@ mod tests { #[test] fn empty_file() -> Result<()> { - let mut fixes = vec![]; - let locator = SourceCodeLocator::new(""); - let actual = apply_fixes(fixes.iter_mut(), &locator); - let expected = ""; - - assert_eq!(actual, expected); + let fixes = vec![]; + let locator = SourceCodeLocator::new(r#""#); + let (contents, fixed) = apply_fixes(fixes.iter(), &locator); + assert_eq!(contents, ""); + assert_eq!(fixed, 0); Ok(()) } #[test] fn apply_single_replacement() -> Result<()> { - let mut fixes = vec![Fix { + let fixes = vec![Fix { patch: Patch { content: "Bar".to_string(), location: Location::new(1, 8), end_location: Location::new(1, 14), }, - applied: false, }]; let locator = SourceCodeLocator::new( - "class A(object): - ... -", + r#" +class A(object): + ... +"# + .trim(), ); - let actual = apply_fixes(fixes.iter_mut(), &locator); - - let expected = "class A(Bar): - ... -"; - - assert_eq!(actual, expected); + let (contents, fixed) = apply_fixes(fixes.iter(), &locator); + assert_eq!( + contents, + r#" +class A(Bar): + ... +"# + .trim(), + ); + assert_eq!(fixed, 1); Ok(()) } #[test] fn apply_single_removal() -> Result<()> { - let mut fixes = vec![Fix { + let fixes = vec![Fix { patch: Patch { content: String::new(), location: Location::new(1, 7), end_location: Location::new(1, 15), }, - applied: false, }]; let locator = SourceCodeLocator::new( - "class A(object): - ... -", + r#" +class A(object): + ... +"# + .trim(), ); - let actual = apply_fixes(fixes.iter_mut(), &locator); - - let expected = "class A: - ... -"; - - assert_eq!(actual, expected); + let (contents, fixed) = apply_fixes(fixes.iter(), &locator); + assert_eq!( + contents, + r#" +class A: + ... +"# + .trim() + ); + assert_eq!(fixed, 1); Ok(()) } #[test] fn apply_double_removal() -> Result<()> { - let mut fixes = vec![ + let fixes = vec![ Fix { patch: Patch { content: String::new(), location: Location::new(1, 7), end_location: Location::new(1, 16), }, - applied: false, }, Fix { patch: Patch { @@ -191,35 +198,39 @@ mod tests { location: Location::new(1, 16), end_location: Location::new(1, 23), }, - applied: false, }, ]; let locator = SourceCodeLocator::new( - "class A(object, object): - ... -", + r#" +class A(object, object): + ... +"# + .trim(), ); - let actual = apply_fixes(fixes.iter_mut(), &locator); + let (contents, fixed) = apply_fixes(fixes.iter(), &locator); - let expected = "class A: - ... -"; - - assert_eq!(actual, expected); + assert_eq!( + contents, + r#" +class A: + ... +"# + .trim() + ); + assert_eq!(fixed, 2); Ok(()) } #[test] fn ignore_overlapping_fixes() -> Result<()> { - let mut fixes = vec![ + let fixes = vec![ Fix { patch: Patch { content: String::new(), location: Location::new(1, 7), end_location: Location::new(1, 15), }, - applied: false, }, Fix { patch: Patch { @@ -227,21 +238,25 @@ mod tests { location: Location::new(1, 9), end_location: Location::new(1, 11), }, - applied: false, }, ]; let locator = SourceCodeLocator::new( - "class A(object): + r#" +class A(object): ... -", +"# + .trim(), ); - let actual = apply_fixes(fixes.iter_mut(), &locator); - - let expected = "class A: + let (contents, fixed) = apply_fixes(fixes.iter(), &locator); + assert_eq!( + contents, + r#" +class A: ... -"; - - assert_eq!(actual, expected); +"# + .trim(), + ); + assert_eq!(fixed, 1); Ok(()) } diff --git a/src/autofix/mod.rs b/src/autofix/mod.rs index 2ba7e83825..f2e3c9dabc 100644 --- a/src/autofix/mod.rs +++ b/src/autofix/mod.rs @@ -14,7 +14,6 @@ pub struct Patch { #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Fix { pub patch: Patch, - pub applied: bool, } impl Fix { @@ -25,7 +24,6 @@ impl Fix { location: start, end_location: end, }, - applied: false, } } @@ -36,7 +34,6 @@ impl Fix { location: start, end_location: end, }, - applied: false, } } @@ -47,7 +44,6 @@ impl Fix { location: at, end_location: at, }, - applied: false, } } @@ -58,7 +54,6 @@ impl Fix { location, end_location: location, }, - applied: false, } } } diff --git a/src/isort/snapshots/ruff__isort__tests__add_newline_before_comments.py.snap b/src/isort/snapshots/ruff__isort__tests__add_newline_before_comments.py.snap index 93495d12c5..474fcdfe92 100644 --- a/src/isort/snapshots/ruff__isort__tests__add_newline_before_comments.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__add_newline_before_comments.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 8 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__combine_import_froms.py.snap b/src/isort/snapshots/ruff__isort__tests__combine_import_froms.py.snap index d68593a497..458a6f7470 100644 --- a/src/isort/snapshots/ruff__isort__tests__combine_import_froms.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__combine_import_froms.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 6 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__comments.py.snap b/src/isort/snapshots/ruff__isort__tests__comments.py.snap index e56af4adbe..2d8036b864 100644 --- a/src/isort/snapshots/ruff__isort__tests__comments.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__comments.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 26 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__deduplicate_imports.py.snap b/src/isort/snapshots/ruff__isort__tests__deduplicate_imports.py.snap index 15d6208421..36fcb14571 100644 --- a/src/isort/snapshots/ruff__isort__tests__deduplicate_imports.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__deduplicate_imports.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 5 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__fit_line_length.py.snap b/src/isort/snapshots/ruff__isort__tests__fit_line_length.py.snap index 6c72cc39c1..35aaea0979 100644 --- a/src/isort/snapshots/ruff__isort__tests__fit_line_length.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__fit_line_length.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 15 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__fit_line_length_comment.py.snap b/src/isort/snapshots/ruff__isort__tests__fit_line_length_comment.py.snap index 0951eafc18..f2ab51d8eb 100644 --- a/src/isort/snapshots/ruff__isort__tests__fit_line_length_comment.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__fit_line_length_comment.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 5 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__import_from_after_import.py.snap b/src/isort/snapshots/ruff__isort__tests__import_from_after_import.py.snap index 7b456e2bb5..0fb4338994 100644 --- a/src/isort/snapshots/ruff__isort__tests__import_from_after_import.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__import_from_after_import.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 3 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__leading_prefix.py.snap b/src/isort/snapshots/ruff__isort__tests__leading_prefix.py.snap index cdac8665fb..8c8018361a 100644 --- a/src/isort/snapshots/ruff__isort__tests__leading_prefix.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__leading_prefix.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 3 column: 0 - applied: false - kind: UnsortedImports location: row: 5 @@ -35,5 +34,4 @@ expression: checks end_location: row: 7 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__order_by_type.py.snap b/src/isort/snapshots/ruff__isort__tests__order_by_type.py.snap index b9e758c95b..8158447671 100644 --- a/src/isort/snapshots/ruff__isort__tests__order_by_type.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__order_by_type.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 13 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__order_relative_imports_by_level.py.snap b/src/isort/snapshots/ruff__isort__tests__order_relative_imports_by_level.py.snap index c993b16fe6..5933141162 100644 --- a/src/isort/snapshots/ruff__isort__tests__order_relative_imports_by_level.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__order_relative_imports_by_level.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 5 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__preserve_comment_order.py.snap b/src/isort/snapshots/ruff__isort__tests__preserve_comment_order.py.snap index 80f7d51d9c..7c2edf79d8 100644 --- a/src/isort/snapshots/ruff__isort__tests__preserve_comment_order.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__preserve_comment_order.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 12 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__preserve_indentation.py.snap b/src/isort/snapshots/ruff__isort__tests__preserve_indentation.py.snap index a8862db903..a018254d46 100644 --- a/src/isort/snapshots/ruff__isort__tests__preserve_indentation.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__preserve_indentation.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 4 column: 0 - applied: false - kind: UnsortedImports location: row: 5 @@ -35,5 +34,4 @@ expression: checks end_location: row: 7 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__reorder_within_section.py.snap b/src/isort/snapshots/ruff__isort__tests__reorder_within_section.py.snap index fa55fb28ea..0f8ae32347 100644 --- a/src/isort/snapshots/ruff__isort__tests__reorder_within_section.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__reorder_within_section.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 3 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__separate_first_party_imports.py.snap b/src/isort/snapshots/ruff__isort__tests__separate_first_party_imports.py.snap index 550de04b09..8d4e04497b 100644 --- a/src/isort/snapshots/ruff__isort__tests__separate_first_party_imports.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__separate_first_party_imports.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 6 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__separate_future_imports.py.snap b/src/isort/snapshots/ruff__isort__tests__separate_future_imports.py.snap index b6a38b733f..1555fc4e1a 100644 --- a/src/isort/snapshots/ruff__isort__tests__separate_future_imports.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__separate_future_imports.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 4 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__separate_local_folder_imports.py.snap b/src/isort/snapshots/ruff__isort__tests__separate_local_folder_imports.py.snap index 9653981217..2b4f929935 100644 --- a/src/isort/snapshots/ruff__isort__tests__separate_local_folder_imports.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__separate_local_folder_imports.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 5 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__separate_third_party_imports.py.snap b/src/isort/snapshots/ruff__isort__tests__separate_third_party_imports.py.snap index e9f90d64d0..f99dff2462 100644 --- a/src/isort/snapshots/ruff__isort__tests__separate_third_party_imports.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__separate_third_party_imports.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 5 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__skip.py.snap b/src/isort/snapshots/ruff__isort__tests__skip.py.snap index ab8c4e57b7..09d5a45538 100644 --- a/src/isort/snapshots/ruff__isort__tests__skip.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__skip.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 11 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__sort_similar_imports.py.snap b/src/isort/snapshots/ruff__isort__tests__sort_similar_imports.py.snap index d96b4c35f7..807fbb1fd9 100644 --- a/src/isort/snapshots/ruff__isort__tests__sort_similar_imports.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__sort_similar_imports.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 27 column: 0 - applied: false diff --git a/src/isort/snapshots/ruff__isort__tests__trailing_suffix.py.snap b/src/isort/snapshots/ruff__isort__tests__trailing_suffix.py.snap index c5384f748b..29cab896e7 100644 --- a/src/isort/snapshots/ruff__isort__tests__trailing_suffix.py.snap +++ b/src/isort/snapshots/ruff__isort__tests__trailing_suffix.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 3 column: 0 - applied: false - kind: UnsortedImports location: row: 5 @@ -35,5 +34,4 @@ expression: checks end_location: row: 7 column: 0 - applied: false diff --git a/src/lib.rs b/src/lib.rs index e85b30b32d..b1d4f17971 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,12 +4,13 @@ use std::path::Path; use anyhow::Result; use log::debug; +use rustpython_helpers::tokenize; use rustpython_parser::lexer::LexResult; use settings::{pyproject, Settings}; use crate::autofix::fixer::Mode; use crate::checks::Check; -use crate::linter::{check_path, tokenize}; +use crate::linter::check_path; use crate::settings::configuration::Configuration; use crate::source_code_locator::SourceCodeLocator; @@ -54,6 +55,7 @@ mod pyflakes; mod python; mod pyupgrade; mod rules; +mod rustpython_helpers; pub mod settings; pub mod source_code_locator; #[cfg(feature = "update-informer")] diff --git a/src/linter.rs b/src/linter.rs index 2cda8ad62b..93e64b7873 100644 --- a/src/linter.rs +++ b/src/linter.rs @@ -1,16 +1,13 @@ use std::fs::write; use std::io; use std::io::Write; +use std::ops::AddAssign; use std::path::Path; use anyhow::Result; #[cfg(not(target_family = "wasm"))] use log::debug; -use rustpython_ast::{Mod, Suite}; -use rustpython_parser::error::ParseError; use rustpython_parser::lexer::LexResult; -use rustpython_parser::parser::Mode; -use rustpython_parser::{lexer, parser}; use crate::ast::types::Range; use crate::autofix::fixer; @@ -26,32 +23,29 @@ use crate::message::{Message, Source}; use crate::noqa::add_noqa; use crate::settings::Settings; use crate::source_code_locator::SourceCodeLocator; -use crate::{cache, directives, fs}; +use crate::{cache, directives, fs, rustpython_helpers}; -/// Collect tokens up to and including the first error. -pub(crate) fn tokenize(contents: &str) -> Vec { - let mut tokens: Vec = vec![]; - for tok in lexer::make_tokenizer(contents) { - let is_err = tok.is_err(); - tokens.push(tok); - if is_err { - break; - } +#[derive(Debug, Default)] +pub struct Diagnostics { + pub messages: Vec, + pub fixed: usize, +} + +impl Diagnostics { + pub fn new(messages: Vec) -> Self { + Self { messages, fixed: 0 } } - tokens } -/// Parse a full Python program from its tokens. -pub(crate) fn parse_program_tokens( - lxr: Vec, - source_path: &str, -) -> Result { - parser::parse_tokens(lxr, Mode::Module, source_path).map(|top| match top { - Mod::Module { body, .. } => body, - _ => unreachable!(), - }) +impl AddAssign for Diagnostics { + fn add_assign(&mut self, other: Self) { + self.messages.extend(other.messages); + self.fixed += other.fixed; + } } +/// Generate a list of `Check` violations from the source code contents at the +/// given `Path`. pub(crate) fn check_path( path: &Path, contents: &str, @@ -83,7 +77,7 @@ pub(crate) fn check_path( .iter() .any(|check_code| matches!(check_code.lint_source(), LintSource::Imports)); if use_ast || use_imports { - match parse_program_tokens(tokens, "") { + match rustpython_helpers::parse_program_tokens(tokens, "") { Ok(python_ast) => { if use_ast { checks.extend(check_ast(&python_ast, locator, settings, autofix, path)); @@ -135,132 +129,100 @@ pub(crate) fn check_path( Ok(checks) } -pub fn lint_stdin( - path: &Path, - stdin: &str, - settings: &Settings, - autofix: &fixer::Mode, -) -> Result> { - // Tokenize once. - let tokens: Vec = tokenize(stdin); - - // Initialize the SourceCodeLocator (which computes offsets lazily). - let locator = SourceCodeLocator::new(stdin); - - // Extract the `# noqa` and `# isort: skip` directives from the source. - let directives = directives::extract_directives( - &tokens, - &locator, - directives::Flags::from_settings(settings), - ); - - // Generate checks. - let mut checks = check_path( - path, - stdin, - tokens, - &locator, - &directives, - settings, - autofix, - )?; - - // Apply autofix, write results to stdout. - if matches!(autofix, fixer::Mode::Apply) { - match fix_file(&mut checks, &locator) { - None => io::stdout().write_all(stdin.as_bytes()), - Some(contents) => io::stdout().write_all(contents.as_bytes()), - }?; - } - - // Convert to messages. - Ok(checks - .into_iter() - .map(|check| { - let filename = path.to_string_lossy().to_string(); - let source = if settings.show_source { - Some(Source::from_check(&check, &locator)) - } else { - None - }; - Message::from_check(check, filename, source) - }) - .collect()) -} - +/// Lint the source code at the given `Path`. pub fn lint_path( path: &Path, settings: &Settings, mode: &cache::Mode, autofix: &fixer::Mode, -) -> Result> { +) -> Result { let metadata = path.metadata()?; // Check the cache. if let Some(messages) = cache::get(path, &metadata, settings, autofix, mode) { debug!("Cache hit for: {}", path.to_string_lossy()); - return Ok(messages); + return Ok(Diagnostics::new(messages)); } // Read the file from disk. - let contents = fs::read_file(path)?; + let mut contents = fs::read_file(path)?; - // Tokenize once. - let tokens: Vec = tokenize(&contents); + // Track the number of fixed errors across iterations. + let mut fixed = 0; - // Initialize the SourceCodeLocator (which computes offsets lazily). - let locator = SourceCodeLocator::new(&contents); + // Continuously autofix until the source code stabilizes. + let messages = loop { + // Tokenize once. + let tokens: Vec = rustpython_helpers::tokenize(&contents); - // Determine the noqa and isort exclusions. - let directives = directives::extract_directives( - &tokens, - &locator, - directives::Flags::from_settings(settings), - ); + // Initialize the SourceCodeLocator (which computes offsets lazily). + let locator = SourceCodeLocator::new(&contents); - // Generate checks. - let mut checks = check_path( - path, - &contents, - tokens, - &locator, - &directives, - settings, - autofix, - )?; + // Determine the noqa and isort exclusions. + let directives = directives::extract_directives( + &tokens, + &locator, + directives::Flags::from_settings(settings), + ); - // Apply autofix. - if matches!(autofix, fixer::Mode::Apply) { - if let Some(fixed_contents) = fix_file(&mut checks, &locator) { - write(path, fixed_contents.as_ref())?; + // Generate checks. + let checks = check_path( + path, + &contents, + tokens, + &locator, + &directives, + settings, + autofix, + )?; + + // Apply autofix. + if matches!(autofix, fixer::Mode::Apply) { + if let Some((fixed_contents, applied)) = fix_file(&checks, &locator) { + // Count the number of fixed errors. + fixed += applied; + + // Store the fixed contents. + contents = fixed_contents.to_string(); + + // Re-run the linter pass (by avoiding the break). + continue; + } } + + // Convert to messages. + let filename = path.to_string_lossy().to_string(); + break checks + .into_iter() + .map(|check| { + let source = if settings.show_source { + Some(Source::from_check(&check, &locator)) + } else { + None + }; + Message::from_check(check, filename.clone(), source) + }) + .collect::>(); }; - // Convert to messages. - let messages: Vec = checks - .into_iter() - .map(|check| { - let filename = path.to_string_lossy().to_string(); - let source = if settings.show_source { - Some(Source::from_check(&check, &locator)) - } else { - None - }; - Message::from_check(check, filename, source) - }) - .collect(); - + // Re-populate the cache. cache::set(path, &metadata, settings, autofix, &messages, mode); - Ok(messages) + // If we applied any fixes, write the contents back to disk. + if fixed > 0 { + write(path, &contents)?; + } + + Ok(Diagnostics { messages, fixed }) } +/// Add any missing `#noqa` pragmas to the source code at the given `Path`. pub fn add_noqa_to_path(path: &Path, settings: &Settings) -> Result { // Read the file from disk. let contents = fs::read_file(path)?; // Tokenize once. - let tokens: Vec = tokenize(&contents); + let tokens: Vec = rustpython_helpers::tokenize(&contents); // Initialize the SourceCodeLocator (which computes offsets lazily). let locator = SourceCodeLocator::new(&contents); @@ -286,15 +248,16 @@ pub fn add_noqa_to_path(path: &Path, settings: &Settings) -> Result { add_noqa(&checks, &contents, &directives.noqa_line_for, path) } +/// Apply autoformatting to the source code at the given `Path`. pub fn autoformat_path(path: &Path) -> Result<()> { // Read the file from disk. let contents = fs::read_file(path)?; // Tokenize once. - let tokens: Vec = tokenize(&contents); + let tokens: Vec = rustpython_helpers::tokenize(&contents); // Generate the AST. - let python_ast = parse_program_tokens(tokens, "")?; + let python_ast = rustpython_helpers::parse_program_tokens(tokens, "")?; let mut generator = SourceGenerator::default(); generator.unparse_suite(&python_ast)?; write(path, generator.generate()?)?; @@ -302,10 +265,86 @@ pub fn autoformat_path(path: &Path) -> Result<()> { Ok(()) } +/// Generate a list of `Check` violations from source code content derived from +/// stdin. +pub fn lint_stdin( + path: &Path, + stdin: &str, + settings: &Settings, + autofix: &fixer::Mode, +) -> Result { + // Read the file from disk. + let mut contents = stdin.to_string(); + + // Track the number of fixed errors across iterations. + let mut fixed = 0; + + let messages = loop { + // Tokenize once. + let tokens: Vec = rustpython_helpers::tokenize(&contents); + + // Initialize the SourceCodeLocator (which computes offsets lazily). + let locator = SourceCodeLocator::new(&contents); + + // Extract the `# noqa` and `# isort: skip` directives from the source. + let directives = directives::extract_directives( + &tokens, + &locator, + directives::Flags::from_settings(settings), + ); + + // Generate checks. + let checks = check_path( + path, + &contents, + tokens, + &locator, + &directives, + settings, + autofix, + )?; + + // Apply autofix. + if matches!(autofix, fixer::Mode::Apply) { + if let Some((fixed_contents, applied)) = fix_file(&checks, &locator) { + // Count the number of fixed errors. + fixed += applied; + + // Store the fixed contents. + contents = fixed_contents.to_string(); + + // Re-run the linter pass (by avoiding the break). + continue; + } + } + + // Convert to messages. + let filename = path.to_string_lossy().to_string(); + break checks + .into_iter() + .map(|check| { + let source = if settings.show_source { + Some(Source::from_check(&check, &locator)) + } else { + None + }; + Message::from_check(check, filename.clone(), source) + }) + .collect(); + }; + + // Write the fixed contents to stdout. + if matches!(autofix, fixer::Mode::Apply) { + io::stdout().write_all(contents.as_bytes())?; + } + + Ok(Diagnostics { messages, fixed }) +} + #[cfg(test)] pub fn test_path(path: &Path, settings: &Settings, autofix: &fixer::Mode) -> Result> { let contents = fs::read_file(path)?; - let tokens: Vec = tokenize(&contents); + let tokens: Vec = rustpython_helpers::tokenize(&contents); let locator = SourceCodeLocator::new(&contents); let directives = directives::extract_directives( &tokens, diff --git a/src/main.rs b/src/main.rs index 2d2359e7b4..39458d66b4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,7 @@ use log::{debug, error}; use notify::{raw_watcher, RecursiveMode, Watcher}; #[cfg(not(target_family = "wasm"))] use rayon::prelude::*; +use ruff::linter::Diagnostics; use rustpython_ast::Location; use walkdir::DirEntry; @@ -71,11 +72,11 @@ fn read_from_stdin() -> Result { Ok(buffer) } -fn run_once_stdin(settings: &Settings, filename: &Path, autofix: bool) -> Result> { +fn run_once_stdin(settings: &Settings, filename: &Path, autofix: bool) -> Result { let stdin = read_from_stdin()?; - let mut messages = lint_stdin(filename, &stdin, settings, &autofix.into())?; - messages.sort_unstable(); - Ok(messages) + let mut diagnostics = lint_stdin(filename, &stdin, settings, &autofix.into())?; + diagnostics.messages.sort_unstable(); + Ok(diagnostics) } fn run_once( @@ -83,7 +84,7 @@ fn run_once( settings: &Settings, cache: bool, autofix: bool, -) -> Result> { +) -> Result { // Collect all the files to check. let start = Instant::now(); let paths: Vec> = files @@ -94,7 +95,7 @@ fn run_once( debug!("Identified files to lint in: {:?}", duration); let start = Instant::now(); - let mut messages: Vec = par_iter(&paths) + let mut diagnostics: Diagnostics = par_iter(&paths) .map(|entry| { match entry { Ok(entry) => { @@ -111,32 +112,33 @@ fn run_once( .unwrap_or_else(|(path, message)| { if let Some(path) = path { if settings.enabled.contains(&CheckCode::E902) { - vec![Message { + Diagnostics::new(vec![Message { kind: CheckKind::IOError(message), - fixed: false, location: Location::default(), end_location: Location::default(), filename: path.to_string_lossy().to_string(), source: None, - }] + }]) } else { error!("Failed to check {}: {message}", path.to_string_lossy()); - vec![] + Diagnostics::default() } } else { error!("{message}"); - vec![] + Diagnostics::default() } }) }) - .flatten() - .collect(); + .reduce(Diagnostics::default, |mut acc, item| { + acc += item; + acc + }); - messages.sort_unstable(); + diagnostics.messages.sort_unstable(); let duration = start.elapsed(); debug!("Checked files in: {:?}", duration); - Ok(messages) + Ok(diagnostics) } fn add_noqa(files: &[PathBuf], settings: &Settings) -> Result { @@ -363,7 +365,7 @@ fn inner_main() -> Result { let is_stdin = cli.files == vec![PathBuf::from("-")]; // Generate lint violations. - let messages = if is_stdin { + let diagnostics = if is_stdin { let filename = cli.stdin_filename.unwrap_or_else(|| "-".to_string()); let path = Path::new(&filename); run_once_stdin(&settings, path, fix_enabled)? @@ -375,7 +377,7 @@ fn inner_main() -> Result { // unless we're writing fixes via stdin (in which case, the transformed // source code goes to stdout). if !(is_stdin && fix_enabled) { - printer.write_once(&messages)?; + printer.write_once(&diagnostics)?; } // Check for updates if we're in a non-silent log level. @@ -384,7 +386,7 @@ fn inner_main() -> Result { drop(updates::check_for_updates()); } - if messages.iter().any(|message| !message.fixed) && !cli.exit_zero { + if !diagnostics.messages.is_empty() && !cli.exit_zero { return Ok(ExitCode::FAILURE); } } diff --git a/src/message.rs b/src/message.rs index 132b32442e..e2f6275559 100644 --- a/src/message.rs +++ b/src/message.rs @@ -16,7 +16,6 @@ use crate::source_code_locator::SourceCodeLocator; #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Message { pub kind: CheckKind, - pub fixed: bool, pub location: Location, pub end_location: Location, pub filename: String, @@ -27,7 +26,6 @@ impl Message { pub fn from_check(check: Check, filename: String, source: Option) -> Self { Self { kind: check.kind, - fixed: check.fix.map(|fix| fix.applied).unwrap_or_default(), location: Location::new(check.location.row(), check.location.column() + 1), end_location: Location::new(check.end_location.row(), check.end_location.column() + 1), filename, diff --git a/src/printer.rs b/src/printer.rs index 9e1f690919..54c76f3296 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -5,8 +5,8 @@ use rustpython_parser::ast::Location; use serde::Serialize; use crate::checks::{CheckCode, CheckKind}; +use crate::linter::Diagnostics; use crate::logging::LogLevel; -use crate::message::Message; use crate::tell_user; #[derive(Clone, Copy, ValueEnum, PartialEq, Eq, Debug)] @@ -20,10 +20,9 @@ struct ExpandedMessage<'a> { kind: &'a CheckKind, code: &'a CheckCode, message: String, - fixed: bool, location: Location, end_location: Location, - filename: &'a String, + filename: &'a str, } pub struct Printer<'a> { @@ -42,14 +41,13 @@ impl<'a> Printer<'a> { } } - pub fn write_once(&self, messages: &[Message]) -> Result<()> { + pub fn write_once(&self, diagnostics: &Diagnostics) -> Result<()> { if matches!(self.log_level, LogLevel::Silent) { return Ok(()); } - let (fixed, outstanding): (Vec<&Message>, Vec<&Message>) = - messages.iter().partition(|message| message.fixed); - let num_fixable = outstanding + let num_fixable = diagnostics + .messages .iter() .filter(|message| message.kind.fixable()) .count(); @@ -59,13 +57,13 @@ impl<'a> Printer<'a> { println!( "{}", serde_json::to_string_pretty( - &messages + &diagnostics + .messages .iter() .map(|message| ExpandedMessage { kind: &message.kind, code: message.kind.code(), message: message.kind.body(), - fixed: message.fixed, location: message.location, end_location: message.end_location, filename: &message.filename, @@ -76,18 +74,18 @@ impl<'a> Printer<'a> { } SerializationFormat::Text => { if self.log_level >= &LogLevel::Default { - if !fixed.is_empty() { + if diagnostics.fixed > 0 { println!( "Found {} error(s) ({} fixed).", - outstanding.len(), - fixed.len() + diagnostics.messages.len(), + diagnostics.fixed, ) - } else if !outstanding.is_empty() { - println!("Found {} error(s).", outstanding.len()) + } else if !diagnostics.messages.is_empty() { + println!("Found {} error(s).", diagnostics.messages.len()) } } - for message in outstanding { + for message in &diagnostics.messages { println!("{message}") } @@ -102,7 +100,7 @@ impl<'a> Printer<'a> { Ok(()) } - pub fn write_continuously(&self, messages: &[Message]) -> Result<()> { + pub fn write_continuously(&self, diagnostics: &Diagnostics) -> Result<()> { if matches!(self.log_level, LogLevel::Silent) { return Ok(()); } @@ -110,15 +108,15 @@ impl<'a> Printer<'a> { if self.log_level >= &LogLevel::Default { tell_user!( "Found {} error(s). Watching for file changes.", - messages.len(), + diagnostics.messages.len() ); } - if !messages.is_empty() { + if !diagnostics.messages.is_empty() { if self.log_level >= &LogLevel::Default { println!(); } - for message in messages { + for message in &diagnostics.messages { println!("{message}") } } diff --git a/src/rustpython_helpers.rs b/src/rustpython_helpers.rs new file mode 100644 index 0000000000..38f3ee5392 --- /dev/null +++ b/src/rustpython_helpers.rs @@ -0,0 +1,29 @@ +use rustpython_ast::{Mod, Suite}; +use rustpython_parser::error::ParseError; +use rustpython_parser::lexer::LexResult; +use rustpython_parser::mode::Mode; +use rustpython_parser::{lexer, parser}; + +/// Collect tokens up to and including the first error. +pub(crate) fn tokenize(contents: &str) -> Vec { + let mut tokens: Vec = vec![]; + for tok in lexer::make_tokenizer(contents) { + let is_err = tok.is_err(); + tokens.push(tok); + if is_err { + break; + } + } + tokens +} + +/// Parse a full Python program from its tokens. +pub(crate) fn parse_program_tokens( + lxr: Vec, + source_path: &str, +) -> anyhow::Result { + parser::parse_tokens(lxr, Mode::Module, source_path).map(|top| match top { + Mod::Module { body, .. } => body, + _ => unreachable!(), + }) +} diff --git a/src/snapshots/ruff__linter__tests__B007_B007.py.snap b/src/snapshots/ruff__linter__tests__B007_B007.py.snap index de002b0a8b..fce08834d0 100644 --- a/src/snapshots/ruff__linter__tests__B007_B007.py.snap +++ b/src/snapshots/ruff__linter__tests__B007_B007.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 6 column: 5 - applied: false - kind: UnusedLoopControlVariable: k location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 18 column: 13 - applied: false - kind: UnusedLoopControlVariable: i location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 30 column: 5 - applied: false - kind: UnusedLoopControlVariable: k location: @@ -73,5 +70,4 @@ expression: checks end_location: row: 30 column: 13 - applied: false diff --git a/src/snapshots/ruff__linter__tests__B009_B009_B010.py.snap b/src/snapshots/ruff__linter__tests__B009_B009_B010.py.snap index 996013df3c..3b49ce9cca 100644 --- a/src/snapshots/ruff__linter__tests__B009_B009_B010.py.snap +++ b/src/snapshots/ruff__linter__tests__B009_B009_B010.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 18 column: 19 - applied: false - kind: GetAttrWithConstant location: row: 19 @@ -35,7 +34,6 @@ expression: checks end_location: row: 19 column: 23 - applied: false - kind: GetAttrWithConstant location: row: 20 @@ -52,7 +50,6 @@ expression: checks end_location: row: 20 column: 22 - applied: false - kind: GetAttrWithConstant location: row: 21 @@ -69,7 +66,6 @@ expression: checks end_location: row: 21 column: 23 - applied: false - kind: GetAttrWithConstant location: row: 22 @@ -86,5 +82,4 @@ expression: checks end_location: row: 22 column: 31 - applied: false diff --git a/src/snapshots/ruff__linter__tests__B010_B009_B010.py.snap b/src/snapshots/ruff__linter__tests__B010_B009_B010.py.snap index ba3711f49f..77aab517cf 100644 --- a/src/snapshots/ruff__linter__tests__B010_B009_B010.py.snap +++ b/src/snapshots/ruff__linter__tests__B010_B009_B010.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 33 column: 25 - applied: false - kind: SetAttrWithConstant location: row: 34 @@ -35,7 +34,6 @@ expression: checks end_location: row: 34 column: 29 - applied: false - kind: SetAttrWithConstant location: row: 35 @@ -52,7 +50,6 @@ expression: checks end_location: row: 35 column: 28 - applied: false - kind: SetAttrWithConstant location: row: 36 @@ -69,7 +66,6 @@ expression: checks end_location: row: 36 column: 29 - applied: false - kind: SetAttrWithConstant location: row: 37 @@ -86,5 +82,4 @@ expression: checks end_location: row: 37 column: 30 - applied: false diff --git a/src/snapshots/ruff__linter__tests__B011_B011.py.snap b/src/snapshots/ruff__linter__tests__B011_B011.py.snap index 60c81f5ee7..345d4ead78 100644 --- a/src/snapshots/ruff__linter__tests__B011_B011.py.snap +++ b/src/snapshots/ruff__linter__tests__B011_B011.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 8 column: 12 - applied: false - kind: DoNotAssertFalse location: row: 10 @@ -35,5 +34,4 @@ expression: checks end_location: row: 10 column: 23 - applied: false diff --git a/src/snapshots/ruff__linter__tests__B013_B013.py.snap b/src/snapshots/ruff__linter__tests__B013_B013.py.snap index c415644b58..74ee70f07d 100644 --- a/src/snapshots/ruff__linter__tests__B013_B013.py.snap +++ b/src/snapshots/ruff__linter__tests__B013_B013.py.snap @@ -19,5 +19,4 @@ expression: checks end_location: row: 3 column: 20 - applied: false diff --git a/src/snapshots/ruff__linter__tests__B014_B014.py.snap b/src/snapshots/ruff__linter__tests__B014_B014.py.snap index d77f131d9a..aca787fbbd 100644 --- a/src/snapshots/ruff__linter__tests__B014_B014.py.snap +++ b/src/snapshots/ruff__linter__tests__B014_B014.py.snap @@ -20,7 +20,6 @@ expression: checks end_location: row: 17 column: 24 - applied: false - kind: DuplicateHandlerException: - MyError @@ -39,7 +38,6 @@ expression: checks end_location: row: 28 column: 24 - applied: false - kind: DuplicateHandlerException: - re.error @@ -58,5 +56,4 @@ expression: checks end_location: row: 49 column: 26 - applied: false diff --git a/src/snapshots/ruff__linter__tests__C400_C400.py.snap b/src/snapshots/ruff__linter__tests__C400_C400.py.snap index 638eeebfea..3ee17658fd 100644 --- a/src/snapshots/ruff__linter__tests__C400_C400.py.snap +++ b/src/snapshots/ruff__linter__tests__C400_C400.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 1 column: 29 - applied: false - kind: UnnecessaryGeneratorList location: row: 2 @@ -35,5 +34,4 @@ expression: checks end_location: row: 4 column: 1 - applied: false diff --git a/src/snapshots/ruff__linter__tests__C401_C401.py.snap b/src/snapshots/ruff__linter__tests__C401_C401.py.snap index 63419cbb84..560cb1077a 100644 --- a/src/snapshots/ruff__linter__tests__C401_C401.py.snap +++ b/src/snapshots/ruff__linter__tests__C401_C401.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 1 column: 28 - applied: false - kind: UnnecessaryGeneratorSet location: row: 2 @@ -35,5 +34,4 @@ expression: checks end_location: row: 4 column: 1 - applied: false diff --git a/src/snapshots/ruff__linter__tests__C402_C402.py.snap b/src/snapshots/ruff__linter__tests__C402_C402.py.snap index f3a1e88a92..e44102a03a 100644 --- a/src/snapshots/ruff__linter__tests__C402_C402.py.snap +++ b/src/snapshots/ruff__linter__tests__C402_C402.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 1 column: 30 - applied: false - kind: UnnecessaryGeneratorDict location: row: 2 @@ -35,5 +34,4 @@ expression: checks end_location: row: 4 column: 1 - applied: false diff --git a/src/snapshots/ruff__linter__tests__C403_C403.py.snap b/src/snapshots/ruff__linter__tests__C403_C403.py.snap index c152e4d6c5..a624f32aef 100644 --- a/src/snapshots/ruff__linter__tests__C403_C403.py.snap +++ b/src/snapshots/ruff__linter__tests__C403_C403.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 1 column: 30 - applied: false - kind: UnnecessaryListComprehensionSet location: row: 2 @@ -35,5 +34,4 @@ expression: checks end_location: row: 4 column: 1 - applied: false diff --git a/src/snapshots/ruff__linter__tests__C404_C404.py.snap b/src/snapshots/ruff__linter__tests__C404_C404.py.snap index 7b0b0ff469..bf79c2754e 100644 --- a/src/snapshots/ruff__linter__tests__C404_C404.py.snap +++ b/src/snapshots/ruff__linter__tests__C404_C404.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 1 column: 32 - applied: false diff --git a/src/snapshots/ruff__linter__tests__C405_C405.py.snap b/src/snapshots/ruff__linter__tests__C405_C405.py.snap index 28e1f6624b..0b36737d50 100644 --- a/src/snapshots/ruff__linter__tests__C405_C405.py.snap +++ b/src/snapshots/ruff__linter__tests__C405_C405.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 1 column: 16 - applied: false - kind: UnnecessaryLiteralSet: tuple location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 2 column: 16 - applied: false - kind: UnnecessaryLiteralSet: list location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 3 column: 12 - applied: false - kind: UnnecessaryLiteralSet: tuple location: @@ -73,5 +70,4 @@ expression: checks end_location: row: 4 column: 12 - applied: false diff --git a/src/snapshots/ruff__linter__tests__C406_C406.py.snap b/src/snapshots/ruff__linter__tests__C406_C406.py.snap index 405d385735..8922567d36 100644 --- a/src/snapshots/ruff__linter__tests__C406_C406.py.snap +++ b/src/snapshots/ruff__linter__tests__C406_C406.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 1 column: 19 - applied: false - kind: UnnecessaryLiteralDict: tuple location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 2 column: 20 - applied: false - kind: UnnecessaryLiteralDict: list location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 3 column: 13 - applied: false - kind: UnnecessaryLiteralDict: tuple location: @@ -73,5 +70,4 @@ expression: checks end_location: row: 4 column: 13 - applied: false diff --git a/src/snapshots/ruff__linter__tests__C408_C408.py.snap b/src/snapshots/ruff__linter__tests__C408_C408.py.snap index 793800b9d8..5708cb7aa9 100644 --- a/src/snapshots/ruff__linter__tests__C408_C408.py.snap +++ b/src/snapshots/ruff__linter__tests__C408_C408.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 1 column: 11 - applied: false - kind: UnnecessaryCollectionCall: list location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 2 column: 10 - applied: false - kind: UnnecessaryCollectionCall: dict location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 3 column: 11 - applied: false - kind: UnnecessaryCollectionCall: dict location: @@ -73,5 +70,4 @@ expression: checks end_location: row: 4 column: 14 - applied: false diff --git a/src/snapshots/ruff__linter__tests__C409_C409.py.snap b/src/snapshots/ruff__linter__tests__C409_C409.py.snap index 3e7750b8f8..ba01e2050e 100644 --- a/src/snapshots/ruff__linter__tests__C409_C409.py.snap +++ b/src/snapshots/ruff__linter__tests__C409_C409.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 1 column: 14 - applied: false - kind: UnnecessaryLiteralWithinTupleCall: list location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 2 column: 18 - applied: false - kind: UnnecessaryLiteralWithinTupleCall: tuple location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 3 column: 18 - applied: false - kind: UnnecessaryLiteralWithinTupleCall: list location: @@ -73,7 +70,6 @@ expression: checks end_location: row: 7 column: 2 - applied: false - kind: UnnecessaryLiteralWithinTupleCall: tuple location: @@ -91,5 +87,4 @@ expression: checks end_location: row: 10 column: 1 - applied: false diff --git a/src/snapshots/ruff__linter__tests__C410_C410.py.snap b/src/snapshots/ruff__linter__tests__C410_C410.py.snap index 2fec80d2df..5672fab07f 100644 --- a/src/snapshots/ruff__linter__tests__C410_C410.py.snap +++ b/src/snapshots/ruff__linter__tests__C410_C410.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 1 column: 17 - applied: false - kind: UnnecessaryLiteralWithinListCall: tuple location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 2 column: 17 - applied: false - kind: UnnecessaryLiteralWithinListCall: list location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 3 column: 13 - applied: false - kind: UnnecessaryLiteralWithinListCall: tuple location: @@ -73,5 +70,4 @@ expression: checks end_location: row: 4 column: 13 - applied: false diff --git a/src/snapshots/ruff__linter__tests__C411_C411.py.snap b/src/snapshots/ruff__linter__tests__C411_C411.py.snap index 1f4e999005..e4dfa154ef 100644 --- a/src/snapshots/ruff__linter__tests__C411_C411.py.snap +++ b/src/snapshots/ruff__linter__tests__C411_C411.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 2 column: 20 - applied: false diff --git a/src/snapshots/ruff__linter__tests__C413_C413.py.snap b/src/snapshots/ruff__linter__tests__C413_C413.py.snap index df802b53e7..385ac80e86 100644 --- a/src/snapshots/ruff__linter__tests__C413_C413.py.snap +++ b/src/snapshots/ruff__linter__tests__C413_C413.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 3 column: 15 - applied: false - kind: UnnecessaryCallAroundSorted: reversed location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 4 column: 19 - applied: false - kind: UnnecessaryCallAroundSorted: reversed location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 5 column: 36 - applied: false - kind: UnnecessaryCallAroundSorted: reversed location: @@ -73,5 +70,4 @@ expression: checks end_location: row: 6 column: 33 - applied: false diff --git a/src/snapshots/ruff__linter__tests__C416_C416.py.snap b/src/snapshots/ruff__linter__tests__C416_C416.py.snap index 12866d5074..fd6e0c2179 100644 --- a/src/snapshots/ruff__linter__tests__C416_C416.py.snap +++ b/src/snapshots/ruff__linter__tests__C416_C416.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 2 column: 14 - applied: false - kind: UnnecessaryComprehension: set location: @@ -37,5 +36,4 @@ expression: checks end_location: row: 3 column: 14 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D201_D.py.snap b/src/snapshots/ruff__linter__tests__D201_D.py.snap index e238c21736..4afcf0c77a 100644 --- a/src/snapshots/ruff__linter__tests__D201_D.py.snap +++ b/src/snapshots/ruff__linter__tests__D201_D.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 132 column: 0 - applied: false - kind: NoBlankLineBeforeFunction: 1 location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 146 column: 0 - applied: false - kind: NoBlankLineBeforeFunction: 1 location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 541 column: 0 - applied: false - kind: NoBlankLineBeforeFunction: 1 location: @@ -73,5 +70,4 @@ expression: checks end_location: row: 563 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D202_D.py.snap b/src/snapshots/ruff__linter__tests__D202_D.py.snap index 1c7a625254..867693816e 100644 --- a/src/snapshots/ruff__linter__tests__D202_D.py.snap +++ b/src/snapshots/ruff__linter__tests__D202_D.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 139 column: 0 - applied: false - kind: NoBlankLineAfterFunction: 1 location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 148 column: 0 - applied: false - kind: NoBlankLineAfterFunction: 1 location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 555 column: 0 - applied: false - kind: NoBlankLineAfterFunction: 1 location: @@ -73,5 +70,4 @@ expression: checks end_location: row: 568 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D203_D.py.snap b/src/snapshots/ruff__linter__tests__D203_D.py.snap index b60a9fe851..17e3e8a6fb 100644 --- a/src/snapshots/ruff__linter__tests__D203_D.py.snap +++ b/src/snapshots/ruff__linter__tests__D203_D.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 156 column: 0 - applied: false - kind: OneBlankLineBeforeClass: 0 location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 187 column: 0 - applied: false - kind: OneBlankLineBeforeClass: 0 location: @@ -55,5 +53,4 @@ expression: checks end_location: row: 521 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D204_D.py.snap b/src/snapshots/ruff__linter__tests__D204_D.py.snap index 0d505704e5..24be1774e1 100644 --- a/src/snapshots/ruff__linter__tests__D204_D.py.snap +++ b/src/snapshots/ruff__linter__tests__D204_D.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 177 column: 0 - applied: false - kind: OneBlankLineAfterClass: 0 location: @@ -37,5 +36,4 @@ expression: checks end_location: row: 188 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D205_D.py.snap b/src/snapshots/ruff__linter__tests__D205_D.py.snap index 6bbb0f678a..537edbe1aa 100644 --- a/src/snapshots/ruff__linter__tests__D205_D.py.snap +++ b/src/snapshots/ruff__linter__tests__D205_D.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 196 column: 0 - applied: false - kind: BlankLineAfterSummary location: row: 205 @@ -35,5 +34,4 @@ expression: checks end_location: row: 208 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D207_D.py.snap b/src/snapshots/ruff__linter__tests__D207_D.py.snap index 34960c84c5..078d96277f 100644 --- a/src/snapshots/ruff__linter__tests__D207_D.py.snap +++ b/src/snapshots/ruff__linter__tests__D207_D.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 227 column: 0 - applied: false - kind: NoUnderIndentation location: row: 435 @@ -35,5 +34,4 @@ expression: checks end_location: row: 435 column: 4 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D208_D.py.snap b/src/snapshots/ruff__linter__tests__D208_D.py.snap index fb183bd6da..4e90b21bb4 100644 --- a/src/snapshots/ruff__linter__tests__D208_D.py.snap +++ b/src/snapshots/ruff__linter__tests__D208_D.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 247 column: 7 - applied: false - kind: NoOverIndentation location: row: 259 @@ -35,7 +34,6 @@ expression: checks end_location: row: 259 column: 8 - applied: false - kind: NoOverIndentation location: row: 267 @@ -52,5 +50,4 @@ expression: checks end_location: row: 267 column: 8 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D209_D.py.snap b/src/snapshots/ruff__linter__tests__D209_D.py.snap index fb3767f199..52be7a937a 100644 --- a/src/snapshots/ruff__linter__tests__D209_D.py.snap +++ b/src/snapshots/ruff__linter__tests__D209_D.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 278 column: 16 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D210_D.py.snap b/src/snapshots/ruff__linter__tests__D210_D.py.snap index c6a03853f4..c0ec45e0e1 100644 --- a/src/snapshots/ruff__linter__tests__D210_D.py.snap +++ b/src/snapshots/ruff__linter__tests__D210_D.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 283 column: 30 - applied: false - kind: NoSurroundingWhitespace location: row: 288 @@ -35,7 +34,6 @@ expression: checks end_location: row: 288 column: 34 - applied: false - kind: NoSurroundingWhitespace location: row: 294 @@ -52,5 +50,4 @@ expression: checks end_location: row: 294 column: 36 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D211_D.py.snap b/src/snapshots/ruff__linter__tests__D211_D.py.snap index bd1fc4d65e..29673c29f0 100644 --- a/src/snapshots/ruff__linter__tests__D211_D.py.snap +++ b/src/snapshots/ruff__linter__tests__D211_D.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 165 column: 0 - applied: false - kind: NoBlankLineBeforeClass: 1 location: @@ -37,5 +36,4 @@ expression: checks end_location: row: 176 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D214_sections.py.snap b/src/snapshots/ruff__linter__tests__D214_sections.py.snap index a7d67df3da..ab71989886 100644 --- a/src/snapshots/ruff__linter__tests__D214_sections.py.snap +++ b/src/snapshots/ruff__linter__tests__D214_sections.py.snap @@ -19,5 +19,4 @@ expression: checks end_location: row: 137 column: 8 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D215_sections.py.snap b/src/snapshots/ruff__linter__tests__D215_sections.py.snap index 5ac20c2309..bef9f8d336 100644 --- a/src/snapshots/ruff__linter__tests__D215_sections.py.snap +++ b/src/snapshots/ruff__linter__tests__D215_sections.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 150 column: 9 - applied: false - kind: SectionUnderlineNotOverIndented: Returns location: @@ -37,5 +36,4 @@ expression: checks end_location: row: 164 column: 9 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D405_sections.py.snap b/src/snapshots/ruff__linter__tests__D405_sections.py.snap index 48d27889a8..7165c4e1a3 100644 --- a/src/snapshots/ruff__linter__tests__D405_sections.py.snap +++ b/src/snapshots/ruff__linter__tests__D405_sections.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 19 column: 11 - applied: false - kind: CapitalizeSectionName: Short summary location: @@ -37,5 +36,4 @@ expression: checks end_location: row: 209 column: 17 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D406_sections.py.snap b/src/snapshots/ruff__linter__tests__D406_sections.py.snap index 13dee7f86f..d9718949ca 100644 --- a/src/snapshots/ruff__linter__tests__D406_sections.py.snap +++ b/src/snapshots/ruff__linter__tests__D406_sections.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 32 column: 12 - applied: false - kind: NewLineAfterSectionName: Raises location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 218 column: 11 - applied: false - kind: NewLineAfterSectionName: Returns location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 257 column: 12 - applied: false - kind: NewLineAfterSectionName: Raises location: @@ -73,5 +70,4 @@ expression: checks end_location: row: 259 column: 11 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D407_sections.py.snap b/src/snapshots/ruff__linter__tests__D407_sections.py.snap index 5280afeca4..a676edd231 100644 --- a/src/snapshots/ruff__linter__tests__D407_sections.py.snap +++ b/src/snapshots/ruff__linter__tests__D407_sections.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 45 column: 0 - applied: false - kind: DashedUnderlineAfterSection: Returns location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 57 column: 0 - applied: false - kind: DashedUnderlineAfterSection: Raises location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 219 column: 0 - applied: false - kind: DashedUnderlineAfterSection: Returns location: @@ -73,7 +70,6 @@ expression: checks end_location: row: 258 column: 0 - applied: false - kind: DashedUnderlineAfterSection: Raises location: @@ -91,7 +87,6 @@ expression: checks end_location: row: 260 column: 0 - applied: false - kind: DashedUnderlineAfterSection: Args location: @@ -109,7 +104,6 @@ expression: checks end_location: row: 272 column: 0 - applied: false - kind: DashedUnderlineAfterSection: Args location: @@ -127,7 +121,6 @@ expression: checks end_location: row: 289 column: 0 - applied: false - kind: DashedUnderlineAfterSection: Args location: @@ -145,7 +138,6 @@ expression: checks end_location: row: 304 column: 0 - applied: false - kind: DashedUnderlineAfterSection: Args location: @@ -163,7 +155,6 @@ expression: checks end_location: row: 316 column: 0 - applied: false - kind: DashedUnderlineAfterSection: Args location: @@ -181,7 +172,6 @@ expression: checks end_location: row: 328 column: 0 - applied: false - kind: DashedUnderlineAfterSection: Args location: @@ -199,7 +189,6 @@ expression: checks end_location: row: 340 column: 0 - applied: false - kind: DashedUnderlineAfterSection: Args location: @@ -217,7 +206,6 @@ expression: checks end_location: row: 353 column: 0 - applied: false - kind: DashedUnderlineAfterSection: Args location: @@ -235,7 +223,6 @@ expression: checks end_location: row: 365 column: 0 - applied: false - kind: DashedUnderlineAfterSection: Args location: @@ -253,7 +240,6 @@ expression: checks end_location: row: 374 column: 0 - applied: false - kind: DashedUnderlineAfterSection: Args location: @@ -271,5 +257,4 @@ expression: checks end_location: row: 495 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D408_sections.py.snap b/src/snapshots/ruff__linter__tests__D408_sections.py.snap index 0a121ae753..a2e69b17f1 100644 --- a/src/snapshots/ruff__linter__tests__D408_sections.py.snap +++ b/src/snapshots/ruff__linter__tests__D408_sections.py.snap @@ -19,5 +19,4 @@ expression: checks end_location: row: 89 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D409_sections.py.snap b/src/snapshots/ruff__linter__tests__D409_sections.py.snap index 5998f325a6..7cf22292b0 100644 --- a/src/snapshots/ruff__linter__tests__D409_sections.py.snap +++ b/src/snapshots/ruff__linter__tests__D409_sections.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 103 column: 0 - applied: false - kind: SectionUnderlineMatchesSectionLength: Returns location: @@ -37,5 +36,4 @@ expression: checks end_location: row: 217 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D410_sections.py.snap b/src/snapshots/ruff__linter__tests__D410_sections.py.snap index c28ce327ff..c63dcb7637 100644 --- a/src/snapshots/ruff__linter__tests__D410_sections.py.snap +++ b/src/snapshots/ruff__linter__tests__D410_sections.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 71 column: 0 - applied: false - kind: BlankLineAfterSection: Returns location: @@ -37,5 +36,4 @@ expression: checks end_location: row: 218 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D411_sections.py.snap b/src/snapshots/ruff__linter__tests__D411_sections.py.snap index 65e7914775..766a12cf70 100644 --- a/src/snapshots/ruff__linter__tests__D411_sections.py.snap +++ b/src/snapshots/ruff__linter__tests__D411_sections.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 71 column: 0 - applied: false - kind: BlankLineBeforeSection: Returns location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 125 column: 0 - applied: false - kind: BlankLineBeforeSection: Raises location: @@ -55,5 +53,4 @@ expression: checks end_location: row: 218 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__D412_sections.py.snap b/src/snapshots/ruff__linter__tests__D412_sections.py.snap index 8e7526f7d3..8f60dc7f98 100644 --- a/src/snapshots/ruff__linter__tests__D412_sections.py.snap +++ b/src/snapshots/ruff__linter__tests__D412_sections.py.snap @@ -19,5 +19,4 @@ expression: checks end_location: row: 212 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__E711_E711.py.snap b/src/snapshots/ruff__linter__tests__E711_E711.py.snap index e99a697425..bc1d75cc18 100644 --- a/src/snapshots/ruff__linter__tests__E711_E711.py.snap +++ b/src/snapshots/ruff__linter__tests__E711_E711.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 2 column: 14 - applied: false - kind: NoneComparison: NotEq location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 5 column: 14 - applied: false - kind: NoneComparison: Eq location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 8 column: 14 - applied: false - kind: NoneComparison: NotEq location: @@ -73,7 +70,6 @@ expression: checks end_location: row: 11 column: 14 - applied: false - kind: NoneComparison: Eq location: @@ -91,7 +87,6 @@ expression: checks end_location: row: 14 column: 17 - applied: false - kind: NoneComparison: NotEq location: @@ -109,7 +104,6 @@ expression: checks end_location: row: 17 column: 17 - applied: false - kind: NoneComparison: NotEq location: @@ -127,7 +121,6 @@ expression: checks end_location: row: 20 column: 17 - applied: false - kind: NoneComparison: Eq location: @@ -145,7 +138,6 @@ expression: checks end_location: row: 23 column: 17 - applied: false - kind: NoneComparison: Eq location: @@ -163,7 +155,6 @@ expression: checks end_location: row: 26 column: 3 - applied: false - kind: NoneComparison: NotEq location: @@ -181,5 +172,4 @@ expression: checks end_location: row: 26 column: 20 - applied: false diff --git a/src/snapshots/ruff__linter__tests__E712_E712.py.snap b/src/snapshots/ruff__linter__tests__E712_E712.py.snap index a46cf536e0..f14588e0b6 100644 --- a/src/snapshots/ruff__linter__tests__E712_E712.py.snap +++ b/src/snapshots/ruff__linter__tests__E712_E712.py.snap @@ -1,6 +1,5 @@ --- source: src/linter.rs -assertion_line: 531 expression: checks --- - kind: @@ -22,7 +21,6 @@ expression: checks end_location: row: 2 column: 14 - applied: false - kind: TrueFalseComparison: - false @@ -42,7 +40,6 @@ expression: checks end_location: row: 5 column: 15 - applied: false - kind: TrueFalseComparison: - true @@ -62,7 +59,6 @@ expression: checks end_location: row: 8 column: 14 - applied: false - kind: TrueFalseComparison: - false @@ -82,7 +78,6 @@ expression: checks end_location: row: 11 column: 15 - applied: false - kind: TrueFalseComparison: - true @@ -102,7 +97,6 @@ expression: checks end_location: row: 14 column: 17 - applied: false - kind: TrueFalseComparison: - false @@ -122,7 +116,6 @@ expression: checks end_location: row: 17 column: 18 - applied: false - kind: TrueFalseComparison: - true @@ -142,7 +135,6 @@ expression: checks end_location: row: 20 column: 23 - applied: false - kind: TrueFalseComparison: - false @@ -162,7 +154,6 @@ expression: checks end_location: row: 20 column: 48 - applied: false - kind: TrueFalseComparison: - true @@ -182,7 +173,6 @@ expression: checks end_location: row: 22 column: 24 - applied: false - kind: TrueFalseComparison: - true @@ -202,7 +192,6 @@ expression: checks end_location: row: 25 column: 3 - applied: false - kind: TrueFalseComparison: - false @@ -222,5 +211,4 @@ expression: checks end_location: row: 25 column: 23 - applied: false diff --git a/src/snapshots/ruff__linter__tests__E713_E713.py.snap b/src/snapshots/ruff__linter__tests__E713_E713.py.snap index 52dbaba3d9..39f0fb717a 100644 --- a/src/snapshots/ruff__linter__tests__E713_E713.py.snap +++ b/src/snapshots/ruff__linter__tests__E713_E713.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 2 column: 13 - applied: false - kind: NotInTest location: row: 5 @@ -35,7 +34,6 @@ expression: checks end_location: row: 5 column: 15 - applied: false - kind: NotInTest location: row: 8 @@ -52,7 +50,6 @@ expression: checks end_location: row: 8 column: 13 - applied: false - kind: NotInTest location: row: 11 @@ -69,7 +66,6 @@ expression: checks end_location: row: 11 column: 28 - applied: false - kind: NotInTest location: row: 14 @@ -86,5 +82,4 @@ expression: checks end_location: row: 14 column: 15 - applied: false diff --git a/src/snapshots/ruff__linter__tests__E714_E714.py.snap b/src/snapshots/ruff__linter__tests__E714_E714.py.snap index 2f6c9899cc..2078f71c33 100644 --- a/src/snapshots/ruff__linter__tests__E714_E714.py.snap +++ b/src/snapshots/ruff__linter__tests__E714_E714.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 2 column: 13 - applied: false - kind: NotIsTest location: row: 5 @@ -35,7 +34,6 @@ expression: checks end_location: row: 5 column: 15 - applied: false - kind: NotIsTest location: row: 8 diff --git a/src/snapshots/ruff__linter__tests__E731_E731.py.snap b/src/snapshots/ruff__linter__tests__E731_E731.py.snap index daf8c8f058..23ac8d42d3 100644 --- a/src/snapshots/ruff__linter__tests__E731_E731.py.snap +++ b/src/snapshots/ruff__linter__tests__E731_E731.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 2 column: 19 - applied: false - kind: DoNotAssignLambda location: row: 4 @@ -35,7 +34,6 @@ expression: checks end_location: row: 4 column: 19 - applied: false - kind: DoNotAssignLambda location: row: 7 @@ -52,5 +50,4 @@ expression: checks end_location: row: 7 column: 29 - applied: false diff --git a/src/snapshots/ruff__linter__tests__F401_F401_0.py.snap b/src/snapshots/ruff__linter__tests__F401_F401_0.py.snap index a67353f8cb..946c1d5110 100644 --- a/src/snapshots/ruff__linter__tests__F401_F401_0.py.snap +++ b/src/snapshots/ruff__linter__tests__F401_F401_0.py.snap @@ -21,7 +21,6 @@ expression: checks end_location: row: 2 column: 20 - applied: false - kind: UnusedImport: - - collections.OrderedDict @@ -41,7 +40,6 @@ expression: checks end_location: row: 8 column: 1 - applied: false - kind: UnusedImport: - - logging.handlers @@ -61,7 +59,6 @@ expression: checks end_location: row: 13 column: 0 - applied: false - kind: UnusedImport: - - shelve @@ -81,7 +78,6 @@ expression: checks end_location: row: 33 column: 0 - applied: false - kind: UnusedImport: - - importlib @@ -101,7 +97,6 @@ expression: checks end_location: row: 33 column: 20 - applied: false - kind: UnusedImport: - - pathlib @@ -121,7 +116,6 @@ expression: checks end_location: row: 38 column: 0 - applied: false - kind: UnusedImport: - - pickle @@ -141,5 +135,4 @@ expression: checks end_location: row: 52 column: 21 - applied: false diff --git a/src/snapshots/ruff__linter__tests__F401_F401_5.py.snap b/src/snapshots/ruff__linter__tests__F401_F401_5.py.snap index 3be73ba6ea..7d942bf863 100644 --- a/src/snapshots/ruff__linter__tests__F401_F401_5.py.snap +++ b/src/snapshots/ruff__linter__tests__F401_F401_5.py.snap @@ -21,7 +21,6 @@ expression: checks end_location: row: 3 column: 0 - applied: false - kind: UnusedImport: - - d.e.f @@ -41,7 +40,6 @@ expression: checks end_location: row: 4 column: 0 - applied: false - kind: UnusedImport: - - h.i @@ -61,7 +59,6 @@ expression: checks end_location: row: 5 column: 0 - applied: false - kind: UnusedImport: - - j.k @@ -81,5 +78,4 @@ expression: checks end_location: row: 6 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__F401_F401_6.py.snap b/src/snapshots/ruff__linter__tests__F401_F401_6.py.snap index feef8a9397..46dfb104b9 100644 --- a/src/snapshots/ruff__linter__tests__F401_F401_6.py.snap +++ b/src/snapshots/ruff__linter__tests__F401_F401_6.py.snap @@ -21,7 +21,6 @@ expression: checks end_location: row: 8 column: 0 - applied: false - kind: UnusedImport: - - datastructures.UploadFile @@ -41,7 +40,6 @@ expression: checks end_location: row: 11 column: 0 - applied: false - kind: UnusedImport: - - background @@ -61,7 +59,6 @@ expression: checks end_location: row: 18 column: 0 - applied: false - kind: UnusedImport: - - datastructures @@ -81,5 +78,4 @@ expression: checks end_location: row: 21 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__F632_F632.py.snap b/src/snapshots/ruff__linter__tests__F632_F632.py.snap index 28b6d2c812..736914299b 100644 --- a/src/snapshots/ruff__linter__tests__F632_F632.py.snap +++ b/src/snapshots/ruff__linter__tests__F632_F632.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 1 column: 13 - applied: false - kind: IsLiteral location: row: 4 @@ -35,7 +34,6 @@ expression: checks end_location: row: 4 column: 15 - applied: false - kind: IsLiteral location: row: 7 @@ -52,5 +50,4 @@ expression: checks end_location: row: 7 column: 13 - applied: false diff --git a/src/snapshots/ruff__linter__tests__F901_F901.py.snap b/src/snapshots/ruff__linter__tests__F901_F901.py.snap index d49f3aef6e..a628077fb9 100644 --- a/src/snapshots/ruff__linter__tests__F901_F901.py.snap +++ b/src/snapshots/ruff__linter__tests__F901_F901.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 2 column: 24 - applied: false - kind: RaiseNotImplemented location: row: 6 @@ -35,5 +34,4 @@ expression: checks end_location: row: 6 column: 24 - applied: false diff --git a/src/snapshots/ruff__linter__tests__RUF001_RUF001.py.snap b/src/snapshots/ruff__linter__tests__RUF001_RUF001.py.snap index 0d86638d77..f1fe04f865 100644 --- a/src/snapshots/ruff__linter__tests__RUF001_RUF001.py.snap +++ b/src/snapshots/ruff__linter__tests__RUF001_RUF001.py.snap @@ -21,5 +21,4 @@ expression: checks end_location: row: 1 column: 6 - applied: false diff --git a/src/snapshots/ruff__linter__tests__RUF002_RUF002.py.snap b/src/snapshots/ruff__linter__tests__RUF002_RUF002.py.snap index 0eb1a7c45c..4301ec2584 100644 --- a/src/snapshots/ruff__linter__tests__RUF002_RUF002.py.snap +++ b/src/snapshots/ruff__linter__tests__RUF002_RUF002.py.snap @@ -21,5 +21,4 @@ expression: checks end_location: row: 5 column: 56 - applied: false diff --git a/src/snapshots/ruff__linter__tests__RUF003_RUF003.py.snap b/src/snapshots/ruff__linter__tests__RUF003_RUF003.py.snap index 90f5a71bbd..4bdb81788c 100644 --- a/src/snapshots/ruff__linter__tests__RUF003_RUF003.py.snap +++ b/src/snapshots/ruff__linter__tests__RUF003_RUF003.py.snap @@ -21,5 +21,4 @@ expression: checks end_location: row: 6 column: 62 - applied: false diff --git a/src/snapshots/ruff__linter__tests__RUF101_RUF101_1.py.snap b/src/snapshots/ruff__linter__tests__RUF101_RUF101_1.py.snap index dbeecd8f48..a83f90051e 100644 --- a/src/snapshots/ruff__linter__tests__RUF101_RUF101_1.py.snap +++ b/src/snapshots/ruff__linter__tests__RUF101_RUF101_1.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 3 column: 4 - applied: false - kind: ConvertExitToSysExit location: row: 7 @@ -35,5 +34,4 @@ expression: checks end_location: row: 7 column: 8 - applied: false diff --git a/src/snapshots/ruff__linter__tests__RUF101_RUF101_2.py.snap b/src/snapshots/ruff__linter__tests__RUF101_RUF101_2.py.snap index 76371f26a3..52fe6856c6 100644 --- a/src/snapshots/ruff__linter__tests__RUF101_RUF101_2.py.snap +++ b/src/snapshots/ruff__linter__tests__RUF101_RUF101_2.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 3 column: 4 - applied: false - kind: ConvertExitToSysExit location: row: 7 @@ -35,5 +34,4 @@ expression: checks end_location: row: 7 column: 8 - applied: false diff --git a/src/snapshots/ruff__linter__tests__RUF101_RUF101_4.py.snap b/src/snapshots/ruff__linter__tests__RUF101_RUF101_4.py.snap index 1f0ad1f327..d917d76acb 100644 --- a/src/snapshots/ruff__linter__tests__RUF101_RUF101_4.py.snap +++ b/src/snapshots/ruff__linter__tests__RUF101_RUF101_4.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 3 column: 4 - applied: false - kind: ConvertExitToSysExit location: row: 7 @@ -35,5 +34,4 @@ expression: checks end_location: row: 7 column: 8 - applied: false diff --git a/src/snapshots/ruff__linter__tests__T201_T201.py.snap b/src/snapshots/ruff__linter__tests__T201_T201.py.snap index 77823af6bb..f0229e8424 100644 --- a/src/snapshots/ruff__linter__tests__T201_T201.py.snap +++ b/src/snapshots/ruff__linter__tests__T201_T201.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 2 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__T203_T203.py.snap b/src/snapshots/ruff__linter__tests__T203_T203.py.snap index 61333d8dac..b262e92841 100644 --- a/src/snapshots/ruff__linter__tests__T203_T203.py.snap +++ b/src/snapshots/ruff__linter__tests__T203_T203.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 4 column: 0 - applied: false - kind: PPrintFound location: row: 8 @@ -35,5 +34,4 @@ expression: checks end_location: row: 9 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U001_U001.py.snap b/src/snapshots/ruff__linter__tests__U001_U001.py.snap index 670f1e4a2f..a619e8474f 100644 --- a/src/snapshots/ruff__linter__tests__U001_U001.py.snap +++ b/src/snapshots/ruff__linter__tests__U001_U001.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 2 column: 24 - applied: false - kind: UselessMetaclassType location: row: 6 @@ -35,5 +34,4 @@ expression: checks end_location: row: 7 column: 0 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U003_U003.py.snap b/src/snapshots/ruff__linter__tests__U003_U003.py.snap index 5e3eed44a6..0def5d0245 100644 --- a/src/snapshots/ruff__linter__tests__U003_U003.py.snap +++ b/src/snapshots/ruff__linter__tests__U003_U003.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 1 column: 8 - applied: false - kind: TypeOfPrimitive: Bytes location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 2 column: 9 - applied: false - kind: TypeOfPrimitive: Int location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 3 column: 7 - applied: false - kind: TypeOfPrimitive: Float location: @@ -73,7 +70,6 @@ expression: checks end_location: row: 4 column: 8 - applied: false - kind: TypeOfPrimitive: Complex location: @@ -91,5 +87,4 @@ expression: checks end_location: row: 5 column: 8 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U004_U004.py.snap b/src/snapshots/ruff__linter__tests__U004_U004.py.snap index 4e402f352f..d3fdc97dbc 100644 --- a/src/snapshots/ruff__linter__tests__U004_U004.py.snap +++ b/src/snapshots/ruff__linter__tests__U004_U004.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 5 column: 15 - applied: false - kind: UselessObjectInheritance: A location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 11 column: 1 - applied: false - kind: UselessObjectInheritance: A location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 18 column: 1 - applied: false - kind: UselessObjectInheritance: A location: @@ -73,7 +70,6 @@ expression: checks end_location: row: 25 column: 1 - applied: false - kind: UselessObjectInheritance: A location: @@ -91,7 +87,6 @@ expression: checks end_location: row: 32 column: 1 - applied: false - kind: UselessObjectInheritance: A location: @@ -109,7 +104,6 @@ expression: checks end_location: row: 39 column: 1 - applied: false - kind: UselessObjectInheritance: A location: @@ -127,7 +121,6 @@ expression: checks end_location: row: 47 column: 1 - applied: false - kind: UselessObjectInheritance: A location: @@ -145,7 +138,6 @@ expression: checks end_location: row: 55 column: 1 - applied: false - kind: UselessObjectInheritance: A location: @@ -163,7 +155,6 @@ expression: checks end_location: row: 63 column: 1 - applied: false - kind: UselessObjectInheritance: A location: @@ -181,7 +172,6 @@ expression: checks end_location: row: 71 column: 1 - applied: false - kind: UselessObjectInheritance: B location: @@ -199,7 +189,6 @@ expression: checks end_location: row: 75 column: 17 - applied: false - kind: UselessObjectInheritance: B location: @@ -217,7 +206,6 @@ expression: checks end_location: row: 79 column: 16 - applied: false - kind: UselessObjectInheritance: B location: @@ -235,7 +223,6 @@ expression: checks end_location: row: 85 column: 4 - applied: false - kind: UselessObjectInheritance: B location: @@ -253,7 +240,6 @@ expression: checks end_location: row: 92 column: 10 - applied: false - kind: UselessObjectInheritance: B location: @@ -271,7 +257,6 @@ expression: checks end_location: row: 99 column: 4 - applied: false - kind: UselessObjectInheritance: B location: @@ -289,7 +274,6 @@ expression: checks end_location: row: 108 column: 10 - applied: false - kind: UselessObjectInheritance: A location: @@ -307,7 +291,6 @@ expression: checks end_location: row: 114 column: 19 - applied: false - kind: UselessObjectInheritance: A location: @@ -325,7 +308,6 @@ expression: checks end_location: row: 120 column: 1 - applied: false - kind: UselessObjectInheritance: A location: @@ -343,7 +325,6 @@ expression: checks end_location: row: 126 column: 1 - applied: false - kind: UselessObjectInheritance: A location: @@ -361,5 +342,4 @@ expression: checks end_location: row: 133 column: 1 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U005_U005.py.snap b/src/snapshots/ruff__linter__tests__U005_U005.py.snap index 8e6470fd3b..69d50d7c99 100644 --- a/src/snapshots/ruff__linter__tests__U005_U005.py.snap +++ b/src/snapshots/ruff__linter__tests__U005_U005.py.snap @@ -21,7 +21,6 @@ expression: checks end_location: row: 6 column: 25 - applied: false - kind: DeprecatedUnittestAlias: - assertEquals @@ -41,7 +40,6 @@ expression: checks end_location: row: 7 column: 25 - applied: false - kind: DeprecatedUnittestAlias: - failUnlessAlmostEqual @@ -61,7 +59,6 @@ expression: checks end_location: row: 9 column: 34 - applied: false - kind: DeprecatedUnittestAlias: - assertNotRegexpMatches @@ -81,5 +78,4 @@ expression: checks end_location: row: 10 column: 35 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U006_U006.py.snap b/src/snapshots/ruff__linter__tests__U006_U006.py.snap index 8e05bc151e..34d45c6193 100644 --- a/src/snapshots/ruff__linter__tests__U006_U006.py.snap +++ b/src/snapshots/ruff__linter__tests__U006_U006.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 4 column: 20 - applied: false - kind: UsePEP585Annotation: List location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 11 column: 13 - applied: false - kind: UsePEP585Annotation: List location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 18 column: 15 - applied: false - kind: UsePEP585Annotation: List location: @@ -73,5 +70,4 @@ expression: checks end_location: row: 25 column: 14 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U007_U007.py.snap b/src/snapshots/ruff__linter__tests__U007_U007.py.snap index 3adb8c378b..3d6cd84e64 100644 --- a/src/snapshots/ruff__linter__tests__U007_U007.py.snap +++ b/src/snapshots/ruff__linter__tests__U007_U007.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 6 column: 22 - applied: false - kind: UsePEP604Annotation location: row: 10 @@ -35,7 +34,6 @@ expression: checks end_location: row: 10 column: 29 - applied: false - kind: UsePEP604Annotation location: row: 14 @@ -52,7 +50,6 @@ expression: checks end_location: row: 14 column: 45 - applied: false - kind: UsePEP604Annotation location: row: 14 @@ -69,7 +66,6 @@ expression: checks end_location: row: 14 column: 44 - applied: false - kind: UsePEP604Annotation location: row: 18 @@ -86,7 +82,6 @@ expression: checks end_location: row: 18 column: 31 - applied: false - kind: UsePEP604Annotation location: row: 22 @@ -103,7 +98,6 @@ expression: checks end_location: row: 22 column: 33 - applied: false - kind: UsePEP604Annotation location: row: 26 @@ -120,5 +114,4 @@ expression: checks end_location: row: 26 column: 40 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U008_U008.py.snap b/src/snapshots/ruff__linter__tests__U008_U008.py.snap index fa7fba1d88..4dd11f9821 100644 --- a/src/snapshots/ruff__linter__tests__U008_U008.py.snap +++ b/src/snapshots/ruff__linter__tests__U008_U008.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 17 column: 35 - applied: false - kind: SuperCallWithParameters location: row: 18 @@ -35,7 +34,6 @@ expression: checks end_location: row: 18 column: 26 - applied: false - kind: SuperCallWithParameters location: row: 19 @@ -52,7 +50,6 @@ expression: checks end_location: row: 22 column: 9 - applied: false - kind: SuperCallWithParameters location: row: 36 @@ -69,7 +66,6 @@ expression: checks end_location: row: 36 column: 28 - applied: false - kind: SuperCallWithParameters location: row: 50 @@ -86,5 +82,4 @@ expression: checks end_location: row: 50 column: 32 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U009_U009_0.py.snap b/src/snapshots/ruff__linter__tests__U009_U009_0.py.snap index 510e55ff78..9447a02b49 100644 --- a/src/snapshots/ruff__linter__tests__U009_U009_0.py.snap +++ b/src/snapshots/ruff__linter__tests__U009_U009_0.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 1 column: 14 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U009_U009_1.py.snap b/src/snapshots/ruff__linter__tests__U009_U009_1.py.snap index 0385532888..7a2504db51 100644 --- a/src/snapshots/ruff__linter__tests__U009_U009_1.py.snap +++ b/src/snapshots/ruff__linter__tests__U009_U009_1.py.snap @@ -18,5 +18,4 @@ expression: checks end_location: row: 2 column: 24 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U010_U010.py.snap b/src/snapshots/ruff__linter__tests__U010_U010.py.snap index 2838d98b22..99c0d0efb8 100644 --- a/src/snapshots/ruff__linter__tests__U010_U010.py.snap +++ b/src/snapshots/ruff__linter__tests__U010_U010.py.snap @@ -21,7 +21,6 @@ expression: checks end_location: row: 2 column: 0 - applied: false - kind: UnnecessaryFutureImport: - unicode_literals @@ -41,7 +40,6 @@ expression: checks end_location: row: 3 column: 0 - applied: false - kind: UnnecessaryFutureImport: - absolute_import @@ -61,7 +59,6 @@ expression: checks end_location: row: 4 column: 0 - applied: false - kind: UnnecessaryFutureImport: - generator_stop @@ -80,7 +77,6 @@ expression: checks end_location: row: 5 column: 0 - applied: false - kind: UnnecessaryFutureImport: - generator_stop @@ -100,7 +96,6 @@ expression: checks end_location: row: 6 column: 0 - applied: false - kind: UnnecessaryFutureImport: - generators @@ -119,7 +114,6 @@ expression: checks end_location: row: 6 column: 49 - applied: false - kind: UnnecessaryFutureImport: - generator_stop @@ -138,7 +132,6 @@ expression: checks end_location: row: 10 column: 0 - applied: false - kind: UnnecessaryFutureImport: - generators @@ -157,7 +150,6 @@ expression: checks end_location: row: 10 column: 37 - applied: false - kind: UnnecessaryFutureImport: - generator_stop @@ -176,7 +168,6 @@ expression: checks end_location: row: 14 column: 0 - applied: false - kind: UnnecessaryFutureImport: - generators @@ -195,5 +186,4 @@ expression: checks end_location: row: 14 column: 53 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U011_U011_0.py.snap b/src/snapshots/ruff__linter__tests__U011_U011_0.py.snap index 7f2cec5783..c723449add 100644 --- a/src/snapshots/ruff__linter__tests__U011_U011_0.py.snap +++ b/src/snapshots/ruff__linter__tests__U011_U011_0.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 5 column: 12 - applied: false - kind: UnnecessaryLRUCacheParams location: row: 11 @@ -35,7 +34,6 @@ expression: checks end_location: row: 11 column: 22 - applied: false - kind: UnnecessaryLRUCacheParams location: row: 16 @@ -52,7 +50,6 @@ expression: checks end_location: row: 16 column: 24 - applied: false - kind: UnnecessaryLRUCacheParams location: row: 21 @@ -69,7 +66,6 @@ expression: checks end_location: row: 21 column: 34 - applied: false - kind: UnnecessaryLRUCacheParams location: row: 27 @@ -86,7 +82,6 @@ expression: checks end_location: row: 28 column: 1 - applied: false - kind: UnnecessaryLRUCacheParams location: row: 33 @@ -103,7 +98,6 @@ expression: checks end_location: row: 35 column: 1 - applied: false - kind: UnnecessaryLRUCacheParams location: row: 40 @@ -120,7 +114,6 @@ expression: checks end_location: row: 42 column: 19 - applied: false - kind: UnnecessaryLRUCacheParams location: row: 47 @@ -137,7 +130,6 @@ expression: checks end_location: row: 51 column: 1 - applied: false - kind: UnnecessaryLRUCacheParams location: row: 56 @@ -154,7 +146,6 @@ expression: checks end_location: row: 62 column: 1 - applied: false - kind: UnnecessaryLRUCacheParams location: row: 67 @@ -171,5 +162,4 @@ expression: checks end_location: row: 72 column: 1 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U012_U012.py.snap b/src/snapshots/ruff__linter__tests__U012_U012.py.snap index 87561b6848..d9d4096c1c 100644 --- a/src/snapshots/ruff__linter__tests__U012_U012.py.snap +++ b/src/snapshots/ruff__linter__tests__U012_U012.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 2 column: 21 - applied: false - kind: UnnecessaryEncodeUTF8 location: row: 3 @@ -35,7 +34,6 @@ expression: checks end_location: row: 3 column: 18 - applied: false - kind: UnnecessaryEncodeUTF8 location: row: 4 @@ -52,7 +50,6 @@ expression: checks end_location: row: 4 column: 14 - applied: false - kind: UnnecessaryEncodeUTF8 location: row: 5 @@ -69,7 +66,6 @@ expression: checks end_location: row: 5 column: 20 - applied: false - kind: UnnecessaryEncodeUTF8 location: row: 6 @@ -86,7 +82,6 @@ expression: checks end_location: row: 6 column: 22 - applied: false - kind: UnnecessaryEncodeUTF8 location: row: 7 @@ -103,7 +98,6 @@ expression: checks end_location: row: 7 column: 30 - applied: false - kind: UnnecessaryEncodeUTF8 location: row: 8 @@ -120,7 +114,6 @@ expression: checks end_location: row: 14 column: 1 - applied: false - kind: UnnecessaryEncodeUTF8 location: row: 26 @@ -137,7 +130,6 @@ expression: checks end_location: row: 26 column: 26 - applied: false - kind: UnnecessaryEncodeUTF8 location: row: 44 @@ -154,7 +146,6 @@ expression: checks end_location: row: 44 column: 30 - applied: false - kind: UnnecessaryEncodeUTF8 location: row: 46 @@ -171,7 +162,6 @@ expression: checks end_location: row: 46 column: 38 - applied: false - kind: UnnecessaryEncodeUTF8 location: row: 48 @@ -188,7 +178,6 @@ expression: checks end_location: row: 48 column: 23 - applied: false - kind: UnnecessaryEncodeUTF8 location: row: 49 @@ -205,7 +194,6 @@ expression: checks end_location: row: 49 column: 22 - applied: false - kind: UnnecessaryEncodeUTF8 location: row: 50 @@ -222,7 +210,6 @@ expression: checks end_location: row: 50 column: 23 - applied: false - kind: UnnecessaryEncodeUTF8 location: row: 51 @@ -239,7 +226,6 @@ expression: checks end_location: row: 51 column: 22 - applied: false - kind: UnnecessaryEncodeUTF8 location: row: 52 @@ -256,5 +242,4 @@ expression: checks end_location: row: 52 column: 20 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U013_U013.py.snap b/src/snapshots/ruff__linter__tests__U013_U013.py.snap index d246c62076..7e964385d2 100644 --- a/src/snapshots/ruff__linter__tests__U013_U013.py.snap +++ b/src/snapshots/ruff__linter__tests__U013_U013.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 5 column: 52 - applied: false - kind: ConvertTypedDictFunctionalToClass: MyType2 location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 8 column: 50 - applied: false - kind: ConvertTypedDictFunctionalToClass: MyType3 location: @@ -55,7 +53,6 @@ expression: checks end_location: row: 11 column: 44 - applied: false - kind: ConvertTypedDictFunctionalToClass: MyType4 location: @@ -73,7 +70,6 @@ expression: checks end_location: row: 14 column: 30 - applied: false - kind: ConvertTypedDictFunctionalToClass: MyType5 location: @@ -91,7 +87,6 @@ expression: checks end_location: row: 17 column: 46 - applied: false - kind: ConvertTypedDictFunctionalToClass: MyType6 location: @@ -109,7 +104,6 @@ expression: checks end_location: row: 18 column: 41 - applied: false - kind: ConvertTypedDictFunctionalToClass: MyType7 location: @@ -127,7 +121,6 @@ expression: checks end_location: row: 21 column: 56 - applied: false - kind: ConvertTypedDictFunctionalToClass: MyType8 location: @@ -145,7 +138,6 @@ expression: checks end_location: row: 24 column: 65 - applied: false - kind: ConvertTypedDictFunctionalToClass: MyType10 location: @@ -163,7 +155,6 @@ expression: checks end_location: row: 30 column: 59 - applied: false - kind: ConvertTypedDictFunctionalToClass: MyType11 location: @@ -181,5 +172,4 @@ expression: checks end_location: row: 33 column: 53 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U014_U014.py.snap b/src/snapshots/ruff__linter__tests__U014_U014.py.snap index a394f7fd3c..c1dd906d65 100644 --- a/src/snapshots/ruff__linter__tests__U014_U014.py.snap +++ b/src/snapshots/ruff__linter__tests__U014_U014.py.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 5 column: 61 - applied: false - kind: ConvertNamedTupleFunctionalToClass: NT2 location: @@ -37,7 +36,6 @@ expression: checks end_location: row: 12 column: 1 - applied: false - kind: ConvertNamedTupleFunctionalToClass: NT3 location: @@ -55,5 +53,4 @@ expression: checks end_location: row: 15 column: 56 - applied: false diff --git a/src/snapshots/ruff__linter__tests__U015_U015.py.snap b/src/snapshots/ruff__linter__tests__U015_U015.py.snap index dfd299f257..fa114c355b 100644 --- a/src/snapshots/ruff__linter__tests__U015_U015.py.snap +++ b/src/snapshots/ruff__linter__tests__U015_U015.py.snap @@ -18,7 +18,6 @@ expression: checks end_location: row: 1 column: 15 - applied: false - kind: RedundantOpenModes location: row: 2 @@ -35,7 +34,6 @@ expression: checks end_location: row: 2 column: 16 - applied: false - kind: RedundantOpenModes location: row: 3 @@ -52,7 +50,6 @@ expression: checks end_location: row: 3 column: 16 - applied: false - kind: RedundantOpenModes location: row: 4 @@ -69,7 +66,6 @@ expression: checks end_location: row: 4 column: 17 - applied: false - kind: RedundantOpenModes location: row: 5 @@ -86,7 +82,6 @@ expression: checks end_location: row: 5 column: 15 - applied: false - kind: RedundantOpenModes location: row: 6 @@ -103,7 +98,6 @@ expression: checks end_location: row: 6 column: 16 - applied: false - kind: RedundantOpenModes location: row: 7 @@ -120,7 +114,6 @@ expression: checks end_location: row: 7 column: 13 - applied: false - kind: RedundantOpenModes location: row: 8 @@ -137,7 +130,6 @@ expression: checks end_location: row: 8 column: 14 - applied: false - kind: RedundantOpenModes location: row: 10 @@ -154,7 +146,6 @@ expression: checks end_location: row: 10 column: 20 - applied: false - kind: RedundantOpenModes location: row: 12 @@ -171,7 +162,6 @@ expression: checks end_location: row: 12 column: 21 - applied: false - kind: RedundantOpenModes location: row: 14 @@ -188,7 +178,6 @@ expression: checks end_location: row: 14 column: 21 - applied: false - kind: RedundantOpenModes location: row: 16 @@ -205,7 +194,6 @@ expression: checks end_location: row: 16 column: 22 - applied: false - kind: RedundantOpenModes location: row: 18 @@ -222,7 +210,6 @@ expression: checks end_location: row: 18 column: 20 - applied: false - kind: RedundantOpenModes location: row: 20 @@ -239,7 +226,6 @@ expression: checks end_location: row: 20 column: 21 - applied: false - kind: RedundantOpenModes location: row: 22 @@ -256,7 +242,6 @@ expression: checks end_location: row: 22 column: 20 - applied: false - kind: RedundantOpenModes location: row: 24 @@ -273,7 +258,6 @@ expression: checks end_location: row: 24 column: 21 - applied: false - kind: RedundantOpenModes location: row: 27 @@ -290,7 +274,6 @@ expression: checks end_location: row: 27 column: 26 - applied: false - kind: RedundantOpenModes location: row: 28 @@ -307,7 +290,6 @@ expression: checks end_location: row: 28 column: 27 - applied: false - kind: RedundantOpenModes location: row: 30 @@ -324,7 +306,6 @@ expression: checks end_location: row: 30 column: 31 - applied: false - kind: RedundantOpenModes location: row: 32 @@ -341,7 +322,6 @@ expression: checks end_location: row: 32 column: 32 - applied: false - kind: RedundantOpenModes location: row: 35 @@ -358,7 +338,6 @@ expression: checks end_location: row: 35 column: 20 - applied: false - kind: RedundantOpenModes location: row: 35 @@ -375,7 +354,6 @@ expression: checks end_location: row: 35 column: 44 - applied: false - kind: RedundantOpenModes location: row: 37 @@ -392,7 +370,6 @@ expression: checks end_location: row: 37 column: 21 - applied: false - kind: RedundantOpenModes location: row: 37 @@ -409,5 +386,4 @@ expression: checks end_location: row: 37 column: 46 - applied: false diff --git a/src/snapshots/ruff__linter__tests__future_annotations.snap b/src/snapshots/ruff__linter__tests__future_annotations.snap index 0f3eeba295..cb35826cac 100644 --- a/src/snapshots/ruff__linter__tests__future_annotations.snap +++ b/src/snapshots/ruff__linter__tests__future_annotations.snap @@ -21,7 +21,6 @@ expression: checks end_location: row: 8 column: 1 - applied: false - kind: UndefinedName: Bar location: diff --git a/src/snapshots/ruff__linter__tests__m001.snap b/src/snapshots/ruff__linter__tests__m001.snap index a0c3b85b89..58345eaca7 100644 --- a/src/snapshots/ruff__linter__tests__m001.snap +++ b/src/snapshots/ruff__linter__tests__m001.snap @@ -19,7 +19,6 @@ expression: checks end_location: row: 9 column: 17 - applied: false - kind: UnusedNOQA: - E501 @@ -38,7 +37,6 @@ expression: checks end_location: row: 13 column: 23 - applied: false - kind: UnusedNOQA: - F841 @@ -58,7 +56,6 @@ expression: checks end_location: row: 16 column: 29 - applied: false - kind: UnusedNOQA: - F841 @@ -78,7 +75,6 @@ expression: checks end_location: row: 19 column: 29 - applied: false - kind: UnusedNOQA: - E501 @@ -97,7 +93,6 @@ expression: checks end_location: row: 23 column: 21 - applied: false - kind: UnusedVariable: d location: @@ -125,7 +120,6 @@ expression: checks end_location: row: 26 column: 44 - applied: false - kind: UnusedNOQA: - F841 @@ -144,7 +138,6 @@ expression: checks end_location: row: 52 column: 23 - applied: false - kind: UnusedNOQA: - E501 @@ -163,7 +156,6 @@ expression: checks end_location: row: 60 column: 17 - applied: false - kind: UnusedNOQA: ~ location: @@ -181,5 +173,4 @@ expression: checks end_location: row: 68 column: 11 - applied: false