Implementation + move one lint

This commit is contained in:
Oliver Schneider
2018-03-27 17:13:55 +02:00
parent 9b10c4be8c
commit ef9fdbb8a9
3 changed files with 84 additions and 9 deletions

View File

@@ -66,6 +66,21 @@ macro_rules! declare_restriction_lint {
};
}
macro_rules! declare_clippy_lint {
{ pub $name:tt, style, $description:tt } => {
declare_lint! { pub $name, Warn, $description }
};
{ pub $name:tt, correctness, $description:tt } => {
declare_lint! { pub $name, Deny, $description }
};
{ pub $name:tt, complexity, $description:tt } => {
declare_lint! { pub $name, Warn, $description }
};
{ pub $name:tt, perf, $description:tt } => {
declare_lint! { pub $name, Warn, $description }
};
}
pub mod consts;
#[macro_use]
pub mod utils;
@@ -442,7 +457,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
]);
reg.register_lint_group("clippy", vec![
approx_const::APPROX_CONSTANT,
array_indexing::OUT_OF_BOUNDS_INDEXING,
assign_ops::ASSIGN_OP_PATTERN,
assign_ops::MISREFACTORED_ASSIGN_OP,
@@ -641,6 +655,19 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
vec::USELESS_VEC,
zero_div_zero::ZERO_DIVIDED_BY_ZERO,
]);
reg.register_lint_group("clippy_style", vec![
]);
reg.register_lint_group("clippy_complexity", vec![
]);
reg.register_lint_group("clippy_correctness", vec![
approx_const::APPROX_CONSTANT,
]);
reg.register_lint_group("clippy_perf", vec![
]);
}
// only exists to let the dogfood integration test works.