Skip to content

Commit 193320b

Browse files
Rename literal_string_with_formatting_arg into literal_string_with_formatting_args
1 parent f8ccb10 commit 193320b

17 files changed

+42
-42
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5639,7 +5639,7 @@ Released 2018-09-13
56395639
[`lines_filter_map_ok`]: https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok
56405640
[`linkedlist`]: https://rust-lang.github.io/rust-clippy/master/index.html#linkedlist
56415641
[`lint_groups_priority`]: https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
5642-
[`literal_string_with_formatting_arg`]: https://rust-lang.github.io/rust-clippy/master/index.html#literal_string_with_formatting_arg
5642+
[`literal_string_with_formatting_args`]: https://rust-lang.github.io/rust-clippy/master/index.html#literal_string_with_formatting_args
56435643
[`little_endian_bytes`]: https://rust-lang.github.io/rust-clippy/master/index.html#little_endian_bytes
56445644
[`logic_bug`]: https://rust-lang.github.io/rust-clippy/master/index.html#logic_bug
56455645
[`lossy_float_literal`]: https://rust-lang.github.io/rust-clippy/master/index.html#lossy_float_literal

clippy_dev/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
unused_lifetimes,
88
unused_qualifications
99
)]
10-
#![allow(clippy::missing_panics_doc, clippy::literal_string_with_formatting_arg)]
10+
#![allow(clippy::missing_panics_doc, clippy::literal_string_with_formatting_args)]
1111

1212
// The `rustc_driver` crate seems to be required in order to use the `rust_lexer` crate.
1313
#[allow(unused_extern_crates)]

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ pub static LINTS: &[&crate::LintInfo] = &[
276276
crate::literal_representation::MISTYPED_LITERAL_SUFFIXES_INFO,
277277
crate::literal_representation::UNREADABLE_LITERAL_INFO,
278278
crate::literal_representation::UNUSUAL_BYTE_GROUPINGS_INFO,
279-
crate::literal_string_with_formatting_arg::LITERAL_STRING_WITH_FORMATTING_ARG_INFO,
279+
crate::literal_string_with_formatting_args::LITERAL_STRING_WITH_FORMATTING_ARGS_INFO,
280280
crate::loops::EMPTY_LOOP_INFO,
281281
crate::loops::EXPLICIT_COUNTER_LOOP_INFO,
282282
crate::loops::EXPLICIT_INTO_ITER_LOOP_INFO,

clippy_lints/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
clippy::must_use_candidate,
1919
rustc::diagnostic_outside_of_impl,
2020
rustc::untranslatable_diagnostic,
21-
clippy::literal_string_with_formatting_arg
21+
clippy::literal_string_with_formatting_args
2222
)]
2323
#![warn(
2424
trivial_casts,
@@ -198,7 +198,7 @@ mod let_with_type_underscore;
198198
mod lifetimes;
199199
mod lines_filter_map_ok;
200200
mod literal_representation;
201-
mod literal_string_with_formatting_arg;
201+
mod literal_string_with_formatting_args;
202202
mod loops;
203203
mod macro_metavars_in_unsafe;
204204
mod macro_use;
@@ -962,7 +962,7 @@ pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
962962
store.register_late_pass(move |_| Box::new(manual_div_ceil::ManualDivCeil::new(conf)));
963963
store.register_late_pass(|_| Box::new(manual_is_power_of_two::ManualIsPowerOfTwo));
964964
store.register_late_pass(|_| Box::new(non_zero_suggestions::NonZeroSuggestions));
965-
store.register_early_pass(|| Box::new(literal_string_with_formatting_arg::LiteralStringWithFormattingArg));
965+
store.register_early_pass(|| Box::new(literal_string_with_formatting_args::LiteralStringWithFormattingArg));
966966
store.register_late_pass(move |_| Box::new(unused_trait_names::UnusedTraitNames::new(conf)));
967967
store.register_late_pass(|_| Box::new(manual_ignore_case_cmp::ManualIgnoreCaseCmp));
968968
store.register_late_pass(|_| Box::new(unnecessary_literal_bound::UnnecessaryLiteralBound));

clippy_lints/src/literal_string_with_formatting_arg.rs renamed to clippy_lints/src/literal_string_with_formatting_args.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ declare_clippy_lint! {
2828
/// x.expect(&format!("{y:?}"));
2929
/// ```
3030
#[clippy::version = "1.83.0"]
31-
pub LITERAL_STRING_WITH_FORMATTING_ARG,
31+
pub LITERAL_STRING_WITH_FORMATTING_ARGS,
3232
suspicious,
3333
"Checks if string literals have formatting arguments"
3434
}
3535

36-
declare_lint_pass!(LiteralStringWithFormattingArg => [LITERAL_STRING_WITH_FORMATTING_ARG]);
36+
declare_lint_pass!(LiteralStringWithFormattingArg => [LITERAL_STRING_WITH_FORMATTING_ARGS]);
3737

3838
impl EarlyLintPass for LiteralStringWithFormattingArg {
3939
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
@@ -94,15 +94,15 @@ impl EarlyLintPass for LiteralStringWithFormattingArg {
9494
1 => {
9595
span_lint(
9696
cx,
97-
LITERAL_STRING_WITH_FORMATTING_ARG,
97+
LITERAL_STRING_WITH_FORMATTING_ARGS,
9898
spans,
9999
"this looks like a formatting argument but it is not part of a formatting macro",
100100
);
101101
},
102102
_ => {
103103
span_lint(
104104
cx,
105-
LITERAL_STRING_WITH_FORMATTING_ARG,
105+
LITERAL_STRING_WITH_FORMATTING_ARGS,
106106
spans,
107107
"these look like formatting arguments but are not part of a formatting macro",
108108
);

tests/ui-toml/large_include_file/large_include_file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::large_include_file)]
2-
#![allow(clippy::literal_string_with_formatting_arg)]
2+
#![allow(clippy::literal_string_with_formatting_args)]
33

44
// Good
55
const GOOD_INCLUDE_BYTES: &[u8; 68] = include_bytes!("../../ui/author.rs");

tests/ui/auxiliary/proc_macro_derive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![allow(incomplete_features)]
33
#![allow(clippy::field_reassign_with_default)]
44
#![allow(clippy::eq_op)]
5-
#![allow(clippy::literal_string_with_formatting_arg)]
5+
#![allow(clippy::literal_string_with_formatting_args)]
66

77
extern crate proc_macro;
88

tests/ui/format.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
clippy::uninlined_format_args,
88
clippy::needless_raw_string_hashes,
99
clippy::useless_vec,
10-
clippy::literal_string_with_formatting_arg
10+
clippy::literal_string_with_formatting_args
1111
)]
1212

1313
struct Foo(pub String);

tests/ui/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
clippy::uninlined_format_args,
88
clippy::needless_raw_string_hashes,
99
clippy::useless_vec,
10-
clippy::literal_string_with_formatting_arg
10+
clippy::literal_string_with_formatting_args
1111
)]
1212

1313
struct Foo(pub String);

tests/ui/literal_string_with_formatting_arg.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
#![warn(clippy::literal_string_with_formatting_arg)]
1+
#![warn(clippy::literal_string_with_formatting_args)]
22
#![allow(clippy::unnecessary_literal_unwrap)]
33

44
fn main() {
55
let x: Option<usize> = None;
66
let y = "hello";
7-
x.expect("{y} {}"); //~ literal_string_with_formatting_arg
8-
x.expect(" {y} bla"); //~ literal_string_with_formatting_arg
9-
x.expect("{:?}"); //~ literal_string_with_formatting_arg
10-
x.expect("{y:?}"); //~ literal_string_with_formatting_arg
11-
x.expect(" {y:?} {y:?} "); //~ literal_string_with_formatting_arg
12-
x.expect(" {y:..} {y:?} "); //~ literal_string_with_formatting_arg
13-
x.expect(r"{y:?} {y:?} "); //~ literal_string_with_formatting_arg
14-
x.expect(r"{y:?} y:?}"); //~ literal_string_with_formatting_arg
15-
x.expect(r##" {y:?} {y:?} "##); //~ literal_string_with_formatting_arg
7+
x.expect("{y} {}"); //~ literal_string_with_formatting_args
8+
x.expect(" {y} bla"); //~ literal_string_with_formatting_args
9+
x.expect("{:?}"); //~ literal_string_with_formatting_args
10+
x.expect("{y:?}"); //~ literal_string_with_formatting_args
11+
x.expect(" {y:?} {y:?} "); //~ literal_string_with_formatting_args
12+
x.expect(" {y:..} {y:?} "); //~ literal_string_with_formatting_args
13+
x.expect(r"{y:?} {y:?} "); //~ literal_string_with_formatting_args
14+
x.expect(r"{y:?} y:?}"); //~ literal_string_with_formatting_args
15+
x.expect(r##" {y:?} {y:?} "##); //~ literal_string_with_formatting_args
1616
// Ensure that it doesn't try to go in the middle of a unicode character.
17-
x.expect("———{:?}"); //~ literal_string_with_formatting_arg
17+
x.expect("———{:?}"); //~ literal_string_with_formatting_args
1818

1919
// Should not lint!
2020
format!("{y:?}");

tests/ui/literal_string_with_formatting_arg.stderr

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
11
error: this looks like a formatting argument but it is not part of a formatting macro
2-
--> tests/ui/literal_string_with_formatting_arg.rs:7:15
2+
--> tests/ui/literal_string_with_formatting_args.rs:7:15
33
|
44
LL | x.expect("{y} {}");
55
| ^^^
66
|
77
= note: `-D clippy::literal-string-with-formatting-arg` implied by `-D warnings`
8-
= help: to override `-D warnings` add `#[allow(clippy::literal_string_with_formatting_arg)]`
8+
= help: to override `-D warnings` add `#[allow(clippy::literal_string_with_formatting_args)]`
99

1010
error: this looks like a formatting argument but it is not part of a formatting macro
11-
--> tests/ui/literal_string_with_formatting_arg.rs:8:16
11+
--> tests/ui/literal_string_with_formatting_args.rs:8:16
1212
|
1313
LL | x.expect(" {y} bla");
1414
| ^^^
1515

1616
error: this looks like a formatting argument but it is not part of a formatting macro
17-
--> tests/ui/literal_string_with_formatting_arg.rs:9:15
17+
--> tests/ui/literal_string_with_formatting_args.rs:9:15
1818
|
1919
LL | x.expect("{:?}");
2020
| ^^^^
2121

2222
error: this looks like a formatting argument but it is not part of a formatting macro
23-
--> tests/ui/literal_string_with_formatting_arg.rs:10:15
23+
--> tests/ui/literal_string_with_formatting_args.rs:10:15
2424
|
2525
LL | x.expect("{y:?}");
2626
| ^^^^^
2727

2828
error: these look like formatting arguments but are not part of a formatting macro
29-
--> tests/ui/literal_string_with_formatting_arg.rs:11:16
29+
--> tests/ui/literal_string_with_formatting_args.rs:11:16
3030
|
3131
LL | x.expect(" {y:?} {y:?} ");
3232
| ^^^^^ ^^^^^
3333

3434
error: this looks like a formatting argument but it is not part of a formatting macro
35-
--> tests/ui/literal_string_with_formatting_arg.rs:12:23
35+
--> tests/ui/literal_string_with_formatting_args.rs:12:23
3636
|
3737
LL | x.expect(" {y:..} {y:?} ");
3838
| ^^^^^
3939

4040
error: these look like formatting arguments but are not part of a formatting macro
41-
--> tests/ui/literal_string_with_formatting_arg.rs:13:16
41+
--> tests/ui/literal_string_with_formatting_args.rs:13:16
4242
|
4343
LL | x.expect(r"{y:?} {y:?} ");
4444
| ^^^^^ ^^^^^
4545

4646
error: this looks like a formatting argument but it is not part of a formatting macro
47-
--> tests/ui/literal_string_with_formatting_arg.rs:14:16
47+
--> tests/ui/literal_string_with_formatting_args.rs:14:16
4848
|
4949
LL | x.expect(r"{y:?} y:?}");
5050
| ^^^^^
5151

5252
error: these look like formatting arguments but are not part of a formatting macro
53-
--> tests/ui/literal_string_with_formatting_arg.rs:15:19
53+
--> tests/ui/literal_string_with_formatting_args.rs:15:19
5454
|
5555
LL | x.expect(r##" {y:?} {y:?} "##);
5656
| ^^^^^ ^^^^^
5757

5858
error: this looks like a formatting argument but it is not part of a formatting macro
59-
--> tests/ui/literal_string_with_formatting_arg.rs:17:18
59+
--> tests/ui/literal_string_with_formatting_args.rs:17:18
6060
|
6161
LL | x.expect("———{:?}");
6262
| ^^^^

tests/ui/print_literal.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::print_literal)]
2-
#![allow(clippy::uninlined_format_args, clippy::literal_string_with_formatting_arg)]
2+
#![allow(clippy::uninlined_format_args, clippy::literal_string_with_formatting_args)]
33

44
fn main() {
55
// these should be fine

tests/ui/print_literal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::print_literal)]
2-
#![allow(clippy::uninlined_format_args, clippy::literal_string_with_formatting_arg)]
2+
#![allow(clippy::uninlined_format_args, clippy::literal_string_with_formatting_args)]
33

44
fn main() {
55
// these should be fine

tests/ui/regex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
clippy::needless_raw_string_hashes,
55
clippy::needless_borrow,
66
clippy::needless_borrows_for_generic_args,
7-
clippy::literal_string_with_formatting_arg
7+
clippy::literal_string_with_formatting_args
88
)]
99
#![warn(clippy::invalid_regex, clippy::trivial_regex, clippy::regex_creation_in_loops)]
1010

tests/ui/uninlined_format_args_panic.edition2018.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@[edition2021] edition:2021
44

55
#![warn(clippy::uninlined_format_args)]
6-
#![allow(clippy::literal_string_with_formatting_arg)]
6+
#![allow(clippy::literal_string_with_formatting_args)]
77

88
fn main() {
99
let var = 1;

tests/ui/uninlined_format_args_panic.edition2021.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@[edition2021] edition:2021
44

55
#![warn(clippy::uninlined_format_args)]
6-
#![allow(clippy::literal_string_with_formatting_arg)]
6+
#![allow(clippy::literal_string_with_formatting_args)]
77

88
fn main() {
99
let var = 1;

tests/ui/uninlined_format_args_panic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@[edition2021] edition:2021
44

55
#![warn(clippy::uninlined_format_args)]
6-
#![allow(clippy::literal_string_with_formatting_arg)]
6+
#![allow(clippy::literal_string_with_formatting_args)]
77

88
fn main() {
99
let var = 1;

0 commit comments

Comments
 (0)