dashorst opened a new pull request, #1871:
URL: https://github.com/apache/wicket/pull/1871

   Spotless now checks the Java code format in every module during the build. 
The format is one Eclipse formatter profile, `codestyle/wicket-formatter.xml`, 
derived from the code base so that applying it changes as little as possible. 
The same change is prepared for `wicket-11.x` and `wicket-10.x` in separate PRs.
   
   **Merge this PR with "Create a merge commit", not squash or rebase.** 
`.git-blame-ignore-revs` lists the reformat commit by hash, and a squash or 
rebase gives it a different one.
   
   ## Commits
   
   1. **Reformat the Java sources with the Wicket formatter profile.** 1197 
files, +12.5k/−10.5k lines, whitespace only. With all whitespace removed every 
file is identical to before, and string literals and text blocks are unchanged. 
No need to review it line by line: `mvn spotless:apply` on the parent commit 
plus the profile reproduces it.
   2. **Check the Java code format in the build with Spotless.** This is the 
commit to review: the plugin configuration in `pom.xml`, the profile, 
`.editorconfig`, `.git-blame-ignore-revs`, and the code style sections in 
`README.md` and `AGENTS.md`.
   
   ## How the profile was derived
   
   Starting from the old `org.eclipse.jdt.core.prefs` as-is, Spotless would 
have changed 1804 files (+22.7k/−19.2k lines), much of it reflowed Javadoc with 
`<pre>` examples flattened into prose. Then:
   
   - Comment formatting is off, and line breaks put in by hand are kept.
   - Every formatter key was scored against all 3402 sources, and settings that 
shrank the diff were adopted, except where they would only preserve an 
inconsistency (blank lines before methods, say). The keys newer Eclipse 
releases added were missing from the old profile and fell back to Eclipse 
defaults; they now match the code.
   - The line length goes from 100 to 120 columns.
   
   What remains is code that deviates from the style the large majority of the 
code base already follows:
   
   | Change | Lines | Files |
   |---|---|---|
   | Brace moved to its own line | 9.7k | 452 |
   | Space indentation replaced by tabs | 4.1k | 365 |
   | Whitespace removed from empty lines | 2.9k | 397 |
   | Line over 120 columns wrapped | 1.9k | 251 |
   
   ## Things to know
   
   - **Line endings are preserved.** 187 Java files are committed with CRLF and 
there is no `.gitattributes`; normalizing them is a separate change.
   - **Finding the profile from a module.** 
`${maven.multiModuleProjectDirectory}` only points at the repository root when 
Maven runs there, and `.mvn/` is gitignored. Three small profiles look for 
`codestyle/` in the module and up to two levels above it, so `mvn 
spotless:check` also works inside `wicket-util` or 
`wicket-native-websocket/wicket-native-websocket-core`.
   - **IDEs.** Eclipse imports the profile. IntelliJ IDEA matches the build 
exactly with the Adapter for Eclipse Code Formatter plugin; importing the 
profile as a native scheme comes close. I could not test IntelliJ.
   - **Open pull requests** branched before this conflict with the reformat. 
Rebase them onto the parent of the reformat commit, run `mvn spotless:apply` 
with this profile and commit, then rebase onto the merged result.
   - **`wicket-eclipse-settings`** is unchanged. Whether to regenerate it from 
the new profile or drop it is still open in #1867.
   
   ## Verification
   
   - `mvn clean verify -Pjs-test` passes on the reformatted tree; 
`spotless:check` ran in all 34 modules.
   - `spotless:check` fails on an unformatted file and passes after 
`spotless:apply`, from the root and from nested modules.
   
   Part of #1867
   
   Generated-by: Claude Code (Claude Opus 5.5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to