From 2e26b208199945f200d4bf0aa1b44e5ebdbdcd75 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 5 Dec 2026 00:22:13 +0000 Subject: [PATCH] ci: enforce formatting with fmt:check instead of silent reformat The build bound fmt:format, which silently reformatted sources during CI instead of failing on violations. Besides hiding formatting problems from contributors, this corrupted coverage measurement: compiled classes corresponded to the rewritten sources while Sonar analysis runs on the committed sources, so jacoco line numbers fell out of range and coverage imports were silently dropped per file (observed on #488 for RoasterCodeGenerator and BuilderDefinitionCreator). The build now fails with a clear message when sources are not formatted; contributors run 'mvn fmt:format' before committing. --- docs/CONTRIBUTING.md | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 38a52d16..c18cba88 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -317,10 +317,10 @@ This is **critical** for debugging because annotation processing happens inside The project uses [google-java-format](https://github.com/google/google-java-format) for consistent code formatting. -**Automatic formatting** is applied during build via the `fmt-maven-plugin`: +**Formatting is enforced during build**: the `fmt-maven-plugin` runs in `check` mode, so the build fails when sources are not formatted. Format your code before committing: ```bash -# Format code automatically +# Format code automatically (run before committing) mvn fmt:format # Check formatting without modifying files diff --git a/pom.xml b/pom.xml index 08038ab3..27bc1596 100644 --- a/pom.xml +++ b/pom.xml @@ -158,7 +158,7 @@ - format + check