-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustfmt modules included with if_feature! macro
rustfmt has a known limitation (rust-lang/rustfmt#3253) that modules declared inside macros are not processed when using 'cargo fmt'. So instead, let's brute-force 'find' all applicable rust sources and call rustfmt directly.
- Loading branch information
Showing
3 changed files
with
53 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,9 +20,7 @@ jobs: | |
- name: Run rustfmt | ||
run: | | ||
echo "// empty module for rustfmt" > tests/generated.rs | ||
rustup run nightly cargo fmt --check | ||
rm tests/generated.rs | ||
find . -path ./src/generated -prune -o -name '*.rs' -print | xargs rustup run nightly rustfmt --edition 2021 --check | ||
- name: Set up Python | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters