Skip to content

Fail the build on any checkstyle violation - #56

Merged
perNyfelt merged 5 commits into
mainfrom
checkstyle-zero-warnings
Oct 19, 2026
Merged

perNyfelt merged 5 commits into
mainfrom
checkstyle-zero-warnings

Conversation

@perNyfelt

Copy link
Copy Markdown
Member

Checkstyle reported violations at warning severity and Gradle's default maxWarnings is unlimited, so violations only printed [WARN] lines and check still passed. They were easy to miss, and new ones kept being added.

Changes

  1. Fix the 11 existing warnings (37a8ed6): pure renames plus one Javadoc comment, no behavior change.
    • ImageDecoder: kEnd/vStart → keyEnd/valueStart; pngZTxtChunk/pngITxtChunk → pngZtxtChunk/pngItxtChunk.
    • ImageDecoderTest: tRnsOn… → trnsOn… (2 tests).
    • HfTokenizerTest: aBundle… / aMalformed… → bundle… / malformed….
    • SmolVlmGeometryPlan: Javadoc on the compact constructor (same wording as Qwen3VlGeometryPlan).
  2. Enforce zero warnings (3a0ed3a): maxWarnings = 0 in the root subprojects checkstyle block and in buildSrc/build.gradle. AGENTS.md and README.md document the policy.

Verification (local, macOS 26 / Apple Silicon, native libs staged)

  • All checkstyle tasks (checkstyleMain, checkstyleTest, checkstyleTestFixtures, :jmlx-models:checkstyleTierB, :jmlx-models:checkstyleExactBits) rerun from scratch: 0 violations across all reports.
  • ./gradlew check: passes (vision 140, tokenizer 205, models 403, core 424 tests; 0 failures).
  • ./gradlew -p buildSrc check: passes.
  • Enforcement check: putting back one old name (aBundleWithoutAnyTemplateSourceStillHasNoTemplates) makes :jmlx-tokenizer:check fail with "Checkstyle rule violations were found".

Interaction with #55: #55 already renames its three test methods, so it has no checkstyle violations and the two PRs don't overlap. Merge order doesn't matter.

🤖 Generated with Claude Code

perNyfelt and others added 5 commits October 19, 2026 21:48
- ImageDecoder: rename the kEnd/vStart locals to keyEnd/valueStart and
  pngZTxtChunk/pngITxtChunk to pngZtxtChunk/pngItxtChunk.
- ImageDecoderTest: tRnsOn* test methods become trnsOn*.
- HfTokenizerTest: drop the leading "a" from two test method names.
- SmolVlmGeometryPlan: document the compact constructor, matching
  Qwen3VlGeometryPlan.

Pure renames plus one Javadoc comment; no behavior change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The checkstyle config reports at warning severity and Gradle's default
maxWarnings is unlimited, so violations only printed [WARN] lines and
check still passed. Set maxWarnings = 0 in the root subprojects block and
in buildSrc so every violation fails check, the same as spotlessCheck.
AGENTS.md and README.md document the policy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The zero-warning note in AGENTS.md forbade suppressions outright, although
checkstyle.xml deliberately enables @SuppressWarnings, CHECKSTYLE.SUPPRESS
comments and an optional checkstyle-suppressions.xml. Permit a targeted
suppression where a name is genuinely externally constrained, with a
comment saying why; raising maxWarnings stays forbidden.

Also say that a buildSrc violation fails ./gradlew -p buildSrc check,
which is separate from the root check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
checkstyle.xml reads the suppressions file from
${org.checkstyle.google.suppressionfilter.config}, defaulting to a relative
checkstyle-suppressions.xml, and neither build sets that property. A file
in config/checkstyle/, the repo root or a module directory therefore never
takes effect. Only the two mechanisms verified to work are listed:
@SuppressWarnings("checkstyle:<Check>") and the
CHECKSTYLE.SUPPRESS: <Check> for +N lines comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@perNyfelt
perNyfelt merged commit 128cd1e into main Oct 19, 2026
3 checks passed
@perNyfelt
perNyfelt deleted the checkstyle-zero-warnings branch October 19, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant