@@ -92,60 +92,40 @@ use rustc_session::Session;
92
92
/// }
93
93
/// ```
94
94
/// [lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
95
- #[ macro_export]
96
- macro_rules! declare_clippy_lint {
97
- { $( #[ $attr: meta] ) * pub $name: tt, style, $description: tt } => {
98
- declare_tool_lint! {
99
- $( #[ $attr] ) * pub clippy:: $name, Warn , $description, report_in_external_macro: true
100
- }
101
- } ;
102
- { $( #[ $attr: meta] ) * pub $name: tt, correctness, $description: tt } => {
103
- declare_tool_lint! {
104
- $( #[ $attr] ) * pub clippy:: $name, Deny , $description, report_in_external_macro: true
105
- }
106
- } ;
107
- { $( #[ $attr: meta] ) * pub $name: tt, complexity, $description: tt } => {
108
- declare_tool_lint! {
109
- $( #[ $attr] ) * pub clippy:: $name, Warn , $description, report_in_external_macro: true
110
- }
111
- } ;
112
- { $( #[ $attr: meta] ) * pub $name: tt, perf, $description: tt } => {
113
- declare_tool_lint! {
114
- $( #[ $attr] ) * pub clippy:: $name, Warn , $description, report_in_external_macro: true
115
- }
116
- } ;
117
- { $( #[ $attr: meta] ) * pub $name: tt, pedantic, $description: tt } => {
118
- declare_tool_lint! {
119
- $( #[ $attr] ) * pub clippy:: $name, Allow , $description, report_in_external_macro: true
120
- }
121
- } ;
122
- { $( #[ $attr: meta] ) * pub $name: tt, restriction, $description: tt } => {
123
- declare_tool_lint! {
124
- $( #[ $attr] ) * pub clippy:: $name, Allow , $description, report_in_external_macro: true
125
- }
126
- } ;
127
- { $( #[ $attr: meta] ) * pub $name: tt, cargo, $description: tt } => {
128
- declare_tool_lint! {
129
- $( #[ $attr] ) * pub clippy:: $name, Allow , $description, report_in_external_macro: true
130
- }
131
- } ;
132
- { $( #[ $attr: meta] ) * pub $name: tt, nursery, $description: tt } => {
133
- declare_tool_lint! {
134
- $( #[ $attr] ) * pub clippy:: $name, Allow , $description, report_in_external_macro: true
135
- }
136
- } ;
137
- { $( #[ $attr: meta] ) * pub $name: tt, internal, $description: tt } => {
138
- declare_tool_lint! {
139
- $( #[ $attr] ) * pub clippy:: $name, Allow , $description, report_in_external_macro: true
140
- }
141
- } ;
142
- { $( #[ $attr: meta] ) * pub $name: tt, internal_warn, $description: tt } => {
143
- declare_tool_lint! {
144
- $( #[ $attr] ) * pub clippy:: $name, Warn , $description, report_in_external_macro: true
95
+ macro_rules! declare_clippy_lint_macro {
96
+ ( { $( $category: tt: $level: tt, ) * } , $d: tt) => {
97
+ macro_rules! declare_clippy_lint {
98
+ $(
99
+ ( $d( #[ $d meta: meta] ) * pub $d name: tt, $category, $d description: tt) => {
100
+ declare_tool_lint! {
101
+ $d( #[ $d meta] ) *
102
+ pub clippy:: $d name,
103
+ $level,
104
+ $d description,
105
+ report_in_external_macro: true
106
+ }
107
+ } ;
108
+ ) *
145
109
}
146
110
} ;
147
111
}
148
112
113
+ declare_clippy_lint_macro ! {
114
+ {
115
+ correctness: Deny ,
116
+ complexity: Warn ,
117
+ perf: Warn ,
118
+ style: Warn ,
119
+ pedantic: Allow ,
120
+ restriction: Allow ,
121
+ cargo: Allow ,
122
+ nursery: Allow ,
123
+ internal: Allow ,
124
+ internal_warn: Warn ,
125
+ } ,
126
+ $
127
+ }
128
+
149
129
#[ macro_export]
150
130
macro_rules! sym {
151
131
( $( $x: tt) * ) => { clippy_utils:: sym!( $( $x) * ) }
0 commit comments