Add support for method name in coverage.
pre-commit-go project includes two tools:
pcg to run checks on a Go project on commit and on push via git hooks.covg which is a yet-another-coverage-tool but that is more parallel than any other coverage tool.pre-commit-go is under heavy development. If you plan to use it as part of a CI, please make sure to pin your version or track it closely. We'll eventually settle and keep backward compability but the tool is not mature yet, so simply vendor it for now.
go get github.com/maruel/pre-commit-go/cmd/...
Use built-in help to list all options and commands:
pcg help
Run from within a git checkout inside $GOPATH. This installs the git hooks within .git/hooks and runs the checks in mode pre-push. It runs the checks on the diff against @{upstream}:
pcg
It may become necessary to commit something known to be broken. To bypass the pre-commit hook, use:
git commit --no-verify (or -n) git push --no-verify (-n does something else! <3 git)
covg
You can use the -g flag to enable global inference, that is, coverage induced by a unit test will work across package boundary.
See Configuration for more details if you want to tweak the default checks. The default checks are meant to be sensible, you can list them with:
pcg info
pre-commit-go is designed to be used as part of CI. This is described in its own page.