-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Make CI fail on any occurrence of rust-tomlfmt failed #7774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There is an error when running |
|
I have noticed this error as well -- thank you @ongchi |
alamb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
| # 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also add some documentation to the script to guide the user on how to fix the Cargo.toml formatting.
alamb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ongchi
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
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?