Skip to content

Commit 66b4674

Browse files
committed
Change lint name to plural
1 parent 2f48257 commit 66b4674

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+89
-79
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ Released 2021-09-09
965965
[#7407](https://github.com/rust-lang/rust-clippy/pull/7407)
966966
* [`redundant_allocation`]: Now additionally supports the `Arc<>` type
967967
[#7308](https://github.com/rust-lang/rust-clippy/pull/7308)
968-
* [`disallowed_name`]: Now allows disallowed names in test code
968+
* [`disallowed_names`]: Now allows disallowed names in test code
969969
[#7379](https://github.com/rust-lang/rust-clippy/pull/7379)
970970
* [`redundant_closure`]: Suggests `&mut` for `FnMut`
971971
[#7437](https://github.com/rust-lang/rust-clippy/pull/7437)
@@ -2066,7 +2066,7 @@ Released 2020-08-27
20662066
[#5692](https://github.com/rust-lang/rust-clippy/pull/5692)
20672067
* [`if_same_then_else`]: Don't assume multiplication is always commutative
20682068
[#5702](https://github.com/rust-lang/rust-clippy/pull/5702)
2069-
* [`disallowed_name`]: Remove `bar` from the default configuration
2069+
* [`disallowed_names`]: Remove `bar` from the default configuration
20702070
[#5712](https://github.com/rust-lang/rust-clippy/pull/5712)
20712071
* [`redundant_pattern_matching`]: Avoid suggesting non-`const fn` calls in const contexts
20722072
[#5724](https://github.com/rust-lang/rust-clippy/pull/5724)
@@ -3522,7 +3522,7 @@ Released 2018-09-13
35223522
[`derive_partial_eq_without_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq
35233523
[`disallowed_method`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_method
35243524
[`disallowed_methods`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods
3525-
[`disallowed_name`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_name
3525+
[`disallowed_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names
35263526
[`disallowed_script_idents`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_script_idents
35273527
[`disallowed_type`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_type
35283528
[`disallowed_types`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types

clippy_lints/src/disallowed_name.rs renamed to clippy_lints/src/disallowed_names.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ declare_clippy_lint! {
1818
/// let foo = 3.14;
1919
/// ```
2020
#[clippy::version = "pre 1.29.0"]
21-
pub DISALLOWED_NAME,
21+
pub DISALLOWED_NAMES,
2222
style,
2323
"usage of a disallowed/placeholder name"
2424
}
2525

2626
#[derive(Clone, Debug)]
27-
pub struct DisallowedName {
27+
pub struct DisallowedNames {
2828
disallow: FxHashSet<String>,
2929
test_modules_deep: u32,
3030
}
3131

32-
impl DisallowedName {
32+
impl DisallowedNames {
3333
pub fn new(disallow: FxHashSet<String>) -> Self {
3434
Self {
3535
disallow,
@@ -42,9 +42,9 @@ impl DisallowedName {
4242
}
4343
}
4444

45-
impl_lint_pass!(DisallowedName => [DISALLOWED_NAME]);
45+
impl_lint_pass!(DisallowedNames => [DISALLOWED_NAMES]);
4646

47-
impl<'tcx> LateLintPass<'tcx> for DisallowedName {
47+
impl<'tcx> LateLintPass<'tcx> for DisallowedNames {
4848
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
4949
if is_test_module_or_function(cx.tcx, item) {
5050
self.test_modules_deep = self.test_modules_deep.saturating_add(1);
@@ -61,7 +61,7 @@ impl<'tcx> LateLintPass<'tcx> for DisallowedName {
6161
if self.disallow.contains(&ident.name.to_string()) {
6262
span_lint(
6363
cx,
64-
DISALLOWED_NAME,
64+
DISALLOWED_NAMES,
6565
ident.span,
6666
&format!("use of a disallowed/placeholder name `{}`", ident.name),
6767
);

clippy_lints/src/lib.register_all.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
4646
LintId::of(derive::DERIVE_ORD_XOR_PARTIAL_ORD),
4747
LintId::of(derive::DERIVE_PARTIAL_EQ_WITHOUT_EQ),
4848
LintId::of(disallowed_methods::DISALLOWED_METHODS),
49-
LintId::of(disallowed_name::DISALLOWED_NAME),
49+
LintId::of(disallowed_names::DISALLOWED_NAMES),
5050
LintId::of(disallowed_types::DISALLOWED_TYPES),
5151
LintId::of(doc::MISSING_SAFETY_DOC),
5252
LintId::of(doc::NEEDLESS_DOCTEST_MAIN),

clippy_lints/src/lib.register_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ store.register_lints(&[
115115
derive::EXPL_IMPL_CLONE_ON_COPY,
116116
derive::UNSAFE_DERIVE_DESERIALIZE,
117117
disallowed_methods::DISALLOWED_METHODS,
118-
disallowed_name::DISALLOWED_NAME,
118+
disallowed_names::DISALLOWED_NAMES,
119119
disallowed_script_idents::DISALLOWED_SCRIPT_IDENTS,
120120
disallowed_types::DISALLOWED_TYPES,
121121
doc::DOC_MARKDOWN,

clippy_lints/src/lib.register_style.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ store.register_group(true, "clippy::style", Some("clippy_style"), vec![
1717
LintId::of(dereference::NEEDLESS_BORROW),
1818
LintId::of(derive::DERIVE_PARTIAL_EQ_WITHOUT_EQ),
1919
LintId::of(disallowed_methods::DISALLOWED_METHODS),
20-
LintId::of(disallowed_name::DISALLOWED_NAME),
20+
LintId::of(disallowed_names::DISALLOWED_NAMES),
2121
LintId::of(disallowed_types::DISALLOWED_TYPES),
2222
LintId::of(doc::MISSING_SAFETY_DOC),
2323
LintId::of(doc::NEEDLESS_DOCTEST_MAIN),

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ mod dereference;
204204
mod derivable_impls;
205205
mod derive;
206206
mod disallowed_methods;
207-
mod disallowed_name;
207+
mod disallowed_names;
208208
mod disallowed_script_idents;
209209
mod disallowed_types;
210210
mod doc;
@@ -684,7 +684,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
684684
store.register_late_pass(|| Box::new(overflow_check_conditional::OverflowCheckConditional));
685685
store.register_late_pass(|| Box::new(new_without_default::NewWithoutDefault::default()));
686686
let disallowed_names = conf.disallowed_names.iter().cloned().collect::<FxHashSet<_>>();
687-
store.register_late_pass(move || Box::new(disallowed_name::DisallowedName::new(disallowed_names.clone())));
687+
store.register_late_pass(move || Box::new(disallowed_names::DisallowedNames::new(disallowed_names.clone())));
688688
let too_many_arguments_threshold = conf.too_many_arguments_threshold;
689689
let too_many_lines_threshold = conf.too_many_lines_threshold;
690690
store.register_late_pass(move || {

clippy_lints/src/renamed_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub static RENAMED_LINTS: &[(&str, &str)] = &[
55
("clippy::block_in_if_condition_expr", "clippy::blocks_in_if_conditions"),
66
("clippy::block_in_if_condition_stmt", "clippy::blocks_in_if_conditions"),
77
("clippy::box_vec", "clippy::box_collection"),
8-
("clippy::blacklisted_name", "clippy::disallowed_name"),
8+
("clippy::blacklisted_name", "clippy::disallowed_names"),
99
("clippy::const_static_lifetime", "clippy::redundant_static_lifetimes"),
1010
("clippy::cyclomatic_complexity", "clippy::cognitive_complexity"),
1111
("clippy::disallowed_method", "clippy::disallowed_methods"),

clippy_lints/src/utils/conf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ define_Conf! {
231231
/// Use the Cognitive Complexity lint instead.
232232
#[conf_deprecated("Please use `cognitive-complexity-threshold` instead", cognitive_complexity_threshold)]
233233
(cyclomatic_complexity_threshold: u64 = 25),
234-
/// Lint: DISALLOWED_NAME.
234+
/// Lint: DISALLOWED_NAMES.
235235
///
236236
/// The list of disallowed names to lint about. NB: `bar` is not here since it has legitimate uses. The value
237237
/// `".."` can be used as part of the list to indicate, that the configured values should be appended to the

tests/ui-toml/disallowed_names_append/disallowed_names.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[warn(clippy::disallowed_name)]
1+
#[warn(clippy::disallowed_names)]
22

33
fn main() {
44
// `foo` is part of the default configuration

tests/ui-toml/disallowed_names_append/disallowed_names.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: use of a disallowed/placeholder name `foo`
44
LL | let foo = "bar";
55
| ^^^
66
|
7-
= note: `-D clippy::disallowed-name` implied by `-D warnings`
7+
= note: `-D clippy::disallowed-names` implied by `-D warnings`
88

99
error: use of a disallowed/placeholder name `ducks`
1010
--> $DIR/disallowed_names.rs:7:9

0 commit comments

Comments
 (0)