Run cargo dev new_lint

This commit is contained in:
Hirochika Matsumoto 2020-12-19 18:57:11 +09:00
parent fb0d7f1714
commit 6c830ff9e4
4 changed files with 36 additions and 0 deletions

View File

@ -1877,6 +1877,7 @@ Released 2018-09-13
[`box_vec`]: https://rust-lang.github.io/rust-clippy/master/index.html#box_vec
[`boxed_local`]: https://rust-lang.github.io/rust-clippy/master/index.html#boxed_local
[`builtin_type_shadow`]: https://rust-lang.github.io/rust-clippy/master/index.html#builtin_type_shadow
[`capitalized_acronyms`]: https://rust-lang.github.io/rust-clippy/master/index.html#capitalized_acronyms
[`cargo_common_metadata`]: https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
[`case_sensitive_file_extension_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#case_sensitive_file_extension_comparisons
[`cast_lossless`]: https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless

View File

@ -0,0 +1,28 @@
use rustc_lint::{EarlyLintPass, EarlyContext};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_ast::ast::*;
declare_clippy_lint! {
/// **What it does:**
///
/// **Why is this bad?**
///
/// **Known problems:** None.
///
/// **Example:**
///
/// ```rust
/// // example code where clippy issues a warning
/// ```
/// Use instead:
/// ```rust
/// // example code which does not raise clippy warning
/// ```
pub CAPITALIZED_ACRONYMS,
style,
"default lint description"
}
declare_lint_pass!(CapitalizedAcronyms => [CAPITALIZED_ACRONYMS]);
impl EarlyLintPass for CapitalizedAcronyms {}

View File

@ -169,6 +169,7 @@ mod blacklisted_name;
mod blocks_in_if_conditions;
mod booleans;
mod bytecount;
mod capitalized_acronyms;
mod cargo_common_metadata;
mod case_sensitive_file_extension_comparisons;
mod checked_conversions;
@ -559,6 +560,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
&booleans::LOGIC_BUG,
&booleans::NONMINIMAL_BOOL,
&bytecount::NAIVE_BYTECOUNT,
&capitalized_acronyms::CAPITALIZED_ACRONYMS,
&cargo_common_metadata::CARGO_COMMON_METADATA,
&case_sensitive_file_extension_comparisons::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS,
&checked_conversions::CHECKED_CONVERSIONS,

View File

@ -0,0 +1,5 @@
#![warn(clippy::capitalized_acronyms)]
fn main() {
// test code goes here
}