IntelliJ Format Checker with reviewdog
Runs the formatter on code to check if the code has been formatted according to standards.
Supports both default IntelliJ formatting and custom format settings
Uses the file:
.idea/codeStyles/Project.xml to format the code if this is present or else defaults to IntelliJ formatting.
Example:
Pattern for files to include in the formatting, e.g. *.java,*.kt.
Default: *.
Root path from which files to format are searched recursively. Must be relative to the workspace.
Default: ..
Reporter of reviewdog command [github-pr-check,github-pr-review].
It's same as -reporter flag of reviewdog.
Default: github-pr-review.
Optional. Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
It's same as -reporter flag of reviewdog.
Default: added.
Tool name to use for reviewdog reporter.
Default: diff.
Causes the action to fail upon detecting files changed by running the formatter if set to true.
Default: false.
Outputs the list of files which are not formatted properly.
Zero if none changed.
jobs:
intelliJ:
runs-on: ubuntu-latest
name: IntelliJ
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check IntelliJ Formatting
uses: sidhant92/intellij-format-action@v1
with:
tool_name: 'IntelliJ Diff'
github_token: ${{ secrets.github_token }}
fail_on_changes: true
path: '.'
file_mask: '*.java'