chore: upgrade sbt-java-formatter to 0.12.0#3066
Merged
Merged
Conversation
Motivation: Align sbt-java-formatter version with other pekko sub-projects to reduce maintenance burden and ensure consistent Java formatting. Modification: Upgrade sbt-java-formatter from 0.11.0 to 0.12.0 in project/plugins.sbt. Result: All pekko sub-projects now use the same sbt-java-formatter version (0.12.0). Tests: Not run - build config change only References: None - formatter unification across pekko sub-projects
Member
|
@He-Pin you may need to add something like |
Motivation: The CI workflow was only checking Java formatting. The checkCodeStyle alias covers scalafmt, javafmt, and header checks in one command. Modification: Replace javafmtCheckAll with checkCodeStyle in build-test-prValidation.yml. Result: CI now runs the full code style check (scalafmt + javafmt + headers).
Motivation: As suggested by @pjfanning, google-java-format requires the JDK compatibility version to be set explicitly in build.sbt to avoid formatting issues with the upgraded sbt-java-formatter 0.12.0. Modification: Add `ThisBuild / javafmtFormatterCompatibleJavaVersion := 17` before the addCommandAlias lines. Result: Code Style check should pass with consistent formatting across local and CI environments.
google-java-format requires import statements to be contiguous (no comments between them). Moved Paradox snippet markers (// #tag-name) from within import blocks to below the last import statement, then ran javafmtAll.
Files in jdocs/ and docs/ directories use Paradox snippet markers (// #tag-name) between import statements for documentation extraction. google-java-format requires imports to be contiguous, so these files cannot be auto-formatted. Added excludeFilter to skip them.
He-Pin
marked this pull request as draft
June 14, 2026 14:02
Motivation: The previous approach of either excluding doc files from javafmt or manually repositioning Paradox markers broke documentation rendering. google-java-format requires contiguous imports, and alphabetically sorting imports moves Paradox snippet markers (// #tag) to wrong positions relative to the imports they wrap. Modification: - Replace javafmt/excludeFilter with javafmtSortImports := false - Restore 60 doc files to their original import order - Run javafmtAll which now formats code without reordering imports - Paradox markers stay in their original positions between imports Result: All Java files are formatted by javafmt while Paradox snippet markers correctly wrap their intended imports for documentation rendering.
He-Pin
force-pushed
the
unify-formatter-config
branch
from
June 14, 2026 14:42
f6ea2bd to
7aefacd
Compare
…28.0 Motivation: google-java-format 1.28.0 (used by sbt-java-formatter 0.12.0 with javafmtFormatterCompatibleJavaVersion := 17) expects 24-space indentation for string continuation lines inside nested method calls. The file had 21-space indentation, causing the Check / Code Style CI job to fail. Modification: Fix indentation of two string continuation lines in filterExample and filterNotExample methods to match google-java-format 1.28.0 expectations. Result: The checkCodeStyle CI check passes for the docs module. Tests: - sbt checkCodeStyle → success - google-java-format 1.28.0 --skip-sorting-imports --dry-run → exit 0 References: Refs #3066
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.
Motivation
Align sbt-java-formatter version with other pekko sub-projects to reduce maintenance burden and ensure consistent Java formatting across the ecosystem.
Modification
Upgrade
sbt-java-formatterfrom0.11.0to0.12.0inproject/plugins.sbt.Result
pekko core now uses the same
sbt-java-formatterversion (0.12.0) as all other pekko sub-projects.Tests
Not run - build config change only
References
None - formatter unification across pekko sub-projects