Skip to content
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

Remove Scalariform from process-sources phase #210

Merged

Conversation

nealsid
Copy link

@nealsid nealsid commented Apr 8, 2014

We discussed on IRC that we shouldn't do this as part of the build.
You can run it like so:

$ mvn org.scalariform:scalariform-maven-plugin:format

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/265/

@massie
Copy link
Member

massie commented Apr 8, 2014

Can you also update the CONTRIBUTING.md with info how to run it?

@nealsid
Copy link
Author

nealsid commented Apr 8, 2014

Good call - done.

@massie
Copy link
Member

massie commented Apr 8, 2014

This is odd. When I run mvn org.scalariform:scalariform-maven-plugin:format against the master branch it reformats all the code again?

@nealsid
Copy link
Author

nealsid commented Apr 8, 2014

What are the particular differences? I was running into behavior similar to that but thought it was a peculiarity to my setup.

@massie
Copy link
Member

massie commented Apr 8, 2014

It also seems like running it manually ignores all the configuration options in pom.xml?

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/268/

@fnothaft
Copy link
Member

fnothaft commented Apr 8, 2014

How are you running it manually? mvn process-sources?

This special ID tells Maven to use this configuration when running from
the command line.
@nealsid
Copy link
Author

nealsid commented Apr 8, 2014

Interesting. Apparently we needed this special id to get Maven to use the configuration tags if it was run from the command line, and not as part of an existing phase.
http://stackoverflow.com/questions/3448648/how-do-i-run-a-specific-goal-with-a-particular-configuration-in-a-maven-plugin-w

@massie
Copy link
Member

massie commented Apr 8, 2014

Things are looking better now. I'll send a snippet of code to drop in scripts/jenkins-test in just a sec.

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/269/

@nealsid
Copy link
Author

nealsid commented Apr 8, 2014

@fnothaft Previously it was part of the process-sources phase, but we discussed in IRC making it run manually. So the instructions I wrote used Maven's syntax for executing a specific plugin. However, due to some Maven peculiarity, this won't use the <configuration> parameters, unless it also has a <id>default-cli</id> tag in the <execution> section.

@fnothaft
Copy link
Member

fnothaft commented Apr 8, 2014

@nealsid ah, right. Thanks for the clarification!

@massie
Copy link
Member

massie commented Apr 8, 2014

@nealsid Can you add this test for Jenkins?

diff --git a/scripts/jenkins-test b/scripts/jenkins-test
index 8da20c0..627d3e9 100755
--- a/scripts/jenkins-test
+++ b/scripts/jenkins-test
@@ -38,6 +38,15 @@ $ADAM flagstat $READS
 rm -rf $ADAM_TMP_DIR
 popd

+pushd "$PROJECT_ROOT"
+mvn org.scalariform:scalariform-maven-plugin:format
+if grep --quiet "dirty" <(git describe --dirty)
+then
+        echo "Please run scalariform using 'mvn org.scalariform:scalariform-maven-plugin:format'"
+        exit 1
+fi
+popd
+
 echo
 echo "All the tests passed"
 echo

@nealsid
Copy link
Author

nealsid commented Apr 8, 2014

Added. Thanks, @massie

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/270/

@massie
Copy link
Member

massie commented Apr 8, 2014

Jenkins, test this please.

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/271/

@massie
Copy link
Member

massie commented Apr 8, 2014

Jenkins, test this please.

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/272/

@massie
Copy link
Member

massie commented Apr 8, 2014

This looks good to me. I'll wait to merge until we hear from someone else.

@heuermh, This change will keep scalariform from running at compile time (it needs to be run explicitly from the commandline) and adds a Jenkins check to the pull request builder. Does that approach make sense to you or do you have recommendations for other ways to handle this?

@heuermh
Copy link
Member

heuermh commented Apr 9, 2014

@massie Running on demand and with a Jenkins check sounds reasonable to me.

My gripe with the settings & changes made in commit b320f02 were just about the setting that adds whitespace in the middle of a line

case None      => printCommands()

Does anyone actually type code that way? I knew a guy once who formatted his variable names that way and well that is not a story for public github comments. :)

Thanks for letting me voice a opinion, even though I'm not actually a core ADAM developer.

@fnothaft
Copy link
Member

fnothaft commented Apr 9, 2014

@heuermh I generally prefer to format case/switch/match statements like that. I think you may find that this varies a bit across language backgrounds; I spent a lot of time as a hardware developer (using Verilog), and that inline whitespace is standard style. IMO, for match statements, it makes it a lot easier to tell the differences between the cases you are matching to. I don't feel terribly strongly one way or the other, but I don't think this formatting is terribly unusual.

massie added a commit that referenced this pull request Apr 9, 2014
…fixes

Remove Scalariform from process-sources phase
@massie massie merged commit 9fc3c06 into bigdatagenomics:master Apr 9, 2014
@massie
Copy link
Member

massie commented Apr 9, 2014

Thanks, Neal!

@nealsid nealsid deleted the maven-warning-and-scalariform-fixes branch April 9, 2014 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants