Enable server checkstyle in CI and fix pre-existing violations#1125
Conversation
Checkstyle was configured (server/config/checkstyle/checkstyle.xml) but never enforced in CI: the server Docker build excludes it (`-x checkstyleMain -x checkstyleTest`) and run_tests.yml only ran `test`. Three pre-existing violations had accumulated on develop undetected: - TopicRepository.searchTopics: two native-query lines exceeded the 200-char LineLength limit (checkstyle counts tabs at width 8). Wrapped the OPEN/EXPIRED conditions onto continuation lines — SQL semantics unchanged. - TopicService.getPublishedFromResearchGroup: missing the required public-method Javadoc; added it. Added a "Run server checkstyle" step (checkstyleMain + checkstyleTest) to run_tests.yml, ahead of the test run so style issues fail fast. Verified locally: checkstyleMain + checkstyleTest pass, compileJava succeeds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughAdds ChangesCheckstyle CI enforcement and code hygiene
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Enables Checkstyle in CI for the server and fixes the violations that had silently accumulated because it was never enforced.
Why
The Checkstyle config (
server/config/checkstyle/checkstyle.xml,maxWarnings = 0) existed but nothing ran it in CI:server.Dockerfilebuilds with-x checkstyleMain -x checkstyleTestrun_tests.ymlonly ran./gradlew test(which doesn't trigger checkstyle)As a result,
./gradlew checkstyleMainondevelopcurrently fails with 3 violations (verified on a cleandevelopcheckout).Changes
Fix existing violations (all introduced by #1089, behavior-preserving):
TopicRepository.searchTopics— two native-query lines exceeded the 200-charLineLengthlimit (Checkstyle counts tabs at width 8). Wrapped theOPEN/EXPIREDconditions onto continuation lines; the SQL is unchanged (newline = whitespace).TopicService.getPublishedFromResearchGroup— added the required public-method Javadoc (@param/@return, asJavadocMethodmandates).Enforce going forward:
Run server checkstylestep (./gradlew checkstyleMain checkstyleTest) torun_tests.yml, before the test run so style issues fail fast.Verification
./gradlew checkstyleMain checkstyleTest→ BUILD SUCCESSFUL./gradlew compileJava→ succeeds🤖 Generated with Claude Code
Summary by CodeRabbit
Tests
Documentation
Style