1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
#![warn(clippy::almost_standard_lint_formulation)]
#![feature(rustc_private)]
#[macro_use]
extern crate rustc_middle;
#[macro_use]
extern crate rustc_session;
extern crate rustc_lint;
declare_tool_lint! {
/// # What it does
///
/// Checks for usage of correct lint formulations
#[clippy::version = "pre 1.29.0"]
pub clippy::VALID,
Warn,
"One",
report_in_external_macro: true
}
declare_tool_lint! {
/// # What it does
/// Check for lint formulations that are correct
#[clippy::version = "pre 1.29.0"]
pub clippy::INVALID1,
Warn,
"One",
report_in_external_macro: true
}
declare_tool_lint! {
/// # What it does
/// Detects uses of incorrect formulations
#[clippy::version = "pre 1.29.0"]
pub clippy::INVALID2,
Warn,
"One",
report_in_external_macro: true
}
declare_tool_lint! {
/// # What it does
/// Detects uses of incorrect formulations (allowed with attribute)
#[allow(clippy::almost_standard_lint_formulation)]
#[clippy::version = "pre 1.29.0"]
pub clippy::ALLOWED_INVALID,
Warn,
"One",
report_in_external_macro: true
}
declare_lint_pass!(Pass => [VALID, INVALID1, INVALID2]);
fn main() {}
|