You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project currently formats Java sources with com.hubspot.maven.plugins:prettier-maven-plugin:0.22 and prettier-plugin-java:2.5.0, configured through .prettierrc.yaml.
We want to replace Prettier with net.revelc.code.formatter:formatter-maven-plugin, following the convention already used by:
Both reference projects currently use formatter-maven-plugin:2.29.0, bind its validate goal to Maven's validate phase, and use the same metricshub-eclipse-formatter.xml profile.
Proposed change
Remove prettier-maven-plugin from pom.xml.
Remove .prettierrc.yaml once it is no longer used.
Add net.revelc.code.formatter:formatter-maven-plugin using the Jawk/maven-skin-tools configuration as the baseline:
version 2.29.0 (or the current appropriate version at implementation time);
validate goal bound to the Maven validate phase;
main and test Java source directories included;
**/*.java includes;
a checked-in metricshub-eclipse-formatter.xml configuration file.
Start from the shared Eclipse formatter profile used by Jawk and maven-skin-tools.
Adjust the Eclipse profile only where necessary to preserve the effective winrm-java formatting conventions currently expressed by .prettierrc.yaml, notably:
tabs with width 2;
120-column line width;
no trailing commas;
existing lambda/parentheses behavior where Eclipse formatter supports an equivalent;
platform-safe line endings and a final newline.
Apply the new formatter once and review the resulting repository-wide formatting diff. Keep unavoidable migration-only reformatting separate from functional changes.
Update contributor/build documentation if formatter commands are documented or need to be documented.
Acceptance criteria
mvn validate fails when Java sources do not match the checked-in Eclipse formatter profile.
mvn formatter:format formats both src/main/java and src/test/java.
mvn verify succeeds after the migration.
Prettier and .prettierrc.yaml are no longer required by the build.
The resulting formatting is as close as practical to the current project style and is consistent with the Jawk and maven-skin-tools configuration.
CI and local builds use the same formatter configuration.
Activity
Replace prettier-maven-plugin with formatter-maven-plugin (#110)
Reformat sources with the Eclipse formatter profile (#110)
Normalize line endings and make the formatter line-ending agnostic (#110