-
Notifications
You must be signed in to change notification settings - Fork 79
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
Java source normalization (fixes #516) #631
base: integration
Are you sure you want to change the base?
Java source normalization (fixes #516) #631
Conversation
Codecov Report
@@ Coverage Diff @@
## integration #631 +/- ##
=================================================
+ Coverage 45.63% 45.69% +0.05%
Complexity 1046 1046
=================================================
Files 57 57
Lines 9149 8783 -366
Branches 1687 1679 -8
=================================================
- Hits 4175 4013 -162
+ Misses 4424 4225 -199
+ Partials 550 545 -5
Continue to review full report at Codecov.
|
Please note, that this normalization step causes a lot of noise to prevent noise in the future. |
Now we're back up and running properly, I'm interested. I'll look to reproduce this once 1.26 is out of the door. |
I have fixed the same problem today for the ODF Toolkit: tdf/odftoolkit#50
Using the Google Java Formatter:
https://github.com/google/google-java-format
Capsulated by the following Maven plugin:
https://github.com/Cosium/maven-git-code-format
adding a pre-commit-hook for checking the Java code.
You might reproduce the patch by:
mvn -X git-code-format:format-code -Dgcf.globPattern=**/*
There will be half a dozen problems with comments of unused imports within the Java imports, which breaks the formatting, but after the manual fixes, you will come to my patch.
NOTE: The ODF Toolkit is using in addition to the above Java formatter a whitespace formatter for the text files:
https://ec4j.github.io/editorconfig-maven-plugin/
See in https://github.com/tdf/odftoolkit/blob/master/pom.xml#L257
and its configs:
https://github.com/tdf/odftoolkit/blob/master/.editorconfig