diff --git a/ruff_cli/src/printer.rs b/ruff_cli/src/printer.rs index b0d9858460..1674d02b1c 100644 --- a/ruff_cli/src/printer.rs +++ b/ruff_cli/src/printer.rs @@ -177,8 +177,10 @@ impl<'a> Printer<'a> { message.location.column(), message.kind.body() )); - let mut case = - TestCase::new(format!("org.ruff.{}", message.kind.rule()), status); + let mut case = TestCase::new( + format!("org.ruff.{}", message.kind.rule().code()), + status, + ); let file_path = Path::new(filename); let file_stem = file_path.file_stem().unwrap().to_str().unwrap(); let classname = file_path.parent().unwrap().join(file_stem); @@ -255,7 +257,7 @@ impl<'a> Printer<'a> { stdout, "::error title=Ruff \ ({}),file={},line={},col={},endLine={},endColumn={}::{}", - message.kind.rule(), + message.kind.rule().code(), message.filename, message.location.row(), message.location.column(), @@ -276,7 +278,7 @@ impl<'a> Printer<'a> { .iter() .map(|message| { json!({ - "description": format!("({}) {}", message.kind.rule(), message.kind.body()), + "description": format!("({}) {}", message.kind.rule().code(), message.kind.body()), "severity": "major", "fingerprint": message.kind.rule(), "location": { diff --git a/ruff_macros/src/define_rule_mapping.rs b/ruff_macros/src/define_rule_mapping.rs index 13428e18e3..1826c5a596 100644 --- a/ruff_macros/src/define_rule_mapping.rs +++ b/ruff_macros/src/define_rule_mapping.rs @@ -51,7 +51,6 @@ pub fn define_rule_mapping(mapping: &Mapping) -> proc_macro2::TokenStream { EnumIter, EnumString, // TODO(martin): Remove Debug, - Display, // TODO(martin): Remove PartialEq, Eq, Clone, diff --git a/src/registry.rs b/src/registry.rs index 7259c72899..723610b165 100644 --- a/src/registry.rs +++ b/src/registry.rs @@ -5,7 +5,7 @@ use once_cell::sync::Lazy; use rustc_hash::FxHashMap; use rustpython_parser::ast::Location; use serde::{Deserialize, Serialize}; -use strum_macros::{AsRefStr, Display, EnumIter, EnumString}; +use strum_macros::{AsRefStr, EnumIter, EnumString}; use crate::ast::types::Range; use crate::fix::Fix;