You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/10/16 18:51:43 UTC

[GitHub] [spark] grundprinzip commented on a diff in pull request #38258: [SPARK-40799] [BUILD] [CONNECT] Enforce scalafmt for Spark Connect module.

grundprinzip commented on code in PR #38258:
URL: https://github.com/apache/spark/pull/38258#discussion_r996479670


##########
dev/lint-scala:
##########
@@ -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"

Review Comment:
   This piece here is taken from the existing `dev/scalafmt` script and slightly adjusted to only reformat the Spark Connect module. I don't think we've ported the usage of `scalafmt` to SBT.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org