Skip to content

Commit

Permalink
bless tests, update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
y21 committed Sep 13, 2023
1 parent 6773b83 commit afaa22a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5578,4 +5578,3 @@ Released 2018-09-13
[`allowed-dotfiles`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allowed-dotfiles
[`enforce-iter-loop-reborrow`]: https://doc.rust-lang.org/clippy/lint_configuration.html#enforce-iter-loop-reborrow
<!-- end autogenerated links to configuration documentation -->
mentation -->
4 changes: 2 additions & 2 deletions tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ error: error reading Clippy's configuration file: unknown field `foobar`, expect
allow-print-in-tests
allow-private-module-inception
allow-unwrap-in-tests
allowed-file-extensions
allowed-dotfiles
allowed-idents-below-min-chars
allowed-scripts
arithmetic-side-effects-allowed
Expand Down Expand Up @@ -83,7 +83,7 @@ error: error reading Clippy's configuration file: unknown field `barfoo`, expect
allow-print-in-tests
allow-private-module-inception
allow-unwrap-in-tests
allowed-file-extensions
allowed-dotfiles
allowed-idents-below-min-chars
allowed-scripts
arithmetic-side-effects-allowed
Expand Down
7 changes: 7 additions & 0 deletions tests/ui/path_ends_with_ext.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@ fn test(path: &Path) {
// most legitimate "dotfiles" are longer than 3 chars, so we allow them as well
path.ends_with(".bashrc");

// argument from expn shouldn't trigger
path.ends_with(arg!());

path.ends_with("..");
path.ends_with("./a");
path.ends_with(".");
path.ends_with("");
}

// is_some_and was stabilized in 1.70, so suggest map_or(false, ..) if under that
#[clippy::msrv = "1.69"]
fn under_msv(path: &Path) -> bool {
path.extension().map_or(false, |ext| ext == "md")
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/path_ends_with_ext.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LL | path.ends_with(".md");
= help: to override `-D warnings` add `#[allow(clippy::path_ends_with_ext)]`

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

0 comments on commit afaa22a

Please sign in to comment.