build: replace Spotless Java formatting with Flint#19242
Draft
zeitlinger wants to merge 2 commits into
Draft
Conversation
Signed-off-by: Gregor Zeitlinger <[email protected]>
Signed-off-by: Gregor Zeitlinger <[email protected]>
Pull request dashboard statusStatus last refreshed: 2026-07-22 16:38:41 UTC.
This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blocked by grafana/flint#407
Summary
google-java-formatcheckStaticImportFormatterwith Flint's genericregex-replacerule setFormatting baseline note
Some Java source changes in this PR are expected output changes from using google-java-format 1.35.0. They are formatter-version baseline changes, not additional Java logic changes; the main examples are the four
benchmark-overheadtest files.Local timing
I measured this locally on a 24-vCPU environment using Temurin 25.0.3, with dependencies, tools, and Flint's native binary already installed. Timings are wall-clock medians of three runs unless noted otherwise. The ten-file rows use the same ten Java files in each tool.
96169eb)For the ten-file rows, Spotless is
./gradlew spotlessJavaCheckand Flint is the completemise run lint, so the Flint value includes all configured Flint checks, not only Java formatting. Flint has no persistent daemon; each value is a fresh native-process invocation. The formatter-only Flint checks took 0.052 s median when invoking the native binary directly.The warm Spotless runs reused the configuration cache and had six Spotless tasks execute for the changed files; the cold-daemon runs also reused the configuration cache but started after
./gradlew --stop. This confirms that the daemon is a major part of the delay, but it is not the same thing as the configuration phase: the configuration cache controls reuse of configuration/task-graph work, while the daemon controls JVM/process reuse. The cold-checkout run also had to execute 1,242 tasks and store the configuration cache, so it is a worst-case first run rather than a daemon-only comparison.The full Flint value is a genuine full-repository run using
--full; it is not the changed-file baseline path. google-java-format accounts for 16.4 s of that run, while regex-replace took 0.873 s and license-header 0.037 s. The earlier 18.8 s value includedmise execoverhead and is not used here.The migration changes
flint.tomlandmise.toml, so this PR intentionally triggers a full Flint baseline against the pre-migration commit. Once that baseline is established, a typical ten-file edit is sub-second.Companion PR
Depends on grafana/flint#407.
The
mise.tomlpin uses Flint commit57a4c9bso this consumer PR can validate the unreleased native checks. It should be changed back to the released Flint backend after the Flint feature is released.Validation
mise run lint:fix(using the companion Flint commit)license-header,regex-replace, andgoogle-java-formatchecksgit diff --check