diff --git a/.travis.yml b/.travis.yml index 4050c01a15..fe3b04cd2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,11 +50,13 @@ matrix: - go run build/ci.go install - go run build/ci.go test -coverage - # This only tests code linters on latest version of Go + # This builder only tests code linters on latest version of Go - os: linux dist: trusty sudo: required go: 1.9.x + env: + - lint script: - sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install fuse - sudo modprobe fuse diff --git a/build/ci.go b/build/ci.go index 638253b101..5d52fad87c 100644 --- a/build/ci.go +++ b/build/ci.go @@ -24,8 +24,8 @@ Usage: go run ci.go Available commands are: install [ -arch architecture ] [ packages... ] -- builds packages and executables - test [ -coverage ] [ packages... ] -- runs the tests - lint -- runs linters + test [ -coverage ] [ packages... ] -- runs the tests + lint -- runs certain pre-selected linters archive [ -arch architecture ] [ -type zip|tar ] [ -signer key-envvar ] [ -upload dest ] -- archives build artefacts importkeys -- imports signing keys from env debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package @@ -57,8 +57,8 @@ import ( "runtime" "strings" "time" - "github.com/ethereum/go-ethereum/internal/build" + "github.com/ethereum/go-ethereum/internal/build" ) var ( @@ -312,26 +312,19 @@ func doTest(cmdline []string) { // runs gometalinter on requested packages func doLint(cmdline []string) { - flag.CommandLine.Parse(cmdline) packages := []string{"./..."} - if len(flag.CommandLine.Args()) > 0 { packages = flag.CommandLine.Args() - for _, pkg := range packages { - packages = append(packages, fmt.Sprintf("%s/...", pkg)); - } } - - - //get metalinter and install linters + // Get metalinter and install all supported linters build.MustRun(goTool("get", "gopkg.in/alecthomas/gometalinter.v1")) - build.MustRunCommand(filepath.Join(GOBIN,"gometalinter.v1"), "--install") + build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v1"), "--install") - configs := []string{"--vendor", "--disable-all", "--enable=vet", "--enable=deadcode"} // Add additional linters to the slice with "--enable=linter-name" + configs := []string{"--vendor", "--disable-all", "--enable=vet"} // Add additional linters to the slice with "--enable=linter-name" - build.MustRunCommand(filepath.Join(GOBIN,"gometalinter.v1"), append(configs, packages...)...) + build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v1"), append(configs, packages...)...) } // Release Packaging