diff --git a/crates/ruff_linter/src/checkers/noqa.rs b/crates/ruff_linter/src/checkers/noqa.rs index 926c7dcfb8..7cf58a5def 100644 --- a/crates/ruff_linter/src/checkers/noqa.rs +++ b/crates/ruff_linter/src/checkers/noqa.rs @@ -130,6 +130,7 @@ pub(crate) fn check_noqa( let edit = delete_comment(directive.range(), locator); let mut diagnostic = context .report_diagnostic(UnusedNOQA { codes: None }, directive.range()); + diagnostic.add_primary_tag(ruff_db::diagnostic::DiagnosticTag::Unnecessary); diagnostic.set_fix(Fix::safe_edit(edit)); } } @@ -226,6 +227,7 @@ pub(crate) fn check_noqa( }, directive.range(), ); + diagnostic.add_primary_tag(ruff_db::diagnostic::DiagnosticTag::Unnecessary); diagnostic.set_fix(Fix::safe_edit(edit)); } } diff --git a/crates/ruff_linter/src/rules/pandas_vet/rules/subscript.rs b/crates/ruff_linter/src/rules/pandas_vet/rules/subscript.rs index 30fc920952..cda65b6554 100644 --- a/crates/ruff_linter/src/rules/pandas_vet/rules/subscript.rs +++ b/crates/ruff_linter/src/rules/pandas_vet/rules/subscript.rs @@ -165,16 +165,17 @@ pub(crate) fn subscript(checker: &Checker, value: &Expr, expr: &Expr) { match attr.as_str() { // PD007 "ix" if checker.is_rule_enabled(Rule::PandasUseOfDotIx) => { - checker.report_diagnostic(PandasUseOfDotIx, range) + let mut diagnostic = checker.report_diagnostic(PandasUseOfDotIx, range); + diagnostic.add_primary_tag(ruff_db::diagnostic::DiagnosticTag::Deprecated); } // PD008 "at" if checker.is_rule_enabled(Rule::PandasUseOfDotAt) => { - checker.report_diagnostic(PandasUseOfDotAt, range) + checker.report_diagnostic(PandasUseOfDotAt, range); } // PD009 "iat" if checker.is_rule_enabled(Rule::PandasUseOfDotIat) => { - checker.report_diagnostic(PandasUseOfDotIat, range) + checker.report_diagnostic(PandasUseOfDotIat, range); } - _ => return, - }; + _ => (), + } } diff --git a/crates/ruff_linter/src/rules/pyflakes/rules/redefined_while_unused.rs b/crates/ruff_linter/src/rules/pyflakes/rules/redefined_while_unused.rs index 184a88f408..3c13941f6a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/rules/redefined_while_unused.rs +++ b/crates/ruff_linter/src/rules/pyflakes/rules/redefined_while_unused.rs @@ -191,6 +191,7 @@ pub(crate) fn redefined_while_unused(checker: &Checker, scope_id: ScopeId, scope }, binding.range(), ); + diagnostic.add_primary_tag(ruff_db::diagnostic::DiagnosticTag::Unnecessary); diagnostic.secondary_annotation( format_args!("previous definition of `{name}` here"),