Publish reports from different Go linters as gerrit review comments as part of CI pipe.
Specific release can be installed by downloading from releases page.
Latest version from master can be installed by running: go get github.com/heppu/go-review/...
go-review uses following environment variables to access gerrit review server:
GERRIT_REVIEW_URL
: requiredGERRIT_CHANGE_NUMBER
: requiredGERRIT_PATCHSET_NUMBER
: requiredGERRIT_USERNAME
: optionalGERRIT_PASSWORD
: optional - This is the HTTP Credential, not the password used to login to gerrit.
Behavior can be controlled with following flags:
-version
: print versions details and exit-dry-run
: parse env vars and input but do not publish review-show
: print lines while parsing
Every linter that is able to produce similar output as go vet can be used as an input.
go vet ./... 2>&1 | go-review
golangci-lint run --out-format=line-number --print-issued-lines=false | go-review
staticcheck ./... | go-review
stage('Lint') {
steps {
sh 'golangci-lint run --new-from-rev=HEAD~ --out-format=line-number --print-issued-lines=false | go-review'
}
}