Skip to content

Latest commit

 

History

History
115 lines (74 loc) · 4.05 KB

README.md

File metadata and controls

115 lines (74 loc) · 4.05 KB

Checkstyle for Java GitHub Action

Test reviewdog depup release GitHub release (latest SemVer) action-bumpr supported

This is a GitHub action to run Checkstyle check on your Java code and report status via reviewdog on pull request.

Example

An example of how the reported checkstyle violations will look like on pull request is shown below (link to PR):

PR comment with violation

Usage

name: reviewdog
on: [pull_request]
jobs:
  checkstyle:
    name: runner / checkstyle
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: dbelyaev/action-checkstyle@v0.7.4
        with:
          github_token: ${{ secrets.github_token }}
          reporter: github-pr-review
          level: warning

Input parameters

  • checkstyle_config

    Checkstyle configuration specifies which ruleset to apply during the scan.
    There are two built-in configurations:

    It is also possible to supply your custom Checkstyle configuration file located in the same directory.

    Default: google_checks.xml

  • checkstyle_version

    Checkstyle version to be used during analysis.
    For a list of available version numbers go to Checkstyle release page.

    IMPORTANT NOTE This field will always try to follow Checkstyle releases as close as possible and will use the latest available by default. If it is not a default preference for your project, please, pin the needed version using this property.

    Default: 10.9.3

  • workdir

    Working directory relative to the root directory.

    Default: .

  • level

    Report level for reviewdog.

    Values: [info, warning, error]

    You can control GitHub status check result with this feature.

    Level GitHub Status
    info neutral
    warning neutral
    error failure

    Default: info

  • reporter

    Reporter of reviewdog command.
    See more in reviewdog documentation: https://github.com/reviewdog/reviewdog#reporters

    Values: [github-pr-check, github-check, github-pr-review]

    Default: github-pr-check

  • filter_mode

    Filtering mode for the reviewdog command.
    See more in reviewdog documentation: https://github.com/reviewdog/reviewdog#filter-mode

    Values: [added, diff_context, file, nofilter]

    Default: added

  • fail_on_error

    Exit code for reviewdog when errors are found.

    Values: [true, false]

    Default: false

  • reviewdog_flags

    Additional reviewdog flags.

    Default: ``