Make CI fail on any occurrence of rust-tomlfmt failed#7774
Merged
Conversation
Contributor
Author
|
There is an error when running |
Contributor
|
I have noticed this error as well -- thank you @ongchi |
alamb
reviewed
Oct 9, 2023
alamb
left a comment
Contributor
There was a problem hiding this comment.
Thank you @ongchi -- this is super helpful 🙏
The only change I think this PR needs is a comment about how to fix the CI if it fails (i left more detailed comments on this).
I also tested locally and it seems to have worked great
On main:
alamb@MacBook-Pro-8:~/Software/arrow-datafusion2$ if `./ci/scripts/rust_toml_fmt.sh`; then echo "pass" ; else echo "failed"; fi
+ find . -mindepth 2 -name Cargo.toml -exec cargo tomlfmt -p '{}' ';'
INFO 2023-10-09T21:23:33Z: cargo_tomlfmt: no problem found. good job! :)
INFO 2023-10-09T21:23:33Z: cargo_tomlfmt: no problem found. good job! :)
INFO 2023-10-09T21:23:34Z: cargo_tomlfmt: no problem found. good job! :)
INFO 2023-10-09T21:23:34Z: cargo_tomlfmt: no problem found. good job! :)
INFO 2023-10-09T21:23:34Z: cargo_tomlfmt: no problem found. good job! :)
INFO 2023-10-09T21:23:34Z: cargo_tomlfmt: no problem found. good job! :)
INFO 2023-10-09T21:23:34Z: cargo_tomlfmt: no problem found. good job! :)
INFO 2023-10-09T21:23:34Z: cargo_tomlfmt: no problem found. good job! :)
INFO 2023-10-09T21:23:34Z: cargo_tomlfmt: no problem found. good job! :)
INFO 2023-10-09T21:23:34Z: cargo_tomlfmt: no problem found. good job! :)
INFO 2023-10-09T21:23:34Z: cargo_tomlfmt: no problem found. good job! :)
INFO 2023-10-09T21:23:34Z: cargo_tomlfmt: no problem found. good job! :)
INFO 2023-10-09T21:23:34Z: cargo_tomlfmt: no problem found. good job! :)
Error: TomlError { message: "TOML parse error at line 19, column 8\n |\n19 | authors.workspace = true\n | ^\nUnexpected `.`\nExpected `=`\n" }
INFO 2023-10-09T21:23:35Z: cargo_tomlfmt: no problem found. good job! :)
INFO 2023-10-09T21:23:35Z: cargo_tomlfmt: no problem found. good job! :)
INFO 2023-10-09T21:23:35Z: cargo_tomlfmt: no problem found. good job! :)
passon this branch (without the toml fix) it fails (which is good)
alamb@MacBook-Pro-8:~/Software/arrow-datafusion2$ if `./ci/scripts/rust_toml_fmt.sh`; then echo "pass" ; else echo "failed"; fi
++ find . -mindepth 2 -name Cargo.toml
+ for toml in $(find . -mindepth 2 -name 'Cargo.toml')
+ cargo tomlfmt -d -p ./test-utils/Cargo.toml
INFO 2023-10-09T21:25:19Z: cargo_tomlfmt: no problem found. good job! :)
+ for toml in $(find . -mindepth 2 -name 'Cargo.toml')
+ cargo tomlfmt -d -p ./datafusion-cli/Cargo.toml
INFO 2023-10-09T21:25:19Z: cargo_tomlfmt: no problem found. good job! :)
+ for toml in $(find . -mindepth 2 -name 'Cargo.toml')
+ cargo tomlfmt -d -p ./datafusion/physical-plan/Cargo.toml
INFO 2023-10-09T21:25:19Z: cargo_tomlfmt: no problem found. good job! :)
+ for toml in $(find . -mindepth 2 -name 'Cargo.toml')
+ cargo tomlfmt -d -p ./datafusion/core/Cargo.toml
INFO 2023-10-09T21:25:19Z: cargo_tomlfmt: no problem found. good job! :)
+ for toml in $(find . -mindepth 2 -name 'Cargo.toml')
+ cargo tomlfmt -d -p ./datafusion/physical-expr/Cargo.toml
INFO 2023-10-09T21:25:19Z: cargo_tomlfmt: no problem found. good job! :)
+ for toml in $(find . -mindepth 2 -name 'Cargo.toml')
+ cargo tomlfmt -d -p ./datafusion/proto/Cargo.toml
INFO 2023-10-09T21:25:19Z: cargo_tomlfmt: no problem found. good job! :)
+ for toml in $(find . -mindepth 2 -name 'Cargo.toml')
+ cargo tomlfmt -d -p ./datafusion/proto/gen/Cargo.toml
INFO 2023-10-09T21:25:19Z: cargo_tomlfmt: no problem found. good job! :)
+ for toml in $(find . -mindepth 2 -name 'Cargo.toml')
+ cargo tomlfmt -d -p ./datafusion/optimizer/Cargo.toml
INFO 2023-10-09T21:25:19Z: cargo_tomlfmt: no problem found. good job! :)
+ for toml in $(find . -mindepth 2 -name 'Cargo.toml')
+ cargo tomlfmt -d -p ./datafusion/expr/Cargo.toml
INFO 2023-10-09T21:25:19Z: cargo_tomlfmt: no problem found. good job! :)
+ for toml in $(find . -mindepth 2 -name 'Cargo.toml')
+ cargo tomlfmt -d -p ./datafusion/substrait/Cargo.toml
INFO 2023-10-09T21:25:19Z: cargo_tomlfmt: no problem found. good job! :)
+ for toml in $(find . -mindepth 2 -name 'Cargo.toml')
+ cargo tomlfmt -d -p ./datafusion/common/Cargo.toml
INFO 2023-10-09T21:25:19Z: cargo_tomlfmt: no problem found. good job! :)
+ for toml in $(find . -mindepth 2 -name 'Cargo.toml')
+ cargo tomlfmt -d -p ./datafusion/wasmtest/Cargo.toml
INFO 2023-10-09T21:25:20Z: cargo_tomlfmt: no problem found. good job! :)
+ for toml in $(find . -mindepth 2 -name 'Cargo.toml')
+ cargo tomlfmt -d -p ./datafusion/execution/Cargo.toml
INFO 2023-10-09T21:25:20Z: cargo_tomlfmt: no problem found. good job! :)
+ for toml in $(find . -mindepth 2 -name 'Cargo.toml')
+ cargo tomlfmt -d -p ./datafusion/sqllogictest/Cargo.toml
Error: TomlError { message: "TOML parse error at line 19, column 8\n |\n19 | authors.workspace = true\n | ^\nUnexpected `.`\nExpected `=`\n" }
faileda5e5c93 to
5b0ee40
Compare
ongchi
commented
Oct 13, 2023
Comment on lines
+20
to
+23
| # Run cargo-tomlfmt with flag `-d` in dry run to check formatting | ||
| # without overwritng the file. If any error occur, you may want to | ||
| # rerun 'cargo tomlfmt -p path/to/Cargo.toml' without '-d' to fix | ||
| # the formatting automatically. |
Contributor
Author
There was a problem hiding this comment.
I'd also add some documentation to the script to guide the user on how to fix the Cargo.toml formatting.
alamb
approved these changes
Oct 13, 2023
| run: | | ||
| # if you encounter error, try rerun the command below, finally run 'git diff' to | ||
| # check which Cargo.toml introduces formatting violation | ||
| # if you encounter an error, try running 'cargo tomlfmt -p path/to/Cargo.toml' to fix the formatting automatically. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #.
Rationale for this change
ci/scripts/rust_toml_fmt.shdoes not return an error when any occurrence of failed.What changes are included in this PR?
cargo-tomlfmtcheck script and CI.datafusion/sqllogictest/Cargo.tomlAre these changes tested?
Are there any user-facing changes?