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
Verify to also validate formatting #82
Comments
Hi, So you are looking for some kind of 'strict' formatting for the verify goal, i.e. that same checks that the ordinary sort goal does? I don't think it is too hard to implement. Been thinking about parameter name and the values that parameter can have: An alternative to 'verifyDetails' are 'verifyChecking' or ''verifyLevel. Also do you have an alternative to the value 'strict'? Best regards, Björn |
Yes, I think I would be happy with a flag that would let sortpom:verify fail if the pom is not formatted like sortpom:sort, but there could of course be levels of strictness to verify. We are currently using the tidy plugin, but I'm getting increasingly annoyed at whitespace related merge conflicts, which I think could be reduced if the build would fail if both sorting and formatting was checked. Parameter could also be named: failOn and the value could be a set/list of thing to check/verify. Best regards Jens |
Branch issue-82-Verify_to_also_validate_formatting created! |
What do you think about this:
xmlElements is the default value where only the order of the xml elements is considered |
…PomImpl and SortPomService. Fixed coverage
Time for testing!
Let me know how it works for you |
Hi Björn Just did a quick test on my work project, when running like: mvn com.github.ekryd.sortpom:sortpom-maven-plugin:2.12.1-SNAPSHOT:verify -Dsort.verifyFailOn=strict It does not fail but instead it corrects the invalid pom. Output (slightly modified for privacy reasons).
I expected it to fail the build without modifying the pom.xml. Best regards Jens |
In that case you need to add -Dsort.verifyFail=stop if you want a failed verify to stop the build. Try it and see how it works. |
Ahh, sorry, my bad. I must admit that I find it a bit counter intuitive that the verify goal modifies the pom file by default, but then again, it is pretty well documented so maybe it is just me that is used to how tidy-maven-plugin works. I tried it with Best regards Jens |
Great to hear! I have to fix some things before releasing an official new version. Should be done by the weekend. |
Hi, New official release 2.13.1 has the verifyFailOn option. Enjoy! |
Updated the documentation for the plugin. https://github.com/Ekryd/sortpom/wiki/Parameters and https://github.com/Ekryd/sortpom/wiki/VerifyFailOn Have you tried the official version yet? |
Hi
When running in either a git commit hook or on a build server it would make sense if verify could also validate formatting (indentation etc).
Would that be difficult to implement?
In the project I'm most involved with, it would reduce merging conflicts if the build would fail if people did not apply correct formatting.
Best regards Jens
The text was updated successfully, but these errors were encountered: