-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[SPARK-29293][BUILD] Move scalafmt to Scala 2.12 profile; bump to 0.12 #26655
Conversation
Test build #114363 has finished for PR 26655 at commit
|
The plugin changes the parameters used to skip formatting, so it failed because it tried to run scalafmt. That is easy enough to fix, both in fixing the parameter and also moving to But, this highlights another problem: scalafmt / plugin doesn't seem to work on the complex Spark code at this point: https://scalameta.org/scalafmt/docs/known-issues.html#deeply-nested-code . It will fail if you run it with the script. So I'm also wondering whether we just yank this. |
pom.xml
Outdated
@@ -166,7 +166,6 @@ | |||
<commons.collections.version>3.2.2</commons.collections.version> | |||
<scala.version>2.12.10</scala.version> | |||
<scala.binary.version>2.12</scala.binary.version> | |||
<scalafmt.parameters>--diff --test</scalafmt.parameters> |
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 think this is the problem. parameters
is no longer available in the plugin. Without it, I think it formats all files and fails. I don't see a way to have the plugin not do this, hm.
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.
Oh, that sounds like a serious regression of scalafmt
.
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.
Well, the plugin more than scalafmt. We could pursue a workaround, but maybe not worth it; I'm not sure how much this is used.
Really, the current state of this PR isn't great, as it no longer does anything useful. I'll need to either delete it or revert and move it behind a Scala 2.12 profile. Any opinion?
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.
Well, the plugin more than scalafmt. We could pursue a workaround, but maybe not worth it; I'm not sure how much this is used.
Really, the current state of this PR isn't great, as it no longer does anything useful. I'll need to either delete it or revert and move it behind a Scala 2.12 profile. Any opinion?
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'm in favor of trying to keep this functionality, since "nit: 4 spaces" is not a welcoming first experience for new contributors.
It looks like the plugin stopped using the cli interface to scalafmt, which is why parameters aren't accepted anymore. I've opened SimonJPegg/mvn_scalafmt#48 to see if the plugin author has any suggestions.
Another option is to leave this available only for the 2.12 build and revert this change, but I'm wondering if it's worth keeping anyway. Do devs use it? |
Test build #114366 has finished for PR 26655 at commit
|
pom.xml
Outdated
@@ -166,7 +166,6 @@ | |||
<commons.collections.version>3.2.2</commons.collections.version> | |||
<scala.version>2.12.10</scala.version> | |||
<scala.binary.version>2.12</scala.binary.version> | |||
<scalafmt.parameters>--diff --test</scalafmt.parameters> |
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'm in favor of trying to keep this functionality, since "nit: 4 spaces" is not a welcoming first experience for new contributors.
It looks like the plugin stopped using the cli interface to scalafmt, which is why parameters aren't accepted anymore. I've opened SimonJPegg/mvn_scalafmt#48 to see if the plugin author has any suggestions.
dev/scalafmt
Outdated
params="${@:---diff}" | ||
|
||
./build/mvn mvn-scalafmt_2.12:format -Dscalafmt.skip=false -Dscalafmt.parameters="$params" | ||
./build/mvn mvn-scalafmt_2.12:format -Dscalafmt.skip=false |
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.
Even if we figure out what's up with parameters, this would need to be either scalafmt_2.12 or scalafmt_2.13 accordingly
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.
Yeah, right, noticed that one too. I will instead change this to put the older version of the plugin under the scala-2.12 profile, to get it out of the way of the 2.13 build, for now. If the plugin further updates, we can use this approach here.
I updated to just:
|
Test build #114422 has finished for PR 26655 at commit
|
Retest this please |
Test build #114456 has finished for PR 26655 at commit
|
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, LGTM. Merged to master.
Thank you, @srowen and @koeninger .
I also checked this is still active with Scala-2.12
also 0.12
becomes more verbose.
[INFO] Using config at path: dev/.scalafmt.conf
[INFO] Options: --diff
[ERROR] Could not locate Scala source at /Users/dongjoon/PRS/PR-26655/external/kafka-0-10-assembly/src/main/scala
[ERROR] Could not locate Scala source at /Users/dongjoon/PRS/PR-26655/external/kafka-0-10-assembly/src/test/scala
[ERROR] No source files found, skipping formatting!
### What changes were proposed in this pull request? Move scalafmt to Scala 2.12 profile; bump to 0.12. ### Why are the changes needed? To facilitate a future Scala 2.13 build. ### Does this PR introduce any user-facing change? None. ### How was this patch tested? This isn't covered by tests, it's a convenience for contributors. Closes apache#26655 from srowen/SPARK-29293. Authored-by: Sean Owen <sean.owen@databricks.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
What changes were proposed in this pull request?
Move scalafmt to Scala 2.12 profile; bump to 0.12.
Why are the changes needed?
To facilitate a future Scala 2.13 build.
Does this PR introduce any user-facing change?
None.
How was this patch tested?
This isn't covered by tests, it's a convenience for contributors.