-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-40799] [BUILD] [CONNECT] Enforce scalafmt for Spark Connect module. #38258
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,3 +21,13 @@ SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" | |
| SPARK_ROOT_DIR="$(dirname $SCRIPT_DIR)" | ||
|
|
||
| "$SCRIPT_DIR/scalastyle" "$1" | ||
|
|
||
| # For Spark Connect, we actively enforce scalafmt and check that the produced diff is empty. | ||
| ./build/mvn -Pscala-2.12 scalafmt:format -Dscalafmt.skip=false -Dscalafmt.validateOnly=true -pl connector/connect | ||
| if [[ $? -ne 0 ]]; then | ||
| echo "The scalafmt check failed on connector/connect." | ||
| echo "Before submitting your change, please make sure to format your code using the following command:" | ||
| echo "./build/mvn -Pscala-2.12 scalafmt:format -Dscalafmt.skip=fase -Dscalafmt.validateOnly=false -pl connector/connect" | ||
| exit 1 | ||
| fi | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, @grundprinzip and @HyukjinKwon . This PR makes
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This checks explicitly for a non-zero exit code. Why would this not cover your case? |
||
|
|
||
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.
:) No one loves SBT
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 am not familiar with SBT though maybe this works with SBT.
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.
This piece here is taken from the existing
dev/scalafmtscript and slightly adjusted to only reformat the Spark Connect module. I don't think we've ported the usage ofscalafmtto SBT.