reviewdog

Parses linter output and posts findings in changed lines as review comments on GitHub, GitLab, and Bitbucket, or filters lint results by diff locally.

install

reviewdog is a code review automation tool that reads the output of linters and compilers, then posts findings as review comments on code hosting services. It only reports findings that fall within the diff of the patch under review, so existing issues elsewhere in the codebase are filtered out. It can also run locally to filter lint output by a diff, for example git diff FETCH_HEAD.

Input is read from stdin and parsed with 'errorformat', a port of Vim's errorformat. For example, golint ./... | reviewdog -efm="%f:%l:%c: %m" -diff="git diff FETCH_HEAD". Pre-defined formats for common tools are listed with reviewdog -list and selected with -f={name}. It also accepts Reviewdog Diagnostic Format (rdjson and rdjsonl), checkstyle, and SARIF formats. RDFormat supports multiline ranged comments, severity, rule codes with URLs, and code suggestions. For example, eslint -f rdjson . | reviewdog -f=rdjson -reporter=github-pr-review using eslint-formatter-rdjson.

Output is selected with the -reporter flag. Options include local (default), github-pr-check, github-check, github-pr-review, github-annotations, github-pr-annotations, gitlab-mr-discussion, gitlab-mr-commit, and bitbucket-code-report. The README documents use in GitHub Actions, Travis CI, Circle CI, GitLab CI, Bitbucket Pipelines, and Jenkins. It also describes a config file, exit codes, and a filter mode. It is intended for developers and CI maintainers who want lint results shown on pull requests or merge requests, regardless of language or linter.

Installation

# via Homebrew
brew install --cask reviewdog/tap/reviewdog
# via Go
go install github.com/reviewdog/reviewdog/cmd/reviewdog@latest
# via Scoop
scoop install reviewdog

reviewdog local demo

Review comment in a pull request

github-pr-check sample

Alternatives & related tools

add a badge to your README

Maintain reviewdog? Show that it's featured on trmn. The badge links back to this page.

Featured on trmn
Markdown
[![Featured on trmn](https://www.trmn.sh/badge/reviewdog.svg)](https://www.trmn.sh/tools/reviewdog?utm_source=badge)
HTML
<a href="https://www.trmn.sh/tools/reviewdog?utm_source=badge"><img src="https://www.trmn.sh/badge/reviewdog.svg" alt="Featured on trmn" height="20"></a>