Codebase list golang-github-powerman-check / bdb191c
ci: upgrade linter Alex Efros 4 years ago
5 changed file(s) with 75 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
44 docker:
55 - image: circleci/golang:1
66 environment:
7 GOLANGCI_LINT_VER: 1.17.1
7 GOLANGCI_LINT_VER: 1.20.0
88 steps:
99 - checkout
1010 - run:
1414 env | grep _VER | sort > /tmp/tools.ver
1515 - restore_cache:
1616 keys:
17 - v1-{{ checksum "/tmp/tools.ver" }}-{{ checksum "go.mod" }}-{{ .Branch }}
18 - v1-{{ checksum "/tmp/tools.ver" }}-{{ checksum "go.mod" }}-
19 - v1-{{ checksum "/tmp/tools.ver" }}-
20 - v1-
17 - v2-{{ checksum "/tmp/tools.ver" }}-{{ checksum "go.mod" }}-{{ .Branch }}
18 - v2-{{ checksum "/tmp/tools.ver" }}-{{ checksum "go.mod" }}-
19 - v2-{{ checksum "/tmp/tools.ver" }}-
2120 - run:
2221 name: Install tools
2322 command: |
3029 - run: goveralls -service=circle-ci -flags -tags=integration
3130 - save_cache:
3231 when: always
33 key: v1-{{ checksum "/tmp/tools.ver" }}-{{ checksum "go.mod" }}-{{ .Branch }}
32 key: v2-{{ checksum "/tmp/tools.ver" }}-{{ checksum "go.mod" }}-{{ .Branch }}
3433 paths:
3534 - /go/bin/
3635 - /go/pkg/
66 # concurrency: 4
77
88 # timeout for analysis, e.g. 30s, 5m, default is 1m
9 # deadline: 1m
9 # timeout: 1m
1010
1111 # exit code when at least one issue was found, default is 1
1212 # issues-exit-code: 1
3232 # no need to include all autogenerated files, we confidently recognize
3333 # autogenerated files. If it's not please let us know.
3434 # skip-files:
35 # - "\\.html\\.go$"
36 # - "\\.json\\.go$"
37 # - "\\.sql\\.go$"
38 # - "_reform\\.go$"
35 # - "\\.\\w+\\.go$"
3936
4037 # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
4138 # If invoked with -mod=readonly, the go command is disallowed from the implicit
7976 # path to a file containing a list of functions to exclude from checking
8077 # see https://github.com/kisielk/errcheck#excluding-functions for details
8178 # exclude: .errcheck.excludes
79
80 funlen:
81 lines: 60
82 statements: 40
83
8284 govet:
8385 # report about shadowed variables
8486 check-shadowing: true
9092 # - (github.com/powerman/structlog.Logger).Fatalf
9193 # - (github.com/powerman/structlog.Logger).Panicf
9294 # - (github.com/powerman/structlog.Logger).Printf
95
96 # enable or disable analyzers by name
97 # enable:
98 # - atomicalign
99 enable-all: true
100 # disable:
101 # - shadow
102 # disable-all: false
93103 golint:
94104 # minimal confidence for issues, default is 0.8
95105 # min-confidence: 0.8
103113 gocyclo:
104114 # minimal code complexity to report, 30 by default (but we recommend 10-20)
105115 min-complexity: 15
116 gocognit:
117 # minimal code complexity to report, 30 by default (but we recommend 10-20)
118 min-complexity: 20
106119 maligned:
107120 # print struct with more effective memory layout or not, false by default
108121 suggest-new: true
118131 list-type: blacklist
119132 include-go-root: true
120133 packages:
121 # - log
134 - log
135 packages-with-error-messages:
136 # specify an error message to output when a blacklisted package is used
137 log: "logging is allowed only by github.com/powerman/structlog"
122138 misspell:
123139 # Correct spellings using locale preferences for US or UK.
124140 # Default is to use a neutral variety of English.
168184 disabled-checks:
169185 - hugeParam # premature optimization
170186 - paramTypeCombine # questionable
171 - yodaStyleExpr # questionable
172187 - ptrToRefParam
173188 - typeUnparen # false positive
174 - commentedOutCode
175
176 # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
189 - yodaStyleExpr # questionable
190
191 # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.
177192 # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
178193 enabled-tags:
179194 - diagnostic
187202 paramsOnly: true
188203 rangeValCopy:
189204 sizeThreshold: 32
205 godox:
206 # report any comments starting with keywords, this is useful for TODO or FIXME comments that
207 # might be left in the code accidentally and should be resolved before merging
208 keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
209 - BUG # marks issues that should be moved to issue tracker before merging
210 - FIXME # marks issues that should be resolved before merging
211 dogsled:
212 # checks assignments with too many blank identifiers; default is 2
213 max-blank-identifiers: 2
214
215 whitespace:
216 multi-if: false # Enforces newlines (or comments) after every multi-line if statement
217 multi-func: false # Enforces newlines (or comments) after every multi-line function signature
218 wsl:
219 # If true append is only allowed to be cuddled if appending value is
220 # matching variables, fields or types on line above. Default is true.
221 strict-append: true
222 # Allow calls and assignments to be cuddled as long as the lines have any
223 # matching variables, fields or types. Default is true.
224 allow-assign-and-call: true
225 # Allow multiline assignments to be cuddled. Default is true.
226 allow-multiline-assign: true
190227
191228 linters:
192229 # enable:
194231 # - govet
195232 enable-all: true
196233 disable:
234 - dogsled # questionable
197235 - dupl
198236 - gochecknoglobals
199237 - gochecknoinits
200238 - lll
201239 # - misspell
202240 - prealloc
241 - wsl # questionable
203242 # disable-all: false
204243 # presets:
205244 # - bugs
221260 # Exclude some linters from running on tests files.
222261 - path: _test\.go|testing\.go
223262 linters:
263 - bodyclose
264 - dupl
265 - errcheck
266 - funlen
267 - gochecknoglobals
268 - gochecknoinits
224269 - gocyclo
225 - bodyclose
226 - errcheck
227 - dupl
228270 - gosec
229 - gochecknoinits
230 - gochecknoglobals
231271 - maligned
232272 - scopelint
233273
234274 # Ease some gocritic warnings on test files.
235275 - path: _test\.go|testing\.go
236 text: "(unnamedResult|exitAfterDefer|rangeValCopy)"
276 text: "(unnamedResult|exitAfterDefer|rangeValCopy|commentedOutCode)"
237277 linters:
238278 - gocritic
239279
240280 # Package def is designed to contain global constants.
241 # - path: internal/def/
242 # linters:
243 # - gochecknoglobals
281 - path: internal/def/
282 linters:
283 - gochecknoglobals
284
285 # Commands are allowed to contain a lot of flags.
286 - path: main.go
287 text: Function '(init|main)'
288 linters:
289 - funlen
244290
245291 # Exclude known linters from partially hard-vendored code,
246292 # which is impossible to exclude via "nolint" comments.
9595 // ★ If you need custom check, which isn't available out-of-box - see
9696 // Should checker, it'll let you plug in your own checker with ease.
9797 //
98 // ★ It will panic when called with arg of wrong type - because this means
99 // bug in your test.
98 // ★ It will panic when called with arg of wrong type - because this
99 // means bug in your test.
100100 //
101101 // ★ If you don't see colors in `go test` output it may happens because of
102102 // two reasons: either your $TERM doesn't contain substring "color" or
6565 // - []byte: same as string instead of hexdump for valid utf8
6666 // - []rune: use quoted char instead of number for valid runes in list
6767 // - json.RawMessage: indent, then same as string
68 func newDump(i interface{}) (d dump) { // nolint:gocyclo
68 func newDump(i interface{}) (d dump) { // nolint:gocyclo,gocognit,funlen
6969 d.dump = spewCfg.Sdump(i)
7070
7171 if i == nil {
00 module github.com/powerman/check
1
2 go 1.13
13
24 require (
35 github.com/davecgh/go-spew v1.1.1