google / yamlfmt

An extensible command line tool or library to format yaml files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support reviewdog

takumin opened this issue · comments

Movivation

Integrating reviewdog with yamlfmt will allow for easy and sound pull request review.
The reviewdog can receive error reports in errorformat, RDformat or Diff format.
Currently it is possible to parse yamlfmt error messages with errorformat, but diffs in dryrun mode are difficult to parse with reviewdog.

Proposal

  1. yamlfmt dryrun mode, display messages in Diff format.
  2. yamlfmt lint mode, display messages in shellcheck compatible format.

Example

You can easily integrate yamlfmt and reviewdog by simply setting the following in reviewdog.

runner:
  yamlfmt-lint:
    cmd: yamlfmt -lint .
    format: shellcheck
  yamlfmt-format:
    cmd: yamlfmt -dry .
    format: diff

Thanks to all of you for your great work.