Skip to content

checking Java code style #1877

Open
Open
@stephengold

Description

@stephengold

PR #1655 documented this project's preferred Java coding style. The next step would be to add tools that nudge the project toward compliance with that style.

For my own projects, I've begun using Checkstyle. It is highly configurable and integrated nicely into Gradle. That's the tool I recommend.

Here's how I envision the process:

  1. Add a checkstyle configuration file with a handful of modules and <property name="severity" value="warning"/>. Add apply plugin: 'checkstyle' to common.gradle. This could generate warnings for minor style issues like tab characters, unused imports, and trailing whitespace.
  2. Clean up the "master" branch until there are no checkstyle warnings.
  3. Up the severity to "error" so that style issues abort the build.
  4. Further cleanup the "master" branch, adding checkstyle modules as we go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions