Created
May 5, 2020 09:18
-
-
Save jovandeginste/8cd53fca75340eaa65b45c415f057206 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
COVERFILE=$(mktemp "coverXXX.out") | |
trap "{ rm -vf $COVERFILE; }" EXIT | |
DIR=${1:-./...} | |
case "${FULL:-no}" in | |
y*) | |
: ${REV:=} | |
: ${P:=--color=always} | |
;; | |
*) | |
: ${REV:=HEAD~1} | |
: ${P:=-n --color=always} | |
;; | |
esac | |
set -x | |
go test -mod vendor -coverprofile="$COVERFILE" "$DIR" | |
go tool cover -func="$COVERFILE" | |
golangci-lint run --config ~/.golangci.yml --new-from-rev "${REV}" $P |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment