mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
.travis, build: minor polishes, disable deadcode
This commit is contained in:
parent
4af254252a
commit
d79643167f
2 changed files with 10 additions and 15 deletions
|
|
@ -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
|
||||
|
|
|
|||
19
build/ci.go
19
build/ci.go
|
|
@ -25,7 +25,7 @@ Available commands are:
|
|||
|
||||
install [ -arch architecture ] [ packages... ] -- builds packages and executables
|
||||
test [ -coverage ] [ packages... ] -- runs the tests
|
||||
lint -- runs linters
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue