Skip to content

Commit a44adaa

Browse files
committed
Rename lint to MODULE_NAME_REPETITIONS
1 parent 60cc6b9 commit a44adaa

File tree

5 files changed

+20
-15
lines changed

5 files changed

+20
-15
lines changed

clippy_lints/src/enum_variants.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ declare_clippy_lint! {
7575
/// }
7676
/// ```
7777
declare_clippy_lint! {
78-
pub MODULE_NAME_REPEAT,
78+
pub MODULE_NAME_REPETITIONS,
7979
pedantic,
8080
"type names prefixed/postfixed with their containing module's name"
8181
}
@@ -126,7 +126,12 @@ impl EnumVariantNames {
126126

127127
impl LintPass for EnumVariantNames {
128128
fn get_lints(&self) -> LintArray {
129-
lint_array!(ENUM_VARIANT_NAMES, PUB_ENUM_VARIANT_NAMES, MODULE_NAME_REPEAT, MODULE_INCEPTION)
129+
lint_array!(
130+
ENUM_VARIANT_NAMES,
131+
PUB_ENUM_VARIANT_NAMES,
132+
MODULE_NAME_REPETITIONS,
133+
MODULE_INCEPTION
134+
)
130135
}
131136
}
132137

@@ -277,7 +282,7 @@ impl EarlyLintPass for EnumVariantNames {
277282
match item_camel.chars().nth(nchars) {
278283
Some(c) if is_word_beginning(c) => span_lint(
279284
cx,
280-
MODULE_NAME_REPEAT,
285+
MODULE_NAME_REPETITIONS,
281286
item.span,
282287
"item name starts with its containing module's name",
283288
),
@@ -287,7 +292,7 @@ impl EarlyLintPass for EnumVariantNames {
287292
if rmatching == nchars {
288293
span_lint(
289294
cx,
290-
MODULE_NAME_REPEAT,
295+
MODULE_NAME_REPETITIONS,
291296
item.span,
292297
"item name ends with its containing module's name",
293298
);

clippy_lints/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
517517
doc::DOC_MARKDOWN,
518518
empty_enum::EMPTY_ENUM,
519519
enum_glob_use::ENUM_GLOB_USE,
520-
enum_variants::MODULE_NAME_REPEAT,
520+
enum_variants::MODULE_NAME_REPETITIONS,
521521
enum_variants::PUB_ENUM_VARIANT_NAMES,
522522
if_not_else::IF_NOT_ELSE,
523523
infinite_iter::MAYBE_INFINITE_ITER,
@@ -1031,7 +1031,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
10311031
}
10321032

10331033
pub fn register_renamed(ls: &mut rustc::lint::LintStore) {
1034-
ls.register_renamed("clippy::stutter", "clippy::module_name_repeat");
1034+
ls.register_renamed("clippy::stutter", "clippy::module_name_repetitions");
10351035
}
10361036

10371037
// only exists to let the dogfood integration test works.

tests/ui/module_name_repeat.rs renamed to tests/ui/module_name_repetitions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10-
#![warn(clippy::module_name_repeat)]
10+
#![warn(clippy::module_name_repetitions)]
1111
#![allow(dead_code)]
1212

1313
mod foo {

tests/ui/module_name_repeat.stderr renamed to tests/ui/module_name_repetitions.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
error: item name starts with its containing module's name
2-
--> $DIR/module_name_repeat.rs:15:5
2+
--> $DIR/module_name_repetitions.rs:15:5
33
|
44
15 | pub fn foo_bar() {}
55
| ^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::module-name-repeat` implied by `-D warnings`
7+
= note: `-D clippy::module-name-repetitions` implied by `-D warnings`
88

99
error: item name ends with its containing module's name
10-
--> $DIR/module_name_repeat.rs:16:5
10+
--> $DIR/module_name_repetitions.rs:16:5
1111
|
1212
16 | pub fn bar_foo() {}
1313
| ^^^^^^^^^^^^^^^^^^^
1414

1515
error: item name starts with its containing module's name
16-
--> $DIR/module_name_repeat.rs:17:5
16+
--> $DIR/module_name_repetitions.rs:17:5
1717
|
1818
17 | pub struct FooCake {}
1919
| ^^^^^^^^^^^^^^^^^^^^^
2020

2121
error: item name ends with its containing module's name
22-
--> $DIR/module_name_repeat.rs:18:5
22+
--> $DIR/module_name_repetitions.rs:18:5
2323
|
2424
18 | pub enum CakeFoo {}
2525
| ^^^^^^^^^^^^^^^^^^^
2626

2727
error: item name starts with its containing module's name
28-
--> $DIR/module_name_repeat.rs:19:5
28+
--> $DIR/module_name_repetitions.rs:19:5
2929
|
3030
19 | pub struct Foo7Bar;
3131
| ^^^^^^^^^^^^^^^^^^^

tests/ui/rename.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ error: unknown lint: `stutter`
66
|
77
= note: `-D unknown-lints` implied by `-D warnings`
88

9-
error: lint `clippy::stutter` has been renamed to `clippy::module_name_repeat`
9+
error: lint `clippy::stutter` has been renamed to `clippy::module_name_repetitions`
1010
--> $DIR/rename.rs:12:8
1111
|
1212
12 | #[warn(clippy::stutter)]
13-
| ^^^^^^^^^^^^^^^ help: use the new name: `clippy::module_name_repeat`
13+
| ^^^^^^^^^^^^^^^ help: use the new name: `clippy::module_name_repetitions`
1414
|
1515
= note: `-D renamed-and-removed-lints` implied by `-D warnings`
1616

0 commit comments

Comments
 (0)