Skip to content

Commit

Permalink
Auto merge of #124704 - Urgau:fix-ignored-tests-fmt, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
Fix ignored tests for formatting

This PR fixes the ignored rules in `rustfmt.toml` that were changed in rust-lang/rust#124613 to allow formatting `rmake.rs` but ended up allowing formatting every Rust files in `tests/`.

The fix is a bit involved since we need to workaround a [`.gitignore` pattern limitation](https://git-scm.com/docs/gitignore#_pattern_format):
> An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined.

Workaround using https://stackoverflow.com/a/5534865

I tested the fix by changing the formatting in an `rmake.rs` and UI test, and verifying that only the `rmake.rs` files were formatted.

Fixes rust-lang/rust#124613 (comment)
cc `@GuillaumeGomez`
r? `@onur-ozkan`
  • Loading branch information
bors committed May 4, 2024
2 parents a0c7395 + 66d47d4 commit 9ce59bf
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 9ce59bf

Please sign in to comment.