Describe the bug
There are currently 18 Java files in the main branch that do not pass spotless check, which indicates that changes in #1049 might not have been sufficient to fully resolve #1042.
To reproduce:
- Checkout the current main branch
- Run
./build.sh libcuvs java
- Run
git status
- You will see that 18 files were reformatted by this action:
(cuvs-env) *[main][~/Projects/rapidsai/cuvs]$ git status
On branch main
Your branch is up to date with 'upstream/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java
modified: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSAceParams.java
modified: java/cuvs-java/src/main/java/com/nvidia/cuvs/HnswAceParams.java
modified: java/cuvs-java/src/main/java/com/nvidia/cuvs/HnswIndex.java
modified: java/cuvs-java/src/main/java/com/nvidia/cuvs/HnswIndexParams.java
modified: java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java
modified: java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/UnsupportedProvider.java
modified: java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/CagraIndexImpl.java
modified: java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/CuVSParamsHelper.java
modified: java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/HnswIndexImpl.java
modified: java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/common/Util.java
modified: java/cuvs-java/src/main/java22/com/nvidia/cuvs/spi/JDKProvider.java
modified: java/cuvs-java/src/test/java/com/nvidia/cuvs/CagraAceBuildAndSearchIT.java
modified: java/cuvs-java/src/test/java/com/nvidia/cuvs/CagraBuildAndSearchIT.java
modified: java/cuvs-java/src/test/java/com/nvidia/cuvs/CagraMultiThreadStabilityIT.java
modified: java/cuvs-java/src/test/java/com/nvidia/cuvs/HnswAceBuildAndSearchIT.java
modified: java/cuvs-java/src/test/java/com/nvidia/cuvs/HnswBuildAndSearchIT.java
modified: java/cuvs-java/src/test/java/com/nvidia/cuvs/HnswRandomizedIT.java
no changes added to commit (use "git add" and/or "git commit -a")
Expected behavior
No incorrectly formatted files should be present.
Environment details (please complete the following information):
- Environment location: Bare-metal
- Method of cuVS install: from source
Additional context
There are several issues here:
- There are some Java files that were not formatted properly before they were merged in.
- There are no format checks in pre-commit for Java or CI process, that could have prevented this.
- The Spotless license header file https://github.com/rapidsai/cuvs/blob/main/java/license-header.txt wasn't updated to 2025–2026, while the headers in some Java files were (that contributes to at least some of the spotless errors)
spotless:apply is bound to Maven's verify phase, which means every build silently mutates source files, making the creation of clean PRs with only relevant diffs somewhat cumbersome. It also means that in CI, incorrectly formatted files are getting corrected and ignored instead of triggering a build failure.
I would propose:
- Update
license-header.txt to contain 2025–$YEAR.
- Replace
spotless:apply with spotless:check in the verify phase (that should catch any future issues in CI as part of normal test run).
- Add a
spotless:check (or spotless:apply) call to pre-commit.
- Run
spotless:apply on all files to make sure all files are correctly formatted .
If that proposal works for the maintainers, I can open a PR for these fixes.
Describe the bug
There are currently 18 Java files in the
mainbranch that do not pass spotless check, which indicates that changes in #1049 might not have been sufficient to fully resolve #1042.To reproduce:
./build.sh libcuvs javagit statusExpected behavior
No incorrectly formatted files should be present.
Environment details (please complete the following information):
Additional context
There are several issues here:
spotless:applyis bound to Maven'sverifyphase, which means every build silently mutates source files, making the creation of clean PRs with only relevant diffs somewhat cumbersome. It also means that in CI, incorrectly formatted files are getting corrected and ignored instead of triggering a build failure.I would propose:
license-header.txtto contain 2025–$YEAR.spotless:applywithspotless:checkin the verify phase (that should catch any future issues in CI as part of normal test run).spotless:check(orspotless:apply) call to pre-commit.spotless:applyon all files to make sure all files are correctly formatted .If that proposal works for the maintainers, I can open a PR for these fixes.