diff --git a/crates/ruff_linter/src/checkers/logical_lines.rs b/crates/ruff_linter/src/checkers/logical_lines.rs index c216ce2f67..937c630a60 100644 --- a/crates/ruff_linter/src/checkers/logical_lines.rs +++ b/crates/ruff_linter/src/checkers/logical_lines.rs @@ -1,4 +1,4 @@ -use ruff_diagnostics::{Diagnostic, DiagnosticKind}; +use ruff_diagnostics::Diagnostic; use ruff_python_codegen::Stylist; use ruff_python_parser::lexer::LexResult; use ruff_python_parser::TokenKind; @@ -97,7 +97,7 @@ pub(crate) fn check_logical_lines( indent_size, ) { if settings.rules.enabled(kind.rule()) { - context.push(kind, range); + context.push_diagnostic(Diagnostic::new(kind, range)); } } @@ -123,18 +123,6 @@ impl<'a> LogicalLinesContext<'a> { } } - pub(crate) fn push>(&mut self, kind: K, range: TextRange) { - let kind = kind.into(); - if self.settings.rules.enabled(kind.rule()) { - self.diagnostics.push(Diagnostic { - kind, - range, - fix: None, - parent: None, - }); - } - } - pub(crate) fn push_diagnostic(&mut self, diagnostic: Diagnostic) { if self.settings.rules.enabled(diagnostic.kind.rule()) { self.diagnostics.push(diagnostic);