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