Skip to content

sidhant92/intellij-format-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IntelliJ IDEA formatter action

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:

Screenshot 2021-12-23 at 2 17 50 AM

Inputs

file_mask

Pattern for files to include in the formatting, e.g. *.java,*.kt.

Default: *.

path

Root path from which files to format are searched recursively. Must be relative to the workspace.

Default: ..

reporter

Reporter of reviewdog command [github-pr-check,github-pr-review]. It's same as -reporter flag of reviewdog.

Default: github-pr-review.

filter_mode

Optional. Filtering mode for the reviewdog command [added,diff_context,file,nofilter]. It's same as -reporter flag of reviewdog.

Default: added.

tool_name

Tool name to use for reviewdog reporter.

Default: diff.

fail_on_changes

Causes the action to fail upon detecting files changed by running the formatter if set to true.

Default: false.

Outputs

files-changed

Outputs the list of files which are not formatted properly.

Zero if none changed.

Example usage

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'

About

Github Action for Enforcing IntelliJ Code Formatting

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors