aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/ci.go5
-rwxr-xr-xbuild/goimports.sh18
2 files changed, 22 insertions, 1 deletions
diff --git a/build/ci.go b/build/ci.go
index 91de4e876..5fce3c8e6 100644
--- a/build/ci.go
+++ b/build/ci.go
@@ -329,7 +329,10 @@ func doLint(cmdline []string) {
// Run fast linters batched together
configs := []string{
"--vendor",
+ "--tests",
"--disable-all",
+ "--enable=goimports",
+ "--enable=varcheck",
"--enable=vet",
"--enable=gofmt",
"--enable=misspell",
@@ -340,7 +343,7 @@ func doLint(cmdline []string) {
// Run slow linters one by one
for _, linter := range []string{"unconvert", "gosimple"} {
- configs = []string{"--vendor", "--deadline=10m", "--disable-all", "--enable=" + linter}
+ configs = []string{"--vendor", "--tests", "--deadline=10m", "--disable-all", "--enable=" + linter}
build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v2"), append(configs, packages...)...)
}
}
diff --git a/build/goimports.sh b/build/goimports.sh
new file mode 100755
index 000000000..6d67ef1f0
--- /dev/null
+++ b/build/goimports.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+find_files() {
+ find . -not \( \
+ \( \
+ -wholename '.github' \
+ -o -wholename './build/_workspace' \
+ -o -wholename './build/bin' \
+ -o -wholename './crypto/bn256' \
+ -o -wholename '*/vendor/*' \
+ \) -prune \
+ \) -name '*.go'
+}
+
+GOFMT="gofmt -s -w";
+GOIMPORTS="goimports -w";
+find_files | xargs $GOFMT;
+find_files | xargs $GOIMPORTS; \ No newline at end of file