diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-11-19 16:01:38 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-11-22 14:57:20 +0100 |
| commit | 607a3f6c08b489f9bd71ce11a00b112c3e5c612d (patch) | |
| tree | 66fd1a039edad89c82f8fec74cd082e9735051fa | |
| parent | b20b75a904c5fa0e461c88bab64370b1d3bf69b9 (diff) | |
| download | rust-607a3f6c08b489f9bd71ce11a00b112c3e5c612d.tar.gz rust-607a3f6c08b489f9bd71ce11a00b112c3e5c612d.zip | |
Rename `literal_string_with_formatting_arg` into `literal_string_with_formatting_args`
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | clippy_dev/src/lib.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/declared_lints.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/lib.rs | 6 | ||||
| -rw-r--r-- | clippy_lints/src/literal_string_with_formatting_args.rs (renamed from clippy_lints/src/literal_string_with_formatting_arg.rs) | 8 | ||||
| -rw-r--r-- | tests/ui-toml/large_include_file/large_include_file.rs | 2 | ||||
| -rw-r--r-- | tests/ui/auxiliary/proc_macro_derive.rs | 2 | ||||
| -rw-r--r-- | tests/ui/format.fixed | 2 | ||||
| -rw-r--r-- | tests/ui/format.rs | 2 | ||||
| -rw-r--r-- | tests/ui/literal_string_with_formatting_arg.rs | 22 | ||||
| -rw-r--r-- | tests/ui/literal_string_with_formatting_arg.stderr | 22 | ||||
| -rw-r--r-- | tests/ui/print_literal.fixed | 2 | ||||
| -rw-r--r-- | tests/ui/print_literal.rs | 2 | ||||
| -rw-r--r-- | tests/ui/regex.rs | 2 | ||||
| -rw-r--r-- | tests/ui/uninlined_format_args_panic.edition2018.fixed | 2 | ||||
| -rw-r--r-- | tests/ui/uninlined_format_args_panic.edition2021.fixed | 2 | ||||
| -rw-r--r-- | tests/ui/uninlined_format_args_panic.rs | 2 |
17 files changed, 42 insertions, 42 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a82bfce82b..efa6ed9f1bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5639,7 +5639,7 @@ Released 2018-09-13 [`lines_filter_map_ok`]: https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [`linkedlist`]: https://rust-lang.github.io/rust-clippy/master/index.html#linkedlist [`lint_groups_priority`]: https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority -[`literal_string_with_formatting_arg`]: https://rust-lang.github.io/rust-clippy/master/index.html#literal_string_with_formatting_arg +[`literal_string_with_formatting_args`]: https://rust-lang.github.io/rust-clippy/master/index.html#literal_string_with_formatting_args [`little_endian_bytes`]: https://rust-lang.github.io/rust-clippy/master/index.html#little_endian_bytes [`logic_bug`]: https://rust-lang.github.io/rust-clippy/master/index.html#logic_bug [`lossy_float_literal`]: https://rust-lang.github.io/rust-clippy/master/index.html#lossy_float_literal diff --git a/clippy_dev/src/lib.rs b/clippy_dev/src/lib.rs index 1f4560eaecf..ad385d5fbd2 100644 --- a/clippy_dev/src/lib.rs +++ b/clippy_dev/src/lib.rs @@ -7,7 +7,7 @@ unused_lifetimes, unused_qualifications )] -#![allow(clippy::missing_panics_doc, clippy::literal_string_with_formatting_arg)] +#![allow(clippy::missing_panics_doc)] // The `rustc_driver` crate seems to be required in order to use the `rust_lexer` crate. #[allow(unused_extern_crates)] diff --git a/clippy_lints/src/declared_lints.rs b/clippy_lints/src/declared_lints.rs index a3f89b3f70c..1143c7e10b2 100644 --- a/clippy_lints/src/declared_lints.rs +++ b/clippy_lints/src/declared_lints.rs @@ -276,7 +276,7 @@ pub static LINTS: &[&crate::LintInfo] = &[ crate::literal_representation::MISTYPED_LITERAL_SUFFIXES_INFO, crate::literal_representation::UNREADABLE_LITERAL_INFO, crate::literal_representation::UNUSUAL_BYTE_GROUPINGS_INFO, - crate::literal_string_with_formatting_arg::LITERAL_STRING_WITH_FORMATTING_ARG_INFO, + crate::literal_string_with_formatting_args::LITERAL_STRING_WITH_FORMATTING_ARGS_INFO, crate::loops::EMPTY_LOOP_INFO, crate::loops::EXPLICIT_COUNTER_LOOP_INFO, crate::loops::EXPLICIT_INTO_ITER_LOOP_INFO, diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 051e7653934..4f003377a5e 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -18,7 +18,7 @@ clippy::must_use_candidate, rustc::diagnostic_outside_of_impl, rustc::untranslatable_diagnostic, - clippy::literal_string_with_formatting_arg + clippy::literal_string_with_formatting_args )] #![warn( trivial_casts, @@ -198,7 +198,7 @@ mod let_with_type_underscore; mod lifetimes; mod lines_filter_map_ok; mod literal_representation; -mod literal_string_with_formatting_arg; +mod literal_string_with_formatting_args; mod loops; mod macro_metavars_in_unsafe; mod macro_use; @@ -962,7 +962,7 @@ pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) { store.register_late_pass(move |_| Box::new(manual_div_ceil::ManualDivCeil::new(conf))); store.register_late_pass(|_| Box::new(manual_is_power_of_two::ManualIsPowerOfTwo)); store.register_late_pass(|_| Box::new(non_zero_suggestions::NonZeroSuggestions)); - store.register_early_pass(|| Box::new(literal_string_with_formatting_arg::LiteralStringWithFormattingArg)); + store.register_early_pass(|| Box::new(literal_string_with_formatting_args::LiteralStringWithFormattingArg)); store.register_late_pass(move |_| Box::new(unused_trait_names::UnusedTraitNames::new(conf))); store.register_late_pass(|_| Box::new(manual_ignore_case_cmp::ManualIgnoreCaseCmp)); store.register_late_pass(|_| Box::new(unnecessary_literal_bound::UnnecessaryLiteralBound)); diff --git a/clippy_lints/src/literal_string_with_formatting_arg.rs b/clippy_lints/src/literal_string_with_formatting_args.rs index a05ca4a2681..6514a72a44d 100644 --- a/clippy_lints/src/literal_string_with_formatting_arg.rs +++ b/clippy_lints/src/literal_string_with_formatting_args.rs @@ -28,12 +28,12 @@ declare_clippy_lint! { /// x.expect(&format!("{y:?}")); /// ``` #[clippy::version = "1.83.0"] - pub LITERAL_STRING_WITH_FORMATTING_ARG, + pub LITERAL_STRING_WITH_FORMATTING_ARGS, suspicious, "Checks if string literals have formatting arguments" } -declare_lint_pass!(LiteralStringWithFormattingArg => [LITERAL_STRING_WITH_FORMATTING_ARG]); +declare_lint_pass!(LiteralStringWithFormattingArg => [LITERAL_STRING_WITH_FORMATTING_ARGS]); impl EarlyLintPass for LiteralStringWithFormattingArg { fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { @@ -94,7 +94,7 @@ impl EarlyLintPass for LiteralStringWithFormattingArg { 1 => { span_lint( cx, - LITERAL_STRING_WITH_FORMATTING_ARG, + LITERAL_STRING_WITH_FORMATTING_ARGS, spans, "this looks like a formatting argument but it is not part of a formatting macro", ); @@ -102,7 +102,7 @@ impl EarlyLintPass for LiteralStringWithFormattingArg { _ => { span_lint( cx, - LITERAL_STRING_WITH_FORMATTING_ARG, + LITERAL_STRING_WITH_FORMATTING_ARGS, spans, "these look like formatting arguments but are not part of a formatting macro", ); diff --git a/tests/ui-toml/large_include_file/large_include_file.rs b/tests/ui-toml/large_include_file/large_include_file.rs index c456b48daca..184c6d17ba4 100644 --- a/tests/ui-toml/large_include_file/large_include_file.rs +++ b/tests/ui-toml/large_include_file/large_include_file.rs @@ -1,5 +1,5 @@ #![warn(clippy::large_include_file)] -#![allow(clippy::literal_string_with_formatting_arg)] +#![allow(clippy::literal_string_with_formatting_args)] // Good const GOOD_INCLUDE_BYTES: &[u8; 68] = include_bytes!("../../ui/author.rs"); diff --git a/tests/ui/auxiliary/proc_macro_derive.rs b/tests/ui/auxiliary/proc_macro_derive.rs index 33fbea08003..1815dd58f51 100644 --- a/tests/ui/auxiliary/proc_macro_derive.rs +++ b/tests/ui/auxiliary/proc_macro_derive.rs @@ -2,7 +2,7 @@ #![allow(incomplete_features)] #![allow(clippy::field_reassign_with_default)] #![allow(clippy::eq_op)] -#![allow(clippy::literal_string_with_formatting_arg)] +#![allow(clippy::literal_string_with_formatting_args)] extern crate proc_macro; diff --git a/tests/ui/format.fixed b/tests/ui/format.fixed index df4ac2d1a22..3dc8eb79ba2 100644 --- a/tests/ui/format.fixed +++ b/tests/ui/format.fixed @@ -7,7 +7,7 @@ clippy::uninlined_format_args, clippy::needless_raw_string_hashes, clippy::useless_vec, - clippy::literal_string_with_formatting_arg + clippy::literal_string_with_formatting_args )] struct Foo(pub String); diff --git a/tests/ui/format.rs b/tests/ui/format.rs index 30d8ff38f26..eaf33c2a6c9 100644 --- a/tests/ui/format.rs +++ b/tests/ui/format.rs @@ -7,7 +7,7 @@ clippy::uninlined_format_args, clippy::needless_raw_string_hashes, clippy::useless_vec, - clippy::literal_string_with_formatting_arg + clippy::literal_string_with_formatting_args )] struct Foo(pub String); diff --git a/tests/ui/literal_string_with_formatting_arg.rs b/tests/ui/literal_string_with_formatting_arg.rs index d623ab524fb..fdb8ba60621 100644 --- a/tests/ui/literal_string_with_formatting_arg.rs +++ b/tests/ui/literal_string_with_formatting_arg.rs @@ -1,20 +1,20 @@ -#![warn(clippy::literal_string_with_formatting_arg)] +#![warn(clippy::literal_string_with_formatting_args)] #![allow(clippy::unnecessary_literal_unwrap)] fn main() { let x: Option<usize> = None; let y = "hello"; - x.expect("{y} {}"); //~ literal_string_with_formatting_arg - x.expect(" {y} bla"); //~ literal_string_with_formatting_arg - x.expect("{:?}"); //~ literal_string_with_formatting_arg - x.expect("{y:?}"); //~ literal_string_with_formatting_arg - x.expect(" {y:?} {y:?} "); //~ literal_string_with_formatting_arg - x.expect(" {y:..} {y:?} "); //~ literal_string_with_formatting_arg - x.expect(r"{y:?} {y:?} "); //~ literal_string_with_formatting_arg - x.expect(r"{y:?} y:?}"); //~ literal_string_with_formatting_arg - x.expect(r##" {y:?} {y:?} "##); //~ literal_string_with_formatting_arg + x.expect("{y} {}"); //~ literal_string_with_formatting_args + x.expect(" {y} bla"); //~ literal_string_with_formatting_args + x.expect("{:?}"); //~ literal_string_with_formatting_args + x.expect("{y:?}"); //~ literal_string_with_formatting_args + x.expect(" {y:?} {y:?} "); //~ literal_string_with_formatting_args + x.expect(" {y:..} {y:?} "); //~ literal_string_with_formatting_args + x.expect(r"{y:?} {y:?} "); //~ literal_string_with_formatting_args + x.expect(r"{y:?} y:?}"); //~ literal_string_with_formatting_args + x.expect(r##" {y:?} {y:?} "##); //~ literal_string_with_formatting_args // Ensure that it doesn't try to go in the middle of a unicode character. - x.expect("———{:?}"); //~ literal_string_with_formatting_arg + x.expect("———{:?}"); //~ literal_string_with_formatting_args // Should not lint! format!("{y:?}"); diff --git a/tests/ui/literal_string_with_formatting_arg.stderr b/tests/ui/literal_string_with_formatting_arg.stderr index da7eb71ac87..515ae978f7a 100644 --- a/tests/ui/literal_string_with_formatting_arg.stderr +++ b/tests/ui/literal_string_with_formatting_arg.stderr @@ -1,62 +1,62 @@ error: this looks like a formatting argument but it is not part of a formatting macro - --> tests/ui/literal_string_with_formatting_arg.rs:7:15 + --> tests/ui/literal_string_with_formatting_args.rs:7:15 | LL | x.expect("{y} {}"); | ^^^ | = note: `-D clippy::literal-string-with-formatting-arg` implied by `-D warnings` - = help: to override `-D warnings` add `#[allow(clippy::literal_string_with_formatting_arg)]` + = help: to override `-D warnings` add `#[allow(clippy::literal_string_with_formatting_args)]` error: this looks like a formatting argument but it is not part of a formatting macro - --> tests/ui/literal_string_with_formatting_arg.rs:8:16 + --> tests/ui/literal_string_with_formatting_args.rs:8:16 | LL | x.expect(" {y} bla"); | ^^^ error: this looks like a formatting argument but it is not part of a formatting macro - --> tests/ui/literal_string_with_formatting_arg.rs:9:15 + --> tests/ui/literal_string_with_formatting_args.rs:9:15 | LL | x.expect("{:?}"); | ^^^^ error: this looks like a formatting argument but it is not part of a formatting macro - --> tests/ui/literal_string_with_formatting_arg.rs:10:15 + --> tests/ui/literal_string_with_formatting_args.rs:10:15 | LL | x.expect("{y:?}"); | ^^^^^ error: these look like formatting arguments but are not part of a formatting macro - --> tests/ui/literal_string_with_formatting_arg.rs:11:16 + --> tests/ui/literal_string_with_formatting_args.rs:11:16 | LL | x.expect(" {y:?} {y:?} "); | ^^^^^ ^^^^^ error: this looks like a formatting argument but it is not part of a formatting macro - --> tests/ui/literal_string_with_formatting_arg.rs:12:23 + --> tests/ui/literal_string_with_formatting_args.rs:12:23 | LL | x.expect(" {y:..} {y:?} "); | ^^^^^ error: these look like formatting arguments but are not part of a formatting macro - --> tests/ui/literal_string_with_formatting_arg.rs:13:16 + --> tests/ui/literal_string_with_formatting_args.rs:13:16 | LL | x.expect(r"{y:?} {y:?} "); | ^^^^^ ^^^^^ error: this looks like a formatting argument but it is not part of a formatting macro - --> tests/ui/literal_string_with_formatting_arg.rs:14:16 + --> tests/ui/literal_string_with_formatting_args.rs:14:16 | LL | x.expect(r"{y:?} y:?}"); | ^^^^^ error: these look like formatting arguments but are not part of a formatting macro - --> tests/ui/literal_string_with_formatting_arg.rs:15:19 + --> tests/ui/literal_string_with_formatting_args.rs:15:19 | LL | x.expect(r##" {y:?} {y:?} "##); | ^^^^^ ^^^^^ error: this looks like a formatting argument but it is not part of a formatting macro - --> tests/ui/literal_string_with_formatting_arg.rs:17:18 + --> tests/ui/literal_string_with_formatting_args.rs:17:18 | LL | x.expect("———{:?}"); | ^^^^ diff --git a/tests/ui/print_literal.fixed b/tests/ui/print_literal.fixed index 8c0cedf6299..1705a7ff01b 100644 --- a/tests/ui/print_literal.fixed +++ b/tests/ui/print_literal.fixed @@ -1,5 +1,5 @@ #![warn(clippy::print_literal)] -#![allow(clippy::uninlined_format_args, clippy::literal_string_with_formatting_arg)] +#![allow(clippy::uninlined_format_args, clippy::literal_string_with_formatting_args)] fn main() { // these should be fine diff --git a/tests/ui/print_literal.rs b/tests/ui/print_literal.rs index 1df4f4181e9..d10b26b5887 100644 --- a/tests/ui/print_literal.rs +++ b/tests/ui/print_literal.rs @@ -1,5 +1,5 @@ #![warn(clippy::print_literal)] -#![allow(clippy::uninlined_format_args, clippy::literal_string_with_formatting_arg)] +#![allow(clippy::uninlined_format_args, clippy::literal_string_with_formatting_args)] fn main() { // these should be fine diff --git a/tests/ui/regex.rs b/tests/ui/regex.rs index ea5c8354928..adead5ef33c 100644 --- a/tests/ui/regex.rs +++ b/tests/ui/regex.rs @@ -4,7 +4,7 @@ clippy::needless_raw_string_hashes, clippy::needless_borrow, clippy::needless_borrows_for_generic_args, - clippy::literal_string_with_formatting_arg + clippy::literal_string_with_formatting_args )] #![warn(clippy::invalid_regex, clippy::trivial_regex, clippy::regex_creation_in_loops)] diff --git a/tests/ui/uninlined_format_args_panic.edition2018.fixed b/tests/ui/uninlined_format_args_panic.edition2018.fixed index 130187d19d6..9911d131707 100644 --- a/tests/ui/uninlined_format_args_panic.edition2018.fixed +++ b/tests/ui/uninlined_format_args_panic.edition2018.fixed @@ -3,7 +3,7 @@ //@[edition2021] edition:2021 #![warn(clippy::uninlined_format_args)] -#![allow(clippy::literal_string_with_formatting_arg)] +#![allow(clippy::literal_string_with_formatting_args)] fn main() { let var = 1; diff --git a/tests/ui/uninlined_format_args_panic.edition2021.fixed b/tests/ui/uninlined_format_args_panic.edition2021.fixed index 63b30c64025..87b74670565 100644 --- a/tests/ui/uninlined_format_args_panic.edition2021.fixed +++ b/tests/ui/uninlined_format_args_panic.edition2021.fixed @@ -3,7 +3,7 @@ //@[edition2021] edition:2021 #![warn(clippy::uninlined_format_args)] -#![allow(clippy::literal_string_with_formatting_arg)] +#![allow(clippy::literal_string_with_formatting_args)] fn main() { let var = 1; diff --git a/tests/ui/uninlined_format_args_panic.rs b/tests/ui/uninlined_format_args_panic.rs index 9402cea878d..647c69bc5c4 100644 --- a/tests/ui/uninlined_format_args_panic.rs +++ b/tests/ui/uninlined_format_args_panic.rs @@ -3,7 +3,7 @@ //@[edition2021] edition:2021 #![warn(clippy::uninlined_format_args)] -#![allow(clippy::literal_string_with_formatting_arg)] +#![allow(clippy::literal_string_with_formatting_args)] fn main() { let var = 1; |
