Skip to content

Commit afaa22a

Browse files
committed
bless tests, update changelog
1 parent 6773b83 commit afaa22a

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5578,4 +5578,3 @@ Released 2018-09-13
55785578
[`allowed-dotfiles`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allowed-dotfiles
55795579
[`enforce-iter-loop-reborrow`]: https://doc.rust-lang.org/clippy/lint_configuration.html#enforce-iter-loop-reborrow
55805580
<!-- end autogenerated links to configuration documentation -->
5581-
mentation -->

tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ error: error reading Clippy's configuration file: unknown field `foobar`, expect
1010
allow-print-in-tests
1111
allow-private-module-inception
1212
allow-unwrap-in-tests
13-
allowed-file-extensions
13+
allowed-dotfiles
1414
allowed-idents-below-min-chars
1515
allowed-scripts
1616
arithmetic-side-effects-allowed
@@ -83,7 +83,7 @@ error: error reading Clippy's configuration file: unknown field `barfoo`, expect
8383
allow-print-in-tests
8484
allow-private-module-inception
8585
allow-unwrap-in-tests
86-
allowed-file-extensions
86+
allowed-dotfiles
8787
allowed-idents-below-min-chars
8888
allowed-scripts
8989
arithmetic-side-effects-allowed

tests/ui/path_ends_with_ext.fixed

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,16 @@ fn test(path: &Path) {
1717
// most legitimate "dotfiles" are longer than 3 chars, so we allow them as well
1818
path.ends_with(".bashrc");
1919

20+
// argument from expn shouldn't trigger
2021
path.ends_with(arg!());
22+
23+
path.ends_with("..");
24+
path.ends_with("./a");
25+
path.ends_with(".");
26+
path.ends_with("");
2127
}
2228

29+
// is_some_and was stabilized in 1.70, so suggest map_or(false, ..) if under that
2330
#[clippy::msrv = "1.69"]
2431
fn under_msv(path: &Path) -> bool {
2532
path.extension().map_or(false, |ext| ext == "md")

tests/ui/path_ends_with_ext.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | path.ends_with(".md");
88
= help: to override `-D warnings` add `#[allow(clippy::path_ends_with_ext)]`
99

1010
error: this looks like a failed attempt at checking for the file extension
11-
--> $DIR/path_ends_with_ext.rs:25:5
11+
--> $DIR/path_ends_with_ext.rs:32:5
1212
|
1313
LL | path.ends_with(".md")
1414
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `path.extension().map_or(false, |ext| ext == "md")`

0 commit comments

Comments
 (0)