Skip to content

WIP - not working ATM! reviewdog based GitHub action to run PMD on your code.

License

Notifications You must be signed in to change notification settings

dbelyaev/action-pmd

Repository files navigation

action-pmd

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

This is a GitHub action to run PMD checks on your code and report the status via reviewdog on pull requests.

Example

An example of how the reported PMD violations will look on a pull request is shown below ([link to example PR](TODO ADD)):

![PR comment with violation](TODO ADD IMAGE)

Usage

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

Input parameters

PMD parameters

  • rulesets_path

    Path to the ruleset xml file.

    For more information, check PMD / options / rulesets documentation.

    Default: rulesets/java/quickstart.xml

    Example:

    name: reviewdog
    on: [pull_request]
    jobs:
      checkstyle:
        name: runner / pmd
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: dbelyaev/action-checkstyle@master
            with:
              github_token: ${{ secrets.github_token }}
              reporter: github-pr-review
              rulesets_path: rulesets/java/quickstart.xml

    Link to [example PR](TODO ADD).

  • workdir

    The working directory relative to the root directory.

    Default: . (root)

Reviewdog parameters

  • level

    Report level for the reviewdog command.

    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 for the reviewdog command.

    For more information, check reviewdog / reporters documentation.

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

    Default: github-pr-check

  • filter_mode

    Filtering mode for the reviewdog command.

    For more information, check reviewdog / filter-mode documentation.

    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: ``

About

WIP - not working ATM! reviewdog based GitHub action to run PMD on your code.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published