@@ -97,65 +97,41 @@ use rustc_session::Session;
97
97
/// }
98
98
/// ```
99
99
/// [lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
100
- #[ macro_export]
101
- macro_rules! declare_clippy_lint {
102
- { $( #[ $attr: meta] ) * pub $name: tt, style, $description: tt } => {
103
- declare_tool_lint! {
104
- $( #[ $attr] ) * pub clippy:: $name, Warn , $description, report_in_external_macro: true
105
- }
106
- } ;
107
- { $( #[ $attr: meta] ) * pub $name: tt, correctness, $description: tt } => {
108
- declare_tool_lint! {
109
- $( #[ $attr] ) * pub clippy:: $name, Deny , $description, report_in_external_macro: true
110
- }
111
- } ;
112
- { $( #[ $attr: meta] ) * pub $name: tt, suspicious, $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, complexity, $description: tt } => {
118
- declare_tool_lint! {
119
- $( #[ $attr] ) * pub clippy:: $name, Warn , $description, report_in_external_macro: true
120
- }
121
- } ;
122
- { $( #[ $attr: meta] ) * pub $name: tt, perf, $description: tt } => {
123
- declare_tool_lint! {
124
- $( #[ $attr] ) * pub clippy:: $name, Warn , $description, report_in_external_macro: true
125
- }
126
- } ;
127
- { $( #[ $attr: meta] ) * pub $name: tt, pedantic, $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, restriction, $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, cargo, $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, nursery, $description: tt } => {
143
- declare_tool_lint! {
144
- $( #[ $attr] ) * pub clippy:: $name, Allow , $description, report_in_external_macro: true
145
- }
146
- } ;
147
- { $( #[ $attr: meta] ) * pub $name: tt, internal, $description: tt } => {
148
- declare_tool_lint! {
149
- $( #[ $attr] ) * pub clippy:: $name, Allow , $description, report_in_external_macro: true
150
- }
151
- } ;
152
- { $( #[ $attr: meta] ) * pub $name: tt, internal_warn, $description: tt } => {
153
- declare_tool_lint! {
154
- $( #[ $attr] ) * pub clippy:: $name, Warn , $description, report_in_external_macro: true
100
+ macro_rules! declare_clippy_lint_macro {
101
+ ( { $( $category: tt: $level: tt, ) * } , $d: tt) => {
102
+ macro_rules! declare_clippy_lint {
103
+ $(
104
+ ( $d( #[ $d meta: meta] ) * pub $d name: tt, $category, $d description: tt) => {
105
+ declare_tool_lint! {
106
+ $d( #[ $d meta] ) *
107
+ pub clippy:: $d name,
108
+ $level,
109
+ $d description,
110
+ report_in_external_macro: true
111
+ }
112
+ } ;
113
+ ) *
155
114
}
156
115
} ;
157
116
}
158
117
118
+ declare_clippy_lint_macro ! {
119
+ {
120
+ correctness: Deny ,
121
+ complexity: Warn ,
122
+ internal_warn: Warn ,
123
+ perf: Warn ,
124
+ suspicious: Warn ,
125
+ style: Warn ,
126
+ cargo: Allow ,
127
+ internal: Allow ,
128
+ nursery: Allow ,
129
+ pedantic: Allow ,
130
+ restriction: Allow ,
131
+ } ,
132
+ $
133
+ }
134
+
159
135
#[ cfg( feature = "internal" ) ]
160
136
mod deprecated_lints;
161
137
#[ cfg_attr( feature = "internal" , allow( clippy:: missing_clippy_version_attribute) ) ]
0 commit comments