File tree Expand file tree Collapse file tree 3 files changed +43
-49
lines changed Expand file tree Collapse file tree 3 files changed +43
-49
lines changed Original file line number Diff line number Diff line change
1
+ run :
2
+ deadline : 5m
3
+
4
+ linters :
5
+ disable-all : true
6
+ enable :
7
+ - dupl
8
+ - goconst
9
+ - gocyclo
10
+ - gofmt
11
+ - golint
12
+ - govet
13
+ - ineffassign
14
+ - interfacer
15
+ - lll
16
+ - misspell
17
+ - nakedret
18
+ - structcheck
19
+ - unparam
20
+ - varcheck
21
+
22
+ linters-settings :
23
+ dupl :
24
+ threshold : 400
25
+ lll :
26
+ line-length : 170
27
+ gocyclo :
28
+ min-complexity : 15
29
+ golint :
30
+ min-confidence : 0.85
Original file line number Diff line number Diff line change 5
5
6
6
go_import_path : sigs.k8s.io/kustomize
7
7
8
+ sudo : false
9
+
10
+ # Only clone the most recent commit.
11
+ git :
12
+ depth : 1
13
+
14
+ env :
15
+ - GOLANGCI_RELEASE="v1.10.2"
16
+
8
17
before_install :
9
18
- source ./bin/consider-early-travis-exit.sh
10
- - sudo apt-get install tree
11
- - go get -u github.com/golang/lint/golint
12
- - go get -u golang.org/x/tools/cmd/goimports
13
- - go get -u github.com/onsi/ginkgo/ginkgo
19
+ - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin ${GOLANGCI_RELEASE}
14
20
- go get -u github.com/monopole/mdrip
15
- - go get -u github.com/fzipp/gocyclo
16
- - go get -u gopkg.in/alecthomas/gometalinter.v2 && gometalinter.v2 --install
17
21
18
22
# Install must be set to prevent default `go get` to run.
19
23
# The dependencies have already been vendored by `dep` so
Original file line number Diff line number Diff line change @@ -11,10 +11,6 @@ cd "$base_dir" || {
11
11
12
12
rc=0
13
13
14
- function go_dirs {
15
- go list -f ' {{.Dir}}' ./... | tail -n +2 | tr ' \n' ' \0'
16
- }
17
-
18
14
function runTest {
19
15
local name=$1
20
16
local result=" SUCCESS"
@@ -28,40 +24,8 @@ function runTest {
28
24
printf " ============== end %s : %s code=%d\n\n\n" " $name " " $result " $code
29
25
}
30
26
31
- function testGoFmt {
32
- diff <( echo -n) <( go_dirs | xargs -0 gofmt -s -d -l)
33
- }
34
-
35
-
36
- function testGoCyclo {
37
- diff <( echo -n) <( go_dirs | xargs -0 gocyclo -over 15)
38
- }
39
-
40
- function testGoLint {
41
- diff -u <( echo -n) <( go_dirs | xargs -0 golint --min_confidence 0.85 )
42
- }
43
-
44
- # Not using the 'goimports' check because it reports hyphens in imported
45
- # package names as errors, and we vendor in packages that have
46
- # hyphens in their names.
47
- function testGoMetalinter {
48
- diff -u <( echo -n) <( go_dirs | xargs -0 gometalinter.v2 --disable-all --deadline 5m \
49
- --enable=misspell \
50
- --enable=structcheck \
51
- --enable=deadcode \
52
- --enable=varcheck \
53
- --enable=goconst \
54
- --enable=unparam \
55
- --enable=ineffassign \
56
- --enable=nakedret \
57
- --enable=interfacer \
58
- --enable=misspell \
59
- --line-length=170 --enable=lll \
60
- --dupl-threshold=400 --enable=dupl)
61
- }
62
-
63
- function testGoVet {
64
- go vet -all ./...
27
+ function testGoLangCILint {
28
+ golangci-lint run ./...
65
29
}
66
30
67
31
function testGoTest {
@@ -72,11 +36,7 @@ function testExamples {
72
36
mdrip --mode test --label test README.md ./examples
73
37
}
74
38
75
- runTest testGoFmt
76
- runTest testGoMetalinter
77
- runTest testGoLint
78
- runTest testGoVet
79
- runTest testGoCyclo
39
+ runTest testGoLangCILint
80
40
runTest testGoTest
81
41
runTest testExamples
82
42
You can’t perform that action at this time.
0 commit comments