build: Improve setup, add metalint ineffasign

This commit is contained in:
Jakob Borg 2016-11-24 11:33:43 +01:00
parent 91568a173a
commit 911c148c71
1 changed files with 17 additions and 8 deletions

View File

@ -298,6 +298,7 @@ func runCommand(cmd string, target target) {
ok := gometalinter("deadcode", dirs, "test/util.go")
ok = gometalinter("structcheck", dirs) && ok
ok = gometalinter("varcheck", dirs) && ok
ok = gometalinter("ineffassign", dirs) && ok
if !ok {
os.Exit(1)
}
@ -356,14 +357,22 @@ func checkRequiredGoVersion() (float64, bool) {
}
func setup() {
runPrint("go", "get", "-u", "-v", "github.com/golang/lint/golint")
runPrint("go", "get", "-u", "-v", "golang.org/x/tools/cmd/cover")
runPrint("go", "get", "-u", "-v", "golang.org/x/net/html")
runPrint("go", "get", "-u", "-v", "github.com/FiloSottile/gvt")
runPrint("go", "get", "-u", "-v", "github.com/axw/gocov/gocov")
runPrint("go", "get", "-u", "-v", "github.com/AlekSi/gocov-xml")
runPrint("go", "get", "-u", "-v", "github.com/alecthomas/gometalinter")
runPrint("go", "get", "-u", "-v", "github.com/mitchellh/go-wordwrap")
packages := []string{
"github.com/alecthomas/gometalinter",
"github.com/AlekSi/gocov-xml",
"github.com/axw/gocov/gocov",
"github.com/FiloSottile/gvt",
"github.com/golang/lint/golint",
"github.com/gordonklaus/ineffassign",
"github.com/mitchellh/go-wordwrap",
"github.com/opennota/check/cmd/...",
"golang.org/x/net/html",
"golang.org/x/tools/cmd/cover",
}
for _, pkg := range packages {
fmt.Println(pkg)
runPrint("go", "get", "-u", pkg)
}
}
func test(pkgs ...string) {