This is a GitHub action to run Checkstyle check on your Java code and report status via reviewdog on pull request.
An example of how the reported checkstyle violations will look like on pull request is shown below (link to PR):
name: reviewdog
on: [pull_request]
jobs:
checkstyle:
name: runner / checkstyle
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dbelyaev/action-checkstyle@v0.5.1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
level: warning
-
Checkstyle configuration specifies which ruleset to apply during the scan.
There are two built-in configurations:google_checks.xml
config for the Google coding conventionssun_checks.xml
config for the Sun coding conventions
It is also possible to supply your custom Checkstyle configuration file located in the same directory.
Default:
google_checks.xml
-
Checkstyle version to be used during analysis.
For a list of available version numbers go to Checkstyle release page.Default:
9.2
-
Working directory relative to the root directory.
Default:
.
-
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 of reviewdog command.
See more in reviewdog documentation: https://github.com/reviewdog/reviewdog#reportersValues:
[github-pr-check, github-check, github-pr-review]
Default:
github-pr-check
-
Filtering mode for the reviewdog command.
See more in reviewdog documentation: https://github.com/reviewdog/reviewdog#filter-modeValues:
[added, diff_context, file, nofilter]
Default:
added
-
Exit code for reviewdog when errors are found.
Values:
[true, false]
Default:
false
-
Additional reviewdog flags.
Default:
``