Skip to content

Commit

Permalink
Pluralize lint name
Browse files Browse the repository at this point in the history
  • Loading branch information
hkmatsumoto committed Nov 17, 2020
1 parent 1f577c0 commit c7445d7
Show file tree
Hide file tree
Showing 36 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,7 @@ Released 2018-09-13
[`unnecessary_operation`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation
[`unnecessary_sort_by`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by
[`unnecessary_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
[`unnecessary_wrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wrap
[`unnecessary_wraps`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
[`unneeded_field_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern
[`unneeded_wildcard_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_wildcard_pattern
[`unnested_or_patterns`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
Expand Down
10 changes: 5 additions & 5 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ mod unicode;
mod unit_return_expecting_ord;
mod unnamed_address;
mod unnecessary_sort_by;
mod unnecessary_wrap;
mod unnecessary_wraps;
mod unnested_or_patterns;
mod unsafe_removed_from_name;
mod unused_io_amount;
Expand Down Expand Up @@ -893,7 +893,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
&unnamed_address::FN_ADDRESS_COMPARISONS,
&unnamed_address::VTABLE_ADDRESS_COMPARISONS,
&unnecessary_sort_by::UNNECESSARY_SORT_BY,
&unnecessary_wrap::UNNECESSARY_WRAP,
&unnecessary_wraps::UNNECESSARY_WRAPS,
&unnested_or_patterns::UNNESTED_OR_PATTERNS,
&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME,
&unused_io_amount::UNUSED_IO_AMOUNT,
Expand Down Expand Up @@ -1066,7 +1066,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
store.register_late_pass(|| box redundant_clone::RedundantClone);
store.register_late_pass(|| box slow_vector_initialization::SlowVectorInit);
store.register_late_pass(|| box unnecessary_sort_by::UnnecessarySortBy);
store.register_late_pass(|| box unnecessary_wrap::UnnecessaryWrap);
store.register_late_pass(|| box unnecessary_wraps::UnnecessaryWraps);
store.register_late_pass(|| box types::RefToMut);
store.register_late_pass(|| box assertions_on_constants::AssertionsOnConstants);
store.register_late_pass(|| box missing_const_for_fn::MissingConstForFn);
Expand Down Expand Up @@ -1574,7 +1574,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&unnamed_address::FN_ADDRESS_COMPARISONS),
LintId::of(&unnamed_address::VTABLE_ADDRESS_COMPARISONS),
LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY),
LintId::of(&unnecessary_wrap::UNNECESSARY_WRAP),
LintId::of(&unnecessary_wraps::UNNECESSARY_WRAPS),
LintId::of(&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
LintId::of(&unused_io_amount::UNUSED_IO_AMOUNT),
LintId::of(&unused_unit::UNUSED_UNIT),
Expand Down Expand Up @@ -1779,7 +1779,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&types::UNNECESSARY_CAST),
LintId::of(&types::VEC_BOX),
LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY),
LintId::of(&unnecessary_wrap::UNNECESSARY_WRAP),
LintId::of(&unnecessary_wraps::UNNECESSARY_WRAPS),
LintId::of(&unwrap::UNNECESSARY_UNWRAP),
LintId::of(&useless_conversion::USELESS_CONVERSION),
LintId::of(&zero_div_zero::ZERO_DIVIDED_BY_ZERO),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ declare_clippy_lint! {
/// }
/// }
/// ```
pub UNNECESSARY_WRAP,
pub UNNECESSARY_WRAPS,
complexity,
"functions that only return `Ok` or `Some`"
}

declare_lint_pass!(UnnecessaryWrap => [UNNECESSARY_WRAP]);
declare_lint_pass!(UnnecessaryWraps => [UNNECESSARY_WRAPS]);

impl<'tcx> LateLintPass<'tcx> for UnnecessaryWrap {
impl<'tcx> LateLintPass<'tcx> for UnnecessaryWraps {
fn check_fn(
&mut self,
cx: &LateContext<'tcx>,
Expand Down Expand Up @@ -107,7 +107,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryWrap {
if can_sugg && !suggs.is_empty() {
span_lint_and_then(
cx,
UNNECESSARY_WRAP,
UNNECESSARY_WRAPS,
span,
format!(
"this function's return value is unnecessarily wrapped by `{}`",
Expand Down
4 changes: 2 additions & 2 deletions src/lintlist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2609,11 +2609,11 @@ vec![
module: "unwrap",
},
Lint {
name: "unnecessary_wrap",
name: "unnecessary_wraps",
group: "complexity",
desc: "functions that only return `Ok` or `Some`",
deprecation: None,
module: "unnecessary_wrap",
module: "unnecessary_wraps",
},
Lint {
name: "unneeded_field_pattern",
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/derive_ord_xor_partial_ord.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![warn(clippy::derive_ord_xor_partial_ord)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

use std::cmp::Ordering;

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/doc_errors.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// edition:2018
#![warn(clippy::missing_errors_doc)]
#![allow(clippy::result_unit_err)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

use std::io;

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/drop_ref.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![warn(clippy::drop_ref)]
#![allow(clippy::toplevel_ref_arg)]
#![allow(clippy::map_err_ignore)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

use std::mem::drop;

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/forget_ref.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![warn(clippy::forget_ref)]
#![allow(clippy::toplevel_ref_arg)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

use std::mem::forget;

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/let_underscore_must_use.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![warn(clippy::let_underscore_must_use)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

// Debug implementations can fire this lint,
// so we shouldn't lint external macros
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/manual_unwrap_or.fixed
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// run-rustfix
#![allow(dead_code)]
#![allow(unused_variables, clippy::unnecessary_wrap)]
#![allow(unused_variables, clippy::unnecessary_wraps)]

fn option_unwrap_or() {
// int case
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/manual_unwrap_or.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// run-rustfix
#![allow(dead_code)]
#![allow(unused_variables, clippy::unnecessary_wrap)]
#![allow(unused_variables, clippy::unnecessary_wraps)]

fn option_unwrap_or() {
// int case
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/map_err.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![warn(clippy::map_err_ignore)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]
use std::convert::TryFrom;
use std::error::Error;
use std::fmt;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/map_flatten.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#![allow(clippy::let_underscore_drop)]
#![allow(clippy::missing_docs_in_private_items)]
#![allow(clippy::map_identity)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

fn main() {
// mapping to Option on Iterator
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/map_flatten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#![allow(clippy::let_underscore_drop)]
#![allow(clippy::missing_docs_in_private_items)]
#![allow(clippy::map_identity)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

fn main() {
// mapping to Option on Iterator
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/needless_lifetimes.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![warn(clippy::needless_lifetimes)]
#![allow(dead_code, clippy::needless_pass_by_value, clippy::unnecessary_wrap)]
#![allow(dead_code, clippy::needless_pass_by_value, clippy::unnecessary_wraps)]

fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/option_map_unit_fn_fixable.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#![warn(clippy::option_map_unit_fn)]
#![allow(unused)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

fn do_nothing<T>(_: T) {}

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/option_map_unit_fn_fixable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#![warn(clippy::option_map_unit_fn)]
#![allow(unused)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

fn do_nothing<T>(_: T) {}

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/option_option.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![deny(clippy::option_option)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

fn input(_: Option<Option<u8>>) {}

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/or_fun_call.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#![warn(clippy::or_fun_call)]
#![allow(dead_code)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

use std::collections::BTreeMap;
use std::collections::HashMap;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/or_fun_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#![warn(clippy::or_fun_call)]
#![allow(dead_code)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

use std::collections::BTreeMap;
use std::collections::HashMap;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/panic_in_result_fn.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![warn(clippy::panic_in_result_fn)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

struct A;

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/question_mark.fixed
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// run-rustfix
#![allow(unreachable_code)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

fn some_func(a: Option<u32>) -> Option<u32> {
a?;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/question_mark.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// run-rustfix
#![allow(unreachable_code)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

fn some_func(a: Option<u32>) -> Option<u32> {
if a.is_none() {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/redundant_pattern_matching.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
unused_must_use,
clippy::needless_bool,
clippy::match_like_matches_macro,
clippy::unnecessary_wrap,
clippy::unnecessary_wraps,
deprecated
)]

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/redundant_pattern_matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
unused_must_use,
clippy::needless_bool,
clippy::match_like_matches_macro,
clippy::unnecessary_wrap,
clippy::unnecessary_wraps,
deprecated
)]

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/result_unit_error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]
#[warn(clippy::result_unit_err)]
#[allow(unused)]

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/try_err.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// aux-build:macro_rules.rs

#![deny(clippy::try_err)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

#[macro_use]
extern crate macro_rules;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/try_err.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// aux-build:macro_rules.rs

#![deny(clippy::try_err)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

#[macro_use]
extern crate macro_rules;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/unit_arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
unused_must_use,
unused_variables,
clippy::unused_unit,
clippy::unnecessary_wrap,
clippy::unnecessary_wraps,
clippy::or_fun_call
)]

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/unnecessary_clone.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// does not test any rustfixable lints

#![warn(clippy::clone_on_ref_ptr)]
#![allow(unused, clippy::redundant_clone, clippy::unnecessary_wrap)]
#![allow(unused, clippy::redundant_clone, clippy::unnecessary_wraps)]

use std::cell::RefCell;
use std::rc::{self, Rc};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![warn(clippy::unnecessary_wrap)]
#![warn(clippy::unnecessary_wraps)]
#![allow(clippy::no_effect)]
#![allow(clippy::needless_return)]
#![allow(clippy::if_same_then_else)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: this function's return value is unnecessarily wrapped by `Option`
--> $DIR/unnecessary_wrap.rs:8:1
--> $DIR/unnecessary_wraps.rs:8:1
|
LL | / fn func1(a: bool, b: bool) -> Option<i32> {
LL | | if a && b {
Expand All @@ -10,7 +10,7 @@ LL | | }
LL | | }
| |_^
|
= note: `-D clippy::unnecessary-wrap` implied by `-D warnings`
= note: `-D clippy::unnecessary-wraps` implied by `-D warnings`
help: remove `Option` from the return type...
|
LL | fn func1(a: bool, b: bool) -> i32 {
Expand All @@ -26,7 +26,7 @@ LL | } else {
...

error: this function's return value is unnecessarily wrapped by `Option`
--> $DIR/unnecessary_wrap.rs:21:1
--> $DIR/unnecessary_wraps.rs:21:1
|
LL | / fn func2(a: bool, b: bool) -> Option<i32> {
LL | | if a && b {
Expand All @@ -52,7 +52,7 @@ LL | 30
|

error: this function's return value is unnecessarily wrapped by `Option`
--> $DIR/unnecessary_wrap.rs:51:1
--> $DIR/unnecessary_wraps.rs:51:1
|
LL | / fn func5() -> Option<i32> {
LL | | Some(1)
Expand All @@ -69,7 +69,7 @@ LL | 1
|

error: this function's return value is unnecessarily wrapped by `Result`
--> $DIR/unnecessary_wrap.rs:61:1
--> $DIR/unnecessary_wraps.rs:61:1
|
LL | / fn func7() -> Result<i32, ()> {
LL | | Ok(1)
Expand All @@ -86,7 +86,7 @@ LL | 1
|

error: this function's return value is unnecessarily wrapped by `Option`
--> $DIR/unnecessary_wrap.rs:93:5
--> $DIR/unnecessary_wraps.rs:93:5
|
LL | / fn func12() -> Option<i32> {
LL | | Some(1)
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/useless_conversion.fixed
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// run-rustfix

#![deny(clippy::useless_conversion)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

fn test_generic<T: Copy>(val: T) -> T {
let _ = val;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/useless_conversion.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// run-rustfix

#![deny(clippy::useless_conversion)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]

fn test_generic<T: Copy>(val: T) -> T {
let _ = T::from(val);
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/wildcard_imports.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#![warn(clippy::wildcard_imports)]
//#![allow(clippy::redundant_pub_crate)]
#![allow(unused)]
#![allow(clippy::unnecessary_wrap)]
#![allow(clippy::unnecessary_wraps)]
#![warn(unused_imports)]

extern crate wildcard_imports_helper;
Expand Down
Loading

0 comments on commit c7445d7

Please sign in to comment.