@@ -121,6 +121,29 @@ declare_clippy_lint! {
121
121
"this message should not appear anywhere as we ICE before and don't emit the lint"
122
122
}
123
123
124
+ declare_clippy_lint ! {
125
+ /// **What it does:** Checks for cases of an auto-generated lint without an updated description,
126
+ /// ie `default lint description`.
127
+ ///
128
+ /// **Why is this bad?** Indicates that the lint is not finished.
129
+ ///
130
+ /// **Known problems:** None
131
+ ///
132
+ /// **Example:**
133
+ /// Bad:
134
+ /// ```rust,ignore
135
+ /// declare_lint! { pub COOL_LINT, nursery, "default lint description" }
136
+ /// ```
137
+ ///
138
+ /// Good:
139
+ /// ```rust,ignore
140
+ /// declare_lint! { pub COOL_LINT, nursery, "a great new lint" }
141
+ /// ```
142
+ pub DEFAULT_LINT ,
143
+ internal,
144
+ "found 'default lint description' in a lint declaration"
145
+ }
146
+
124
147
declare_lint_pass ! ( ClippyLintsInternal => [ CLIPPY_LINTS_INTERNAL ] ) ;
125
148
126
149
impl EarlyLintPass for ClippyLintsInternal {
@@ -341,7 +364,17 @@ fn is_trigger_fn(fn_kind: FnKind<'_>) -> bool {
341
364
match fn_kind {
342
365
FnKind :: ItemFn ( ident, ..) | FnKind :: Method ( ident, ..) => {
343
366
ident. name . as_str ( ) == "it_looks_like_you_are_trying_to_kill_clippy"
344
- } ,
367
+ }
345
368
FnKind :: Closure ( ..) => false ,
346
369
}
347
370
}
371
+
372
+ declare_lint_pass ! ( DefaultLint => [ DEFAULT_LINT ] ) ;
373
+
374
+ impl EarlyLintPass for DefaultLint {
375
+ fn check_mac ( & mut self , cx : & EarlyContext < ' _ > , mac : & ast:: Mac ) {
376
+ if mac. path == sym ! ( declare_lint) {
377
+ println ! ( "{:?}" , mac. tts) ;
378
+ }
379
+ }
380
+ }
0 commit comments