-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-50784][TESTS] Fix lint-scala not to ignore scalastyle errors
#49443
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
dev/lint-scala
Outdated
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 is a bit of a weird patch. The mvn command should actually continue checking for $? and not for the error output being empty. In particular because it parses for "Unformatted files"
Not the second issue is that the lint-scala should not care about the code in
resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/ExecutorKubernetesCredentialsFeatureStepSuite.scala
The mvn command explicitly just checks for
-pl sql/api \
-pl sql/connect/common \
-pl sql/connect/server \
-pl connector/connect/client/jvm \
grundprinzip
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.
Back when I did the first version of the patch I got push-back to enforce scalastyle on pull requests and therefore this script only enforces Spark Connect related modules.
|
I'm not sure why you say like that with
It's a standard way to stop script if some command exist abnormally during the script. Apache Spark utilizes it in many script. Are you aware of it, @grundprinzip ? |
yes using The main reason for checking for the error is that the goal of the script is to be actionable and have a good error message that the user knows what to do to fix the error. Just failing the command does not help the user to understand how to fix it. Lastly, my questions still remains why this came up for the |
This sounds like a wrong claim to me. As I mentioned in the PR description, it fails with the rich information like the following. This also looks wrong to me.
|
|
Please note that Lines 20 to 29 in 9547a47
|
|
Could you review this, @panbingkun ? The CI starts to fail at compilation due to this. |
|
Also, cc @huaxingao and @viirya . When you have some time, could you review this PR? |
|
Hi @dongjoon-hyun , I was checking the history of the script and it seems it has never failed scalastyle for the past 5 years. See here for example: https://github.com/apache/spark/blob/f0b6245ea4cef0dc61d4277f1d6874ccf315e47a/dev/lint-scala I'm absolutely in favor of enforcing scalastyle :) I tested your PR to see if the error message for Spark Connect is still present. If the goal is to enforce Scalastyle then I'm +1 on the PR |
|
Thank you, @grundprinzip . Yes, you are right. Previously, we didn't hit this corner case before. |
|
Let me check my PR once more~ |
|
To recover master branch, I merged @panbingkun 's PR first because mine is still incomplete. |
|
I'll revisit this PR later Today. |
38235c1 to
279f565
Compare
cnauroth
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.
+1 (non-binding) from my perspective. I wonder if we'll find any other pre-existing violations that need a cleanup first.
Thanks for the patch, @dongjoon-hyun .
|
Thank you, @grundprinzip , @cnauroth , @viirya . Merged to master. There is no previous violation because technically Spark SBT build enforces this if we explicitly skip it by the env variable, |
### What changes were proposed in this pull request? This PR aims to fix `lint-scala` script not to ignore `scalastyle` errors. ### Why are the changes needed? This bug was introduced via the following PR at Apache Spark 3.4.0. - #38258 After the above PR, `lint-scala` ignores `scalastyle` error and only considers the exit code of `scalafmt` like the following CI result. - #49428 (comment)  ### Does this PR introduce _any_ user-facing change? No, this is a dev-only tool change. ### How was this patch tested? Manual review. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #49443 from dongjoon-hyun/SPARK-50784. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 9d4b7a5) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>

What changes were proposed in this pull request?
This PR aims to fix
lint-scalascript not to ignorescalastyleerrors.Why are the changes needed?
This bug was introduced via the following PR at Apache Spark 3.4.0.
After the above PR,
lint-scalaignoresscalastyleerror and only considers the exit code ofscalafmtlike the following CI result.Does this PR introduce any user-facing change?
No, this is a dev-only tool change.
How was this patch tested?
Manual review.
Was this patch authored or co-authored using generative AI tooling?
No.