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

View File

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