-
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 everything except generated code
I personally disagree with several of rustfmt's decisions, but it's better to be consistent. Generated code isn't being formatted because 1) it would have to get reformatted every time it gets generated; I'm not going to make the generator emit it so it matches rustfmt 2) rustfmt currently chokes on some of the generated code
- Loading branch information
Showing
18 changed files
with
503 additions
and
341 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 |
---|---|---|
|
@@ -12,6 +12,23 @@ jobs: | |
with: | ||
submodules: true | ||
|
||
- name: Install nightly toolchain | ||
run: | | ||
rustup install nightly --profile minimal | ||
rustup component add clippy --toolchain nightly | ||
rustup component add rustfmt --toolchain nightly | ||
- name: Run rustfmt | ||
# Delete the generated code so it doesn't get formatted. | ||
# We'll be re-running the generator later, so this is okay. | ||
run: | | ||
rm -rf src/generated | ||
echo "// empty module for rustfmt" > src/generated.rs | ||
echo "// empty module for rustfmt" > tests/generated.rs | ||
rustup run nightly cargo fmt --check | ||
rm src/generated.rs | ||
rm tests/generated.rs | ||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -34,11 +51,6 @@ jobs: | |
- name: Run cargo test | ||
run: rustup run 1.75.0 cargo test --all-features | ||
|
||
- name: Install nightly toolchain | ||
run: | | ||
rustup install nightly --profile minimal | ||
rustup component add clippy --toolchain nightly | ||
- name: Run clippy | ||
run: rustup run nightly cargo clippy --all-targets --all-features -- --deny warnings | ||
|
||
|
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
Oops, something went wrong.