File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
crates/pgls_configuration/src/linter Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ impl Rules {
7373 pub fn get_severity_from_code ( & self , category : & Category ) -> Option < Severity > {
7474 let mut split_code = category. name ( ) . split ( '/' ) ;
7575 let _category_prefix = split_code. next ( ) ;
76- debug_assert_eq ! ( _category_prefix, Some ( "linter " ) ) ;
76+ debug_assert_eq ! ( _category_prefix, Some ( "lint " ) ) ;
7777 let group = <RuleGroup as std:: str:: FromStr >:: from_str ( split_code. next ( ) ?) . ok ( ) ?;
7878 let rule_name = split_code. next ( ) ?;
7979 let rule_name = Self :: has_rule ( group, rule_name) ?;
Original file line number Diff line number Diff line change @@ -60,6 +60,17 @@ impl ToolConfig {
6060 fn partial_config_struct_name ( & self ) -> String {
6161 format ! ( "Partial{}" , self . config_struct_name( ) )
6262 }
63+
64+ /// Derived: Category prefix used in diagnostics (e.g., "lint" for linter, "splinter" for splinter)
65+ fn category_prefix ( & self ) -> & ' static str {
66+ match self . name {
67+ "linter" => "lint" ,
68+ "splinter" => "splinter" ,
69+ "assists" => "assists" ,
70+ "pglinter" => "pglinter" ,
71+ _ => self . name ,
72+ }
73+ }
6374}
6475
6576/// All supported tools
@@ -280,7 +291,7 @@ fn generate_lint_rules_file(
280291 struct_groups. push ( generate_lint_group_struct ( tool. name , group, & rules) ) ;
281292 }
282293
283- let category_prefix = tool. name ;
294+ let category_prefix = tool. category_prefix ( ) ;
284295 let rules_struct_content = quote ! {
285296 //! Generated file, do not edit by hand, see `xtask/codegen`
286297
You can’t perform that action at this time.
0 commit comments