HyukjinKwon commented on code in PR #38326:
URL: https://github.com/apache/spark/pull/38326#discussion_r1001294003


##########
dev/lint-scala:
##########
@@ -23,10 +23,21 @@ 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 -Dscalafmt.changedOnly=false -pl connector/connect
-if [[ $? -ne 0 ]]; then
-  echo "The scalafmt check failed on connector/connect."
+ERRORS=$(./build/mvn \
+    -Pscala-2.12 \
+    scalafmt:format \
+    -Dscalafmt.skip=false \
+    -Dscalafmt.validateOnly=true \
+    -Dscalafmt.changedOnly=false \
+    -pl connector/connect \
+    2>&1 | grep -e "^Requires formatting" \

Review Comment:
   I basically followed the same approach taken from `dev/scalastyle` script.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to