mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
all: update metalinter to v2
This commit is contained in:
parent
bf62acf033
commit
1b47c17ccf
3 changed files with 6 additions and 4 deletions
|
|
@ -319,8 +319,8 @@ func doLint(cmdline []string) {
|
||||||
packages = flag.CommandLine.Args()
|
packages = flag.CommandLine.Args()
|
||||||
}
|
}
|
||||||
// Get metalinter and install all supported linters
|
// Get metalinter and install all supported linters
|
||||||
build.MustRun(goTool("get", "gopkg.in/alecthomas/gometalinter.v1"))
|
build.MustRun(goTool("get", "gopkg.in/alecthomas/gometalinter.v2"))
|
||||||
build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v1"), "--install")
|
build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v2"), "--install")
|
||||||
|
|
||||||
// Run fast linters batched together
|
// Run fast linters batched together
|
||||||
configs := []string{
|
configs := []string{
|
||||||
|
|
@ -332,12 +332,12 @@ func doLint(cmdline []string) {
|
||||||
"--enable=goconst",
|
"--enable=goconst",
|
||||||
"--min-occurrences=6", // for goconst
|
"--min-occurrences=6", // for goconst
|
||||||
}
|
}
|
||||||
build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v1"), append(configs, packages...)...)
|
build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v2"), append(configs, packages...)...)
|
||||||
|
|
||||||
// Run slow linters one by one
|
// Run slow linters one by one
|
||||||
for _, linter := range []string{"unconvert", "gosimple"} {
|
for _, linter := range []string{"unconvert", "gosimple"} {
|
||||||
configs = []string{"--vendor", "--deadline=10m", "--disable-all", "--enable=" + linter}
|
configs = []string{"--vendor", "--deadline=10m", "--disable-all", "--enable=" + linter}
|
||||||
build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v1"), append(configs, packages...)...)
|
build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v2"), append(configs, packages...)...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue