File tree Expand file tree Collapse file tree 10 files changed +409
-132
lines changed Expand file tree Collapse file tree 10 files changed +409
-132
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ name: test
4
4
on : ["push", "pull_request"]
5
5
6
6
env :
7
- GO_VERSION : " 1.20 "
7
+ GO_VERSION : " 1.22 "
8
8
LINUX_ARCHES : " amd64 386 arm arm64 s390x mips64le ppc64le"
9
9
10
10
jobs :
37
37
- uses : actions/checkout@v4
38
38
39
39
- name : Install test binaries
40
- env :
41
- GO111MODULE : off
42
40
run : |
43
- go get github.com/modocache/gover
44
- go get github.com/mattn/goveralls
41
+ go install github.com/modocache/gover@latest
42
+ go install github.com/mattn/goveralls@latest
45
43
46
44
- name : test
47
45
run : PATH=$PATH:$(go env GOPATH)/bin COVERALLS=1 make check
53
51
PATH=$PATH:$(go env GOPATH)/bin
54
52
gover
55
53
goveralls -coverprofile=gover.coverprofile -service=github
54
+
55
+ lint :
56
+ name : Run golangci-lint
57
+ runs-on : ubuntu-latest
58
+ steps :
59
+ - uses : actions/checkout@v4
60
+ - uses : actions/setup-go@v5
61
+ - run : make lint
Original file line number Diff line number Diff line change
1
+ /build
1
2
/_output /
2
3
* .o
3
4
* .orig
4
5
ocicnitool
5
6
* .coverprofile
7
+ * .test
Original file line number Diff line number Diff line change
1
+ ---
2
+ run :
3
+ concurrency : 6
4
+ deadline : 10m
5
+ linters :
6
+ disable-all : true
7
+ enable :
8
+ - asasalint
9
+ - asciicheck
10
+ - bidichk
11
+ - bodyclose
12
+ - containedctx
13
+ - contextcheck
14
+ - decorder
15
+ - dogsled
16
+ - dupl
17
+ - dupword
18
+ - durationcheck
19
+ - errcheck
20
+ - errchkjson
21
+ - errname
22
+ - errorlint
23
+ - execinquery
24
+ - exhaustive
25
+ - exportloopref
26
+ - forbidigo
27
+ - forcetypeassert
28
+ - gocheckcompilerdirectives
29
+ - gochecknoinits
30
+ - gochecksumtype
31
+ - goconst
32
+ - gocritic
33
+ - gocyclo
34
+ - godox
35
+ - gofmt
36
+ - gofumpt
37
+ - goheader
38
+ - goimports
39
+ - gomoddirectives
40
+ - gomodguard
41
+ - goprintffuncname
42
+ - gosimple
43
+ - gosmopolitan
44
+ - govet
45
+ - grouper
46
+ - importas
47
+ - inamedparam
48
+ - ineffassign
49
+ - interfacebloat
50
+ - logrlint
51
+ - maintidx
52
+ - makezero
53
+ - mirror
54
+ - misspell
55
+ - musttag
56
+ - nakedret
57
+ - nilerr
58
+ - nilnil
59
+ - noctx
60
+ - nolintlint
61
+ - nosprintfhostport
62
+ - paralleltest
63
+ - perfsprint
64
+ - prealloc
65
+ - predeclared
66
+ - promlinter
67
+ - protogetter
68
+ - reassign
69
+ - rowserrcheck
70
+ - sloglint
71
+ - spancheck
72
+ - sqlclosecheck
73
+ - staticcheck
74
+ - stylecheck
75
+ - tagalign
76
+ - tenv
77
+ - testableexamples
78
+ - testifylint
79
+ - thelper
80
+ - tparallel
81
+ - typecheck
82
+ - unconvert
83
+ - unparam
84
+ - unused
85
+ - usestdlibvars
86
+ - wastedassign
87
+ - whitespace
88
+ - zerologlint
89
+ # - cyclop
90
+ # - depguard
91
+ # - exhaustruct
92
+ # - funlen
93
+ # - gci
94
+ # - ginkgolinter
95
+ # - gochecknoglobals
96
+ # - gocognit
97
+ # - godot
98
+ # - goerr113
99
+ # - gomnd
100
+ # - gosec
101
+ # - ireturn
102
+ # - lll
103
+ # - nestif
104
+ # - nlreturn
105
+ # - nonamedreturns
106
+ # - revive
107
+ # - tagliatelle
108
+ # - testpackage
109
+ # - varnamelen
110
+ # - wrapcheck
111
+ # - wsl
112
+ linters-settings :
113
+ gocritic :
114
+ enabled-checks :
115
+ - appendAssign
116
+ - appendCombine
117
+ - argOrder
118
+ - assignOp
119
+ - badCall
120
+ - badCond
121
+ - badLock
122
+ - badRegexp
123
+ - badSorting
124
+ - badSyncOnceFunc
125
+ - boolExprSimplify
126
+ - builtinShadow
127
+ - builtinShadowDecl
128
+ - captLocal
129
+ - caseOrder
130
+ - codegenComment
131
+ - commentFormatting
132
+ - commentedOutCode
133
+ - commentedOutImport
134
+ - defaultCaseOrder
135
+ - deferInLoop
136
+ - deferUnlambda
137
+ - deprecatedComment
138
+ - docStub
139
+ - dupArg
140
+ - dupBranchBody
141
+ - dupCase
142
+ - dupImport
143
+ - dupSubExpr
144
+ - dynamicFmtString
145
+ - elseif
146
+ - emptyDecl
147
+ - emptyFallthrough
148
+ - emptyStringTest
149
+ - equalFold
150
+ - evalOrder
151
+ - exitAfterDefer
152
+ - exposedSyncMutex
153
+ - externalErrorReassign
154
+ - filepathJoin
155
+ - flagDeref
156
+ - flagName
157
+ - hexLiteral
158
+ - httpNoBody
159
+ - hugeParam
160
+ - ifElseChain
161
+ - importShadow
162
+ - indexAlloc
163
+ - initClause
164
+ - mapKey
165
+ - methodExprCall
166
+ - nestingReduce
167
+ - newDeref
168
+ - nilValReturn
169
+ - octalLiteral
170
+ - offBy1
171
+ - paramTypeCombine
172
+ - preferDecodeRune
173
+ - preferFilepathJoin
174
+ - preferFprint
175
+ - preferStringWriter
176
+ - preferWriteByte
177
+ - ptrToRefParam
178
+ - rangeExprCopy
179
+ - rangeValCopy
180
+ - redundantSprint
181
+ - regexpMust
182
+ - regexpPattern
183
+ - regexpSimplify
184
+ - returnAfterHttpError
185
+ - ruleguard
186
+ - singleCaseSwitch
187
+ - sliceClear
188
+ - sloppyLen
189
+ - sloppyReassign
190
+ - sloppyTypeAssert
191
+ - sortSlice
192
+ - sprintfQuotedString
193
+ - sqlQuery
194
+ - stringConcatSimplify
195
+ - stringXbytes
196
+ - stringsCompare
197
+ - switchTrue
198
+ - syncMapLoadAndDelete
199
+ - timeExprSimplify
200
+ - todoCommentWithoutDetail
201
+ - tooManyResultsChecker
202
+ - truncateCmp
203
+ - typeAssertChain
204
+ - typeDefFirst
205
+ - typeSwitchVar
206
+ - typeUnparen
207
+ - uncheckedInlineErr
208
+ - underef
209
+ - unlabelStmt
210
+ - unlambda
211
+ - unnamedResult
212
+ - unnecessaryBlock
213
+ - unnecessaryDefer
214
+ - unslice
215
+ - valSwap
216
+ - weakCond
217
+ - whyNoLint
218
+ - wrapperFunc
219
+ - yodaStyleExpr
Original file line number Diff line number Diff line change 1
- export GO111MODULE =off
2
-
3
1
GO ?= go
4
2
EPOCH_TEST_COMMIT ?= b0fc980
5
3
PROJECT := github.com/cri-o/ocicni
@@ -16,6 +14,10 @@ ETCDIR ?= ${DESTDIR}/etc
16
14
GIT_COMMIT := $(shell git rev-parse --short HEAD)
17
15
BUILD_INFO := $(shell date +% s)
18
16
17
+ BUILD_PATH := $(shell pwd) /build
18
+ GOLANGCI_LINT := ${BUILD_PATH}/golangci-lint
19
+ GOLANGCI_LINT_VERSION := v1.56.2
20
+
19
21
# If GOPATH not specified, use one in the local directory
20
22
ifeq ($(GOPATH ) ,)
21
23
export GOPATH := $(CURDIR ) /_output
@@ -73,10 +75,20 @@ install.tools: .install.gitvalidation
73
75
fi
74
76
75
77
vendor :
76
- export GO111MODULE=on \
77
- $(GO ) mod tidy && \
78
- $(GO ) mod vendor && \
79
- $(GO ) mod verify
78
+ $(GO ) mod tidy && \
79
+ $(GO ) mod vendor && \
80
+ $(GO ) mod verify
81
+
82
+ $(GOLANGCI_LINT ) :
83
+ export VERSION=$(GOLANGCI_LINT_VERSION ) \
84
+ URL=https://raw.githubusercontent.com/golangci/golangci-lint \
85
+ BINDIR=${BUILD_PATH} && \
86
+ curl -sSfL $$ URL/$$ VERSION/install.sh | sh -s $$ VERSION
87
+
88
+ lint : ${GOLANGCI_LINT}
89
+ ${GOLANGCI_LINT} version
90
+ ${GOLANGCI_LINT} linters
91
+ GL_DEBUG=gocritic ${GOLANGCI_LINT} run
80
92
81
93
.PHONY : \
82
94
binaries \
@@ -87,4 +99,5 @@ vendor:
87
99
check \
88
100
install.tools \
89
101
.gitvalidation \
90
- vendor
102
+ vendor \
103
+ lint
You can’t perform that action at this time.
0 commit comments