code-review-bot
code-review-bot copied to clipboard
Code review bot and CLA verifier
Code Review Bot
Prerequisites
Ensure that you have installed Go 1.11 or higher to enable support for Go
modules via go mod.
If you're using Go 1.11 or 1.12, set the environment variable GO111MODULE=on
(Go 1.13 and later versions automatically enable module
support).
Building
To build the crbot tool without a cloned repo (assuming that $GOPATH/bin is
in your $PATH):
$ go get github.com/google/code-review-bot/cmd/crbot
$ crbot [options]
Or, from a cloned repo:
$ git clone https://github.com/google/code-review-bot.git
$ cd code-review-bot
$ go build ./cmd/crbot
$ ./crbot [options]
Developing
Install GoMock:
$ go get github.com/golang/mock/[email protected]
$ go get github.com/golang/mock/[email protected]
Generate the mocks:
$ go generate ./...
This specific version of both gomock and mockgen tools is what's used in
this repo, and tests will fail if your version of these tools generates
different code, including comments.
To update the versions of these tools used in this repo:
- update the version numbers in this file (above) as well as in
.github/workflows/main.ymlandgo.modto match - run
go mod tidyto update thego.sumfile - run the updated
go getcommands above to get newer versions of the tools - run the
go generatecommand above to regenerate the mocks - run the tests from the top-level of the tree
- commit your changes to this file (
README.md),go.mod,go.sum, and.travis.yml, making sure that the build passes on Travis CI before merging the change
Testing
Just what you might expect:
$ make test
Contributing
See CONTRIBUTING.md for more details.
License
Apache 2.0; see LICENSE for more details.
Disclaimer
This project is not an official Google project. It is not supported by Google and Google specifically disclaims all warranties as to its quality, merchantability, or fitness for a particular purpose.