Skip to content

Commit 02a9517

Browse files
committed
Follow lint naming conventions.
1 parent 90ff6d5 commit 02a9517

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ Released 2018-09-13
12841284
[`should_implement_trait`]: https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
12851285
[`similar_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#similar_names
12861286
[`single_char_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
1287-
[`single_component_use_path`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_component_use_path
1287+
[`single_component_path_imports`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
12881288
[`single_match`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_match
12891289
[`single_match_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else
12901290
[`skip_while_next`]: https://rust-lang.github.io/rust-clippy/master/index.html#skip_while_next

clippy_lints/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ pub mod replace_consts;
284284
pub mod returns;
285285
pub mod serde_api;
286286
pub mod shadow;
287-
pub mod single_component_use_path;
287+
pub mod single_component_path_imports;
288288
pub mod slow_vector_initialization;
289289
pub mod strings;
290290
pub mod suspicious_trait_impl;
@@ -742,7 +742,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
742742
&shadow::SHADOW_REUSE,
743743
&shadow::SHADOW_SAME,
744744
&shadow::SHADOW_UNRELATED,
745-
&single_component_use_path::SINGLE_COMPONENT_USE_PATH,
745+
&single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS,
746746
&slow_vector_initialization::SLOW_VECTOR_INITIALIZATION,
747747
&strings::STRING_ADD,
748748
&strings::STRING_ADD_ASSIGN,
@@ -995,7 +995,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
995995
store.register_early_pass(|| box utils::internal_lints::ProduceIce);
996996
store.register_late_pass(|| box let_underscore::LetUnderscore);
997997
store.register_late_pass(|| box atomic_ordering::AtomicOrdering);
998-
store.register_early_pass(|| box single_component_use_path::SingleComponentUsePath);
998+
store.register_early_pass(|| box single_component_path_imports::SingleComponentPathImports);
999999

10001000
store.register_group(true, "clippy::restriction", Some("clippy_restriction"), vec![
10011001
LintId::of(&arithmetic::FLOAT_ARITHMETIC),
@@ -1299,7 +1299,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
12991299
LintId::of(&returns::NEEDLESS_RETURN),
13001300
LintId::of(&returns::UNUSED_UNIT),
13011301
LintId::of(&serde_api::SERDE_API_MISUSE),
1302-
LintId::of(&single_component_use_path::SINGLE_COMPONENT_USE_PATH),
1302+
LintId::of(&single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
13031303
LintId::of(&slow_vector_initialization::SLOW_VECTOR_INITIALIZATION),
13041304
LintId::of(&strings::STRING_LIT_AS_BYTES),
13051305
LintId::of(&suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL),
@@ -1435,7 +1435,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
14351435
LintId::of(&returns::LET_AND_RETURN),
14361436
LintId::of(&returns::NEEDLESS_RETURN),
14371437
LintId::of(&returns::UNUSED_UNIT),
1438-
LintId::of(&single_component_use_path::SINGLE_COMPONENT_USE_PATH),
1438+
LintId::of(&single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
14391439
LintId::of(&strings::STRING_LIT_AS_BYTES),
14401440
LintId::of(&tabs_in_doc_comments::TABS_IN_DOC_COMMENTS),
14411441
LintId::of(&to_digit_is_some::TO_DIGIT_IS_SOME),

clippy_lints/src/single_component_use_path.rs renamed to clippy_lints/src/single_component_path_imports.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ declare_clippy_lint! {
1010
/// **What it does:** Checking for imports with single component use path.
1111
///
1212
/// **Why is this bad?** Import with single component use path such as `use cratename;`
13-
/// is not necessary in order to use the crate.
13+
/// is not necessary, and thus should be removed.
1414
///
1515
/// **Known problems:** None.
1616
///
@@ -20,17 +20,17 @@ declare_clippy_lint! {
2020
/// use regex;
2121
///
2222
/// fn main() {
23-
/// regex::Regex::new(r"^\d{4}-\d{2}-\d{2}$");
23+
/// regex::Regex::new(r"^\d{4}-\d{2}-\d{2}$").unwrap();
2424
/// }
2525
///```
26-
pub SINGLE_COMPONENT_USE_PATH,
26+
pub SINGLE_COMPONENT_PATH_IMPORTS,
2727
style,
28-
"use with single component path is redundant"
28+
"imports with single component path are redundant"
2929
}
3030

31-
declare_lint_pass!(SingleComponentUsePath => [SINGLE_COMPONENT_USE_PATH]);
31+
declare_lint_pass!(SingleComponentPathImports => [SINGLE_COMPONENT_PATH_IMPORTS]);
3232

33-
impl EarlyLintPass for SingleComponentUsePath {
33+
impl EarlyLintPass for SingleComponentPathImports {
3434
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
3535
if_chain! {
3636
if cx.sess.opts.edition == Edition::Edition2018;
@@ -41,7 +41,7 @@ impl EarlyLintPass for SingleComponentUsePath {
4141
then {
4242
span_lint_and_sugg(
4343
cx,
44-
SINGLE_COMPONENT_USE_PATH,
44+
SINGLE_COMPONENT_PATH_IMPORTS,
4545
item.span,
4646
"this import is redundant",
4747
"remove it entirely",

src/lintlist/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,11 +1856,11 @@ pub const ALL_LINTS: [Lint; 349] = [
18561856
module: "methods",
18571857
},
18581858
Lint {
1859-
name: "single_component_use_path",
1859+
name: "single_component_path_imports",
18601860
group: "style",
1861-
desc: "use with single component path is redundant in 2018 edition",
1861+
desc: "imports with single component path are redundant",
18621862
deprecation: None,
1863-
module: "single_component_use_path",
1863+
module: "single_component_path_imports",
18641864
},
18651865
Lint {
18661866
name: "single_match",

tests/ui/single_component_use_path.fixed renamed to tests/ui/single_component_path_imports.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22
// compile-flags: --edition 2018
3-
#![warn(clippy::single_component_use_path)]
3+
#![warn(clippy::single_component_path_imports)]
44

55

66

tests/ui/single_component_use_path.rs renamed to tests/ui/single_component_path_imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22
// compile-flags: --edition 2018
3-
#![warn(clippy::single_component_use_path)]
3+
#![warn(clippy::single_component_path_imports)]
44

55
use regex;
66

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
error: this import is redundant
2-
--> $DIR/single_component_use_path.rs:5:1
2+
--> $DIR/single_component_path_imports.rs:5:1
33
|
44
LL | use regex;
55
| ^^^^^^^^^^ help: remove it entirely
66
|
7-
= note: `-D clippy::single-component-use-path` implied by `-D warnings`
7+
= note: `-D clippy::single-component-path-imports` implied by `-D warnings`
88

99
error: aborting due to previous error
1010

0 commit comments

Comments
 (0)