Skip to content

[Java] Enforce Java code format standard#1049

Merged
rapids-bot[bot] merged 11 commits intorapidsai:branch-25.08from
SearchScale:vivek/enforce-java-code-format-maven
Jun 30, 2025
Merged

[Java] Enforce Java code format standard#1049
rapids-bot[bot] merged 11 commits intorapidsai:branch-25.08from
SearchScale:vivek/enforce-java-code-format-maven

Conversation

@narangvivek10
Copy link
Copy Markdown
Contributor

@narangvivek10 narangvivek10 commented Jun 25, 2025

Configuration changes to enforce Java code format standard using google-java-format via spotless's maven plugin to comply with the Google Java Style Guide. Spotless is a popular choice and is also used in Apache Lucene.

With this change, the Java code format is checked and fixes for identified style violations are automatically applied (including missing license headers) when invoking mvn verify and precisely during its validate phase.

@chatman FYI

Fixes #1042

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Jun 25, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@narangvivek10 narangvivek10 marked this pull request as ready for review June 25, 2025 03:32
Comment thread java/examples/pom.xml
Copy link
Copy Markdown
Contributor

@chatman chatman left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@ldematte ldematte left a comment

Choose a reason for hiding this comment

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

Thanks for this, I really appreciate having not to guess a code format to use.
One nitpick: can we add some mention to it to the README? Perhaps adding a note on how this can be used to format your code to automatically fix all the violations (mvn spotless::apply or similar?)

@narangvivek10
Copy link
Copy Markdown
Contributor Author

One nitpick: can we add some mention to it to the README? Perhaps adding a note on how this can be used to format your code to automatically fix all the violations (mvn spotless::apply or similar?)

Yes great idea, in fact, I was thinking that we should add a Contributing section in the readme file with helpful notes (including this one), and any guidelines for developers in general.

@chatman
Copy link
Copy Markdown
Contributor

chatman commented Jun 27, 2025 via email

@mythrocks mythrocks added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Jun 30, 2025
@mythrocks
Copy link
Copy Markdown
Contributor

/ok to test 308e9ff

Copy link
Copy Markdown
Contributor

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

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

LGTM. Will check in, pending CI run.

CI seemed to be failing on something transient. I'm re-kicking the failed workflows.

@mythrocks
Copy link
Copy Markdown
Contributor

/merge

@rapids-bot rapids-bot Bot merged commit 62e5d0d into rapidsai:branch-25.08 Jun 30, 2025
96 of 102 checks passed
@mythrocks
Copy link
Copy Markdown
Contributor

I have merged this PR. Thank you for this one, @narangvivek10.

@narangvivek10
Copy link
Copy Markdown
Contributor Author

Can we add some mention to it to the README? Perhaps adding a note on how this can be used to format your code to automatically fix all the violations (mvn spotless::apply or similar?)

This (and other documentation suggestions above) will be tracked under #1070 and will go in as a separate PR. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEA] [Java] Enforce Java code style format

5 participants