Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heppu/go-review
Publish reports from different Go linters as gerrit reviews
https://github.com/heppu/go-review
ci gerrit go golang jenkins linting tools
Last synced: 4 months ago
JSON representation
Publish reports from different Go linters as gerrit reviews
- Host: GitHub
- URL: https://github.com/heppu/go-review
- Owner: heppu
- License: mit
- Created: 2019-07-11T14:12:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-05-17T13:04:13.000Z (over 2 years ago)
- Last Synced: 2024-09-30T09:25:27.451Z (4 months ago)
- Topics: ci, gerrit, go, golang, jenkins, linting, tools
- Language: Go
- Size: 33.2 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![GoDoc](https://godoc.org/github.com/heppu/go-review?status.svg)](https://godoc.org/github.com/heppu/go-review)
[![Build Status](https://travis-ci.com/heppu/go-review.svg?branch=master)](https://travis-ci.com/heppu/go-review)
[![Coverage Status](https://coveralls.io/repos/github/heppu/go-review/badge.svg?branch=master)](https://coveralls.io/github/heppu/go-review?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/heppu/go-review)](https://goreportcard.com/report/github.com/heppu/go-review)# Go Review
Publish reports from different Go linters as gerrit review comments as part of CI pipe.## Install
Specific release can be installed by downloading from [releases page](https://github.com/heppu/go-review/releases).
Latest version from master can be installed by running: `go get github.com/heppu/go-review/...`
## Usage
go-review uses following environment variables to access gerrit review server:
- `GERRIT_REVIEW_URL`: required
- `GERRIT_CHANGE_NUMBER`: required
- `GERRIT_PATCHSET_NUMBER`: required
- `GERRIT_USERNAME`: optional
- `GERRIT_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## Examples
Every linter that is able to produce similar output as go vet can be used as an input.### go vet
```sh
go vet ./... 2>&1 | go-review
```### golangci-lint
```sh
golangci-lint run --out-format=line-number --print-issued-lines=false | go-review
```### staticcheck
```sh
staticcheck ./... | go-review
```### Jenkins pipeline
```groovy
stage('Lint') {
steps {
sh 'golangci-lint run --new-from-rev=HEAD~ --out-format=line-number --print-issued-lines=false | go-review'
}
}
```