Format the code base with the same Eclipse formatter profile and Maven plugin as jawk (and maven-skin-tools, which ships the byte-identical profile), so that every MetricsHub Java project looks the same and formatting stops being a review topic.
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.29.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
<configuration>
<directories>
<directory>${project.build.sourceDirectory}</directory>
<directory>${project.build.testSourceDirectory}</directory>
</directories>
<includes>
<include>**/*.java</include>
</includes>
<configFile>metricshub-eclipse-formatter.xml</configFile>
</configuration>
</plugin>
Goal
Format the code base with the same Eclipse formatter profile and Maven plugin as jawk (and maven-skin-tools, which ships the byte-identical profile), so that every MetricsHub Java project looks the same and formatting stops being a review topic.
Current state
src/main/javamixes 33 tab-indented and 246 space-indented files (the Verax core uses 4 spaces, the MetricsHub client layer uses tabs), and all 279 files have CRLF line endings.checkstyle.xml) still carries formatting rules (WhitespaceAround,LeftCurly,MethodParamPad, …) that a formatter makes redundant.What jawk does (reference)
pom.xml(link):metricshub-eclipse-formatter.xmlat the repository root: EclipseCodeFormatterProfilenamed MetricsHub (version 23); tabs (tabulation.char=tab,tabulation.size=2,indentation.size=4),lineSplit=120,comment.line_length=120,continuation_indentation=2,join_wrapped_lines=false, one blank line between import groups, newline at end of file. Copy it verbatim from jawk (it is identical in maven-skin-tools; winrm-java carries a 25-byte variant that should be reconciled too).formatter:validateruns atvalidate, so an unformatted file failsmvn verify; developers runmvn formatter:formatbefore committing (jawk'sCONTRIBUTING.md: "You never need to worry about code formatting at all. Simply runmvn formatter:formatbefore committing").formatter-maven-plugin2.29.0,validategoal at thevalidatephase).Proposed steps
metricshub-eclipse-formatter.xml(copied from jawk) and the plugin configuration above topom.xml; add a "Code format" section toREADME.md/CONTRIBUTING.md.mvn formatter:formatonce on the whole tree in a dedicated commit (expect a large diff: ~280 files), and list that commit in.git-blame-ignore-revssogit blamestays usable..gitattributes(jawk has one) so the formatter and Git agree on CRLF vs LF.checkstyle.xmlto the jawk variant that drops the formatting checks (companion issue).Acceptance
mvn verifyfails on an unformatted file and passes on the formatted tree.