Skip to content

Add Checkstyle for Automated Code Style Enforcement #399

Description

@tzolov

Add Checkstyle to the project to enforce consistent code formatting and style across the codebase, preventing the need for manual formatting PRs like #392.

Activity

  1. crazybolillo commented on Jul 18, 2025

    @crazybolillo

    I think Spotless plugin would be a better option, what do you think? Besides enforcing, it also auto-formats code. I have had to work with checkstyle in the past and the dev experience feels a bit clunky.

    The project can be re-formatted all at once and have that commit in .git-blame-ignore-revs. Another approach also supported by Spotless is to do it in a gradual fashion and enforce formatting only on files that have been modified past a certain tag.

    I can help out with a PR. The project needs to chose a formatting style first. I personally like the prettier java format (maintained by JHipster).

  2. dasarathirout commented on Jul 20, 2025

    @dasarathirout

    @tzolov spring-javaformat is present in pom https://github.com/modelcontextprotocol/java-sdk/blob/main/pom.xml#L113-L126. we can set to goal apply spring-javaformat:apply. It will execute when we ran mvn install command to reformat the code
    PR:#418

  3. dasarathirout commented on Jul 20, 2025

    @dasarathirout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions