Skip to content

Add Checkstyle linter to Java backend#8

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-linter-to-java-project
Draft

Add Checkstyle linter to Java backend#8
Copilot wants to merge 2 commits intomainfrom
copilot/add-linter-to-java-project

Conversation

Copy link

Copilot AI commented Dec 11, 2025

Adds Checkstyle-based code quality enforcement to the Spring Boot backend.

Implementation

  • Maven plugin: Checkstyle 10.12.5 via maven-checkstyle-plugin 3.3.1, runs in validate phase
  • Ruleset: Google Java Style with pragmatic adaptations (120 char lines, relaxed JavaDoc for non-public APIs)
  • Build behavior: Reports violations as warnings, doesn't fail builds (failOnViolation=false)
  • CI integration: Explicit linting step in GitHub Actions before test execution

Configuration highlights

Key checks enabled in backend/checkstyle.xml:

  • No wildcard imports
  • Naming conventions (package/class/method/variable)
  • Line length and whitespace rules
  • Common antipatterns (missing switch default, unused imports)
  • Method complexity limits (150 lines, 7 parameters)

Usage

# Quick check
mvn checkstyle:check

# Generate HTML report
mvn checkstyle:checkstyle
# Report: target/site/checkstyle.html

Current codebase has 14 minor violations (star imports, 4 lines exceeding 120 chars).

Original prompt

Add a linter for the java project


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: yortch <4576246+yortch@users.noreply.github.com>
Copilot AI changed the title [WIP] Add linter for the Java project Add Checkstyle linter to Java backend Dec 11, 2025
Copilot AI requested a review from yortch December 11, 2025 21:55
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.

2 participants