Skip to content

Commit 6c830ff

Browse files
committed
Run cargo dev new_lint
1 parent fb0d7f1 commit 6c830ff

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,6 +1877,7 @@ Released 2018-09-13
18771877
[`box_vec`]: https://rust-lang.github.io/rust-clippy/master/index.html#box_vec
18781878
[`boxed_local`]: https://rust-lang.github.io/rust-clippy/master/index.html#boxed_local
18791879
[`builtin_type_shadow`]: https://rust-lang.github.io/rust-clippy/master/index.html#builtin_type_shadow
1880+
[`capitalized_acronyms`]: https://rust-lang.github.io/rust-clippy/master/index.html#capitalized_acronyms
18801881
[`cargo_common_metadata`]: https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
18811882
[`case_sensitive_file_extension_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#case_sensitive_file_extension_comparisons
18821883
[`cast_lossless`]: https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
use rustc_lint::{EarlyLintPass, EarlyContext};
2+
use rustc_session::{declare_lint_pass, declare_tool_lint};
3+
use rustc_ast::ast::*;
4+
5+
declare_clippy_lint! {
6+
/// **What it does:**
7+
///
8+
/// **Why is this bad?**
9+
///
10+
/// **Known problems:** None.
11+
///
12+
/// **Example:**
13+
///
14+
/// ```rust
15+
/// // example code where clippy issues a warning
16+
/// ```
17+
/// Use instead:
18+
/// ```rust
19+
/// // example code which does not raise clippy warning
20+
/// ```
21+
pub CAPITALIZED_ACRONYMS,
22+
style,
23+
"default lint description"
24+
}
25+
26+
declare_lint_pass!(CapitalizedAcronyms => [CAPITALIZED_ACRONYMS]);
27+
28+
impl EarlyLintPass for CapitalizedAcronyms {}

clippy_lints/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ mod blacklisted_name;
169169
mod blocks_in_if_conditions;
170170
mod booleans;
171171
mod bytecount;
172+
mod capitalized_acronyms;
172173
mod cargo_common_metadata;
173174
mod case_sensitive_file_extension_comparisons;
174175
mod checked_conversions;
@@ -559,6 +560,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
559560
&booleans::LOGIC_BUG,
560561
&booleans::NONMINIMAL_BOOL,
561562
&bytecount::NAIVE_BYTECOUNT,
563+
&capitalized_acronyms::CAPITALIZED_ACRONYMS,
562564
&cargo_common_metadata::CARGO_COMMON_METADATA,
563565
&case_sensitive_file_extension_comparisons::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS,
564566
&checked_conversions::CHECKED_CONVERSIONS,

tests/ui/capitalized_acronyms.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![warn(clippy::capitalized_acronyms)]
2+
3+
fn main() {
4+
// test code goes here
5+
}

0 commit comments

Comments
 (0)