Clean up declare_clippy_lint
The new @eval_always option should always follow after a comma for consistency with the declare_tool_lint macro. Rename $catergory->$level.
This commit is contained in:
parent
03daf7ccb2
commit
4f12b98654
@ -30,7 +30,7 @@
|
|||||||
#[clippy::version = "1.35.0"]
|
#[clippy::version = "1.35.0"]
|
||||||
pub COGNITIVE_COMPLEXITY,
|
pub COGNITIVE_COMPLEXITY,
|
||||||
nursery,
|
nursery,
|
||||||
"functions that should be split up into multiple functions"
|
"functions that should be split up into multiple functions",
|
||||||
@eval_always = true
|
@eval_always = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ macro_rules! declare_clippy_lint {
|
|||||||
(@
|
(@
|
||||||
$(#[doc = $lit:literal])*
|
$(#[doc = $lit:literal])*
|
||||||
pub $lint_name:ident,
|
pub $lint_name:ident,
|
||||||
$category:ident,
|
$level:ident,
|
||||||
$lintcategory:expr,
|
$lintcategory:expr,
|
||||||
$desc:literal,
|
$desc:literal,
|
||||||
$version_expr:expr,
|
$version_expr:expr,
|
||||||
@ -15,7 +15,7 @@ macro_rules! declare_clippy_lint {
|
|||||||
$(#[doc = $lit])*
|
$(#[doc = $lit])*
|
||||||
#[clippy::version = $version_lit]
|
#[clippy::version = $version_lit]
|
||||||
pub clippy::$lint_name,
|
pub clippy::$lint_name,
|
||||||
$category,
|
$level,
|
||||||
$desc,
|
$desc,
|
||||||
report_in_external_macro:true
|
report_in_external_macro:true
|
||||||
$(, @eval_always = $eval_always)?
|
$(, @eval_always = $eval_always)?
|
||||||
@ -35,12 +35,13 @@ macro_rules! declare_clippy_lint {
|
|||||||
pub $lint_name:ident,
|
pub $lint_name:ident,
|
||||||
restriction,
|
restriction,
|
||||||
$desc:literal
|
$desc:literal
|
||||||
$(@eval_always = $eval_always: literal)?
|
$(, @eval_always = $eval_always: literal)?
|
||||||
) => {
|
) => {
|
||||||
declare_clippy_lint! {@
|
declare_clippy_lint! {@
|
||||||
$(#[doc = $lit])*
|
$(#[doc = $lit])*
|
||||||
pub $lint_name, Allow, crate::LintCategory::Restriction, $desc,
|
pub $lint_name, Allow, crate::LintCategory::Restriction, $desc,
|
||||||
Some($version), $version $(, $eval_always)?
|
Some($version), $version
|
||||||
|
$(, $eval_always)?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
(
|
(
|
||||||
@ -49,12 +50,13 @@ macro_rules! declare_clippy_lint {
|
|||||||
pub $lint_name:ident,
|
pub $lint_name:ident,
|
||||||
style,
|
style,
|
||||||
$desc:literal
|
$desc:literal
|
||||||
$(@eval_always = $eval_always: literal)?
|
$(, @eval_always = $eval_always: literal)?
|
||||||
) => {
|
) => {
|
||||||
declare_clippy_lint! {@
|
declare_clippy_lint! {@
|
||||||
$(#[doc = $lit])*
|
$(#[doc = $lit])*
|
||||||
pub $lint_name, Warn, crate::LintCategory::Style, $desc,
|
pub $lint_name, Warn, crate::LintCategory::Style, $desc,
|
||||||
Some($version), $version $(, $eval_always)?
|
Some($version), $version
|
||||||
|
$(, $eval_always)?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
(
|
(
|
||||||
@ -63,12 +65,13 @@ macro_rules! declare_clippy_lint {
|
|||||||
pub $lint_name:ident,
|
pub $lint_name:ident,
|
||||||
correctness,
|
correctness,
|
||||||
$desc:literal
|
$desc:literal
|
||||||
$(@eval_always = $eval_always: literal)?
|
$(, @eval_always = $eval_always: literal)?
|
||||||
) => {
|
) => {
|
||||||
declare_clippy_lint! {@
|
declare_clippy_lint! {@
|
||||||
$(#[doc = $lit])*
|
$(#[doc = $lit])*
|
||||||
pub $lint_name, Deny, crate::LintCategory::Correctness, $desc,
|
pub $lint_name, Deny, crate::LintCategory::Correctness, $desc,
|
||||||
Some($version), $version $(, $eval_always)?
|
Some($version), $version
|
||||||
|
$(, $eval_always)?
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -78,12 +81,13 @@ macro_rules! declare_clippy_lint {
|
|||||||
pub $lint_name:ident,
|
pub $lint_name:ident,
|
||||||
perf,
|
perf,
|
||||||
$desc:literal
|
$desc:literal
|
||||||
$(@eval_always = $eval_always: literal)?
|
$(, @eval_always = $eval_always: literal)?
|
||||||
) => {
|
) => {
|
||||||
declare_clippy_lint! {@
|
declare_clippy_lint! {@
|
||||||
$(#[doc = $lit])*
|
$(#[doc = $lit])*
|
||||||
pub $lint_name, Warn, crate::LintCategory::Perf, $desc,
|
pub $lint_name, Warn, crate::LintCategory::Perf, $desc,
|
||||||
Some($version), $version $(, $eval_always)?
|
Some($version), $version
|
||||||
|
$(, $eval_always)?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
(
|
(
|
||||||
@ -92,12 +96,13 @@ macro_rules! declare_clippy_lint {
|
|||||||
pub $lint_name:ident,
|
pub $lint_name:ident,
|
||||||
complexity,
|
complexity,
|
||||||
$desc:literal
|
$desc:literal
|
||||||
$(@eval_always = $eval_always: literal)?
|
$(, @eval_always = $eval_always: literal)?
|
||||||
) => {
|
) => {
|
||||||
declare_clippy_lint! {@
|
declare_clippy_lint! {@
|
||||||
$(#[doc = $lit])*
|
$(#[doc = $lit])*
|
||||||
pub $lint_name, Warn, crate::LintCategory::Complexity, $desc,
|
pub $lint_name, Warn, crate::LintCategory::Complexity, $desc,
|
||||||
Some($version), $version $(, $eval_always)?
|
Some($version), $version
|
||||||
|
$(, $eval_always)?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
(
|
(
|
||||||
@ -106,12 +111,13 @@ macro_rules! declare_clippy_lint {
|
|||||||
pub $lint_name:ident,
|
pub $lint_name:ident,
|
||||||
suspicious,
|
suspicious,
|
||||||
$desc:literal
|
$desc:literal
|
||||||
$(@eval_always = $eval_always: literal)?
|
$(, @eval_always = $eval_always: literal)?
|
||||||
) => {
|
) => {
|
||||||
declare_clippy_lint! {@
|
declare_clippy_lint! {@
|
||||||
$(#[doc = $lit])*
|
$(#[doc = $lit])*
|
||||||
pub $lint_name, Warn, crate::LintCategory::Suspicious, $desc,
|
pub $lint_name, Warn, crate::LintCategory::Suspicious, $desc,
|
||||||
Some($version), $version $(, $eval_always)?
|
Some($version), $version
|
||||||
|
$(, $eval_always)?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
(
|
(
|
||||||
@ -120,12 +126,13 @@ macro_rules! declare_clippy_lint {
|
|||||||
pub $lint_name:ident,
|
pub $lint_name:ident,
|
||||||
nursery,
|
nursery,
|
||||||
$desc:literal
|
$desc:literal
|
||||||
$(@eval_always = $eval_always: literal)?
|
$(, @eval_always = $eval_always: literal)?
|
||||||
) => {
|
) => {
|
||||||
declare_clippy_lint! {@
|
declare_clippy_lint! {@
|
||||||
$(#[doc = $lit])*
|
$(#[doc = $lit])*
|
||||||
pub $lint_name, Allow, crate::LintCategory::Nursery, $desc,
|
pub $lint_name, Allow, crate::LintCategory::Nursery, $desc,
|
||||||
Some($version), $version $(, $eval_always)?
|
Some($version), $version
|
||||||
|
$(, $eval_always)?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
(
|
(
|
||||||
@ -134,12 +141,13 @@ macro_rules! declare_clippy_lint {
|
|||||||
pub $lint_name:ident,
|
pub $lint_name:ident,
|
||||||
pedantic,
|
pedantic,
|
||||||
$desc:literal
|
$desc:literal
|
||||||
$(@eval_always = $eval_always: literal)?
|
$(, @eval_always = $eval_always: literal)?
|
||||||
) => {
|
) => {
|
||||||
declare_clippy_lint! {@
|
declare_clippy_lint! {@
|
||||||
$(#[doc = $lit])*
|
$(#[doc = $lit])*
|
||||||
pub $lint_name, Allow, crate::LintCategory::Pedantic, $desc,
|
pub $lint_name, Allow, crate::LintCategory::Pedantic, $desc,
|
||||||
Some($version), $version $(, $eval_always)?
|
Some($version), $version
|
||||||
|
$(, $eval_always)?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
(
|
(
|
||||||
@ -148,12 +156,13 @@ macro_rules! declare_clippy_lint {
|
|||||||
pub $lint_name:ident,
|
pub $lint_name:ident,
|
||||||
cargo,
|
cargo,
|
||||||
$desc:literal
|
$desc:literal
|
||||||
$(@eval_always = $eval_always: literal)?
|
$(, @eval_always = $eval_always: literal)?
|
||||||
) => {
|
) => {
|
||||||
declare_clippy_lint! {@
|
declare_clippy_lint! {@
|
||||||
$(#[doc = $lit])*
|
$(#[doc = $lit])*
|
||||||
pub $lint_name, Allow, crate::LintCategory::Cargo, $desc,
|
pub $lint_name, Allow, crate::LintCategory::Cargo, $desc,
|
||||||
Some($version), $version $(, $eval_always)?
|
Some($version), $version
|
||||||
|
$(, $eval_always)?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user