-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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-2651: Add maven scalastyle plugin #1550
Conversation
Can one of the admins verify this patch? |
Will be run as part of the 'package' phase
<outputEncoding>UTF-8</outputEncoding> | ||
</configuration> | ||
<executions> | ||
<execution> |
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.
is the goal here to make this run when someone runs mvn package
? It didn't seem to do that when I ran it (or maybe it runs them all at the end, I just looked after core was compiled?)
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.
Yes, mvn package
is supposed to run these checks. I am surprised to hear that it didn't work for you. I had updated the PR yesterday, do by chance happen to have the older version (it was missing the line <phase>package</phase>
)? Here is the snippet from my machine:
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ spark-core_2.10 ---
[INFO] Building jar: /mnt/devel/rahuls/code/apache-spark/core/target/spark-core_2.10-1.1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ spark-core_2.10 ---
[INFO]
[INFO] --- maven-source-plugin:2.2.1:jar-no-fork (create-source-jar) @ spark-core_2.10 ---
[INFO] Building jar: /mnt/devel/rahuls/code/apache-spark/core/target/spark-core_2.10-1.1.0-SNAPSHOT-sources.jar
[INFO]
[INFO] --- scalastyle-maven-plugin:0.4.0:check (default) @ spark-core_2.10 ---
Saving to outputFile=/mnt/devel/rahuls/code/apache-spark/core/scalastyle-output.xml
Processed 361 file(s)
Found 0 errors
Found 0 warnings
Found 0 infos
Finished in 8234 ms
Another way to run these checks is through mvn scalastyle:check
but that requires the inter-module dependencies are satisfied via M2 repo.
Thanks for adding this to maven - just had one question based on running this locally. |
After some thought, I'd prefer not to force stylce checking when the I think it's fine to just support |
Packaging wouldn't generally mean changing code checked by scalastyle, I think. I wouldn't mind it being enabled on package; it feels like something to run with the test phase even. It's a good step forward to be able to invoke it at all. |
@srowen your perspective could be helpful here. My concern was that say Cloudera has some custom patches or back ports in a Spark package. Would they find it annoying if the build fails if they do not meet the upstream style guidelines in their own packages? |
Cloudera only back-ports and doesn't add extra code. Back-porting style-compliant code should result in style-compliant code. Of course a back-port sometimes requires a little surgery to transplant back in time if it doesn't merge cleanly, but it's not difficult to make it style compliant. |
okay then - perhaps it's fine to stick with this. We can always make it less stringent if people complain. My main concern was just frustrating downstream packagers - thanks for chiming in on this one. |
The default maven phase for this plugin was Although I agree with the current decision to revisit this on any complaints from downstream. |
Can be run as: "mvn scalastyle:check" Author: Rahul Singhal <[email protected]> Closes apache#1550 from rahulsinghaliitd/SPARK-2651 and squashes the following commits: 53748dd [Rahul Singhal] SPARK-2651: Add maven scalastyle plugin
Can be run as: "mvn scalastyle:check"