Skip to content

Replace Prettier with formatter-maven-plugin - #114

Merged
bertysentry merged 3 commits into
mainfrom
110-replace-prettier-with-formatter-maven-plugin
Jul 24, 2026
Merged

Replace Prettier with formatter-maven-plugin#114
bertysentry merged 3 commits into
mainfrom
110-replace-prettier-with-formatter-maven-plugin

Conversation

@bertysentry

Copy link
Copy Markdown
Contributor

Closes #110

Changes

  • Replace com.hubspot.maven.plugins:prettier-maven-plugin with net.revelc.code.formatter:formatter-maven-plugin 2.29.0, with the validate goal bound to the validate phase, covering src/main/java and src/test/java (same configuration as Jawk and maven-skin-tools).
  • Remove .prettierrc.yaml.
  • Add metricshub-eclipse-formatter.xml, based on the shared MetricsHub Eclipse profile, with a few adjustments to preserve the effective prettier conventions:
    • continuation_indentation = 1 (one-tab indent for wrapped parameters/arguments);
    • parentheses_positions_in_method_delcaration and _invocation = separate_lines_if_wrapped (closing parenthesis on its own line when wrapped);
    • alignment_for_selector_in_method_invocation = 16 (keep String.format( together instead of splitting the selector);
    • alignment_for_throws_clause_in_method_declaration = 16 (throws clause kept on one line, matching the constructor setting already in the shared profile);
    • wrap_before_conditional_operator = true (leading ?/: in wrapped ternaries).
  • Migration-only reformat in a separate commit: 42 files, mostly Javadoc whitespace normalization. Since the profile keeps join_wrapped_lines=false, prettier's original wrapping is preserved almost everywhere.

Verification

  • mvn validate fails on misformatted sources (tested by deliberately breaking a file).
  • mvn formatter:format formats both main and test sources.
  • mvn verify passes (JDK 17): 43 tests, 0 failures; checkstyle/pmd/spotbugs clean.

🤖 Generated with Claude Code

bertysentry and others added 2 commits July 24, 2026 01:09
Format Java sources with net.revelc.code.formatter:formatter-maven-plugin
2.29.0, validated during the validate phase, as in Jawk and
maven-skin-tools. The Eclipse profile is the shared MetricsHub profile
with a few adjustments to preserve the effective prettier conventions:
one-tab continuation indentation, closing parenthesis on its own line
when wrapped, compact wrapping for invocation selectors and throws
clauses, and leading ?/: in wrapped ternaries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Migration-only reformatting produced by mvn formatter:format; no
functional changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@bertysentry bertysentry linked an issue Jul 23, 2026 that may be closed by this pull request

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7690bd4b87

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread metricshub-eclipse-formatter.xml
)

The repository mixed CRLF and LF text files, and formatter-maven-plugin's
default lineEnding AUTO enforces the current platform's separator, so
validation passed on Windows but failed on the Linux CI runners (and
vice versa). Store all text files with LF via .gitattributes, renormalize
the affected files, and set lineEnding=KEEP so validation accepts the
checked-out line endings on every platform, as Prettier's endOfLine=auto
did.

Also refresh the license headers with license:update-file-header
(copyright years and organization name).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@bertysentry
bertysentry merged commit a9135c1 into main Jul 24, 2026
5 checks passed
@bertysentry
bertysentry deleted the 110-replace-prettier-with-formatter-maven-plugin branch July 24, 2026 09:18
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.

Replace Prettier with formatter-maven-plugin

1 participant