2019-03-28 14:31:54 +00:00
|
|
|
# Copyright 2019 syzkaller project authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
run:
|
|
|
|
deadline: 8m
|
|
|
|
skip-dirs:
|
|
|
|
- pkg/kd
|
2019-10-08 10:26:27 +00:00
|
|
|
- tools/syz-trace2syz
|
2019-05-15 08:04:22 +00:00
|
|
|
# Autogenerated files take too much time and memory to load,
|
|
|
|
# even if we skip them with skip-dirs.
|
|
|
|
# So we define this tag and use it in the autogenerated files.
|
|
|
|
build-tags:
|
|
|
|
- codeanalysis
|
2019-03-28 14:31:54 +00:00
|
|
|
|
2020-03-13 07:26:02 +00:00
|
|
|
output:
|
|
|
|
print-linter-name: false
|
|
|
|
|
2019-03-28 14:31:54 +00:00
|
|
|
linters:
|
|
|
|
enable:
|
|
|
|
- lll
|
2019-04-23 13:58:23 +00:00
|
|
|
- vet
|
2019-03-28 14:31:54 +00:00
|
|
|
- gofmt
|
|
|
|
- golint
|
|
|
|
- structcheck
|
|
|
|
- unconvert
|
|
|
|
- deadcode
|
|
|
|
- goconst
|
|
|
|
- unused
|
|
|
|
- gosimple
|
|
|
|
- varcheck
|
|
|
|
- misspell
|
|
|
|
- gocyclo
|
|
|
|
- vetshadow
|
|
|
|
- megacheck
|
2019-04-23 13:58:23 +00:00
|
|
|
- stylecheck
|
2019-03-28 14:31:54 +00:00
|
|
|
- govet
|
2020-06-04 19:39:24 +00:00
|
|
|
- whitespace
|
2020-06-04 19:47:34 +00:00
|
|
|
- nestif
|
2020-06-04 20:13:13 +00:00
|
|
|
- goprintffuncname
|
2020-06-04 20:20:22 +00:00
|
|
|
- godot
|
2020-06-04 20:35:04 +00:00
|
|
|
- gocognit
|
2020-06-04 21:07:55 +00:00
|
|
|
- funlen
|
2020-06-04 21:29:54 +00:00
|
|
|
- dupl
|
2019-03-28 14:31:54 +00:00
|
|
|
disable:
|
2020-06-04 20:08:21 +00:00
|
|
|
- bodyclose
|
|
|
|
- depguard
|
|
|
|
- dogsled
|
|
|
|
- gochecknoglobals
|
|
|
|
- gochecknoinits
|
|
|
|
- godox
|
|
|
|
- goimports
|
|
|
|
- gomnd
|
|
|
|
- gomodguard
|
|
|
|
- gosec
|
|
|
|
- maligned
|
|
|
|
- rowserrcheck
|
|
|
|
- testpackage
|
2019-04-23 13:58:23 +00:00
|
|
|
- typecheck
|
2019-03-28 14:31:54 +00:00
|
|
|
- ineffassign
|
2020-06-04 20:08:21 +00:00
|
|
|
# errcheck would be good to enable, but we need to fix existing warnings first.
|
2019-03-28 14:31:54 +00:00
|
|
|
- errcheck
|
2019-04-23 13:58:23 +00:00
|
|
|
- interfacer
|
|
|
|
- unparam
|
|
|
|
- nakedret
|
|
|
|
- prealloc
|
|
|
|
- scopelint
|
|
|
|
- gocritic
|
2020-06-04 20:08:21 +00:00
|
|
|
- wsl
|
2019-03-28 14:31:54 +00:00
|
|
|
|
|
|
|
linters-settings:
|
|
|
|
lll:
|
|
|
|
line-length: 120
|
|
|
|
gocyclo:
|
2020-06-04 20:35:04 +00:00
|
|
|
# TODO: consider reducing this value.
|
2019-03-28 14:31:54 +00:00
|
|
|
min-complexity: 24
|
|
|
|
dupl:
|
|
|
|
threshold: 60
|
2019-04-23 13:58:23 +00:00
|
|
|
goconst:
|
2020-06-06 09:34:20 +00:00
|
|
|
min-len: 3
|
|
|
|
min-occurrences: 3
|
2020-06-04 19:47:34 +00:00
|
|
|
nestif:
|
2020-06-04 20:35:04 +00:00
|
|
|
# TODO: consider reducing this value.
|
2020-06-04 19:47:34 +00:00
|
|
|
min-complexity: 12
|
2020-06-04 20:20:22 +00:00
|
|
|
godot:
|
|
|
|
check-all: true
|
2020-06-04 20:35:04 +00:00
|
|
|
gocognit:
|
|
|
|
# TODO: consider reducing this value.
|
|
|
|
min-complexity: 70
|
2020-06-04 21:07:55 +00:00
|
|
|
funlen:
|
|
|
|
# TODO: consider reducing these value.
|
2020-06-06 12:21:54 +00:00
|
|
|
lines: 140
|
2020-06-04 21:07:55 +00:00
|
|
|
statements: 80
|
2019-03-28 14:31:54 +00:00
|
|
|
|
|
|
|
issues:
|
|
|
|
exclude-use-default: false
|
2020-03-13 07:26:02 +00:00
|
|
|
max-same-issues: 0
|
2019-03-28 14:31:54 +00:00
|
|
|
exclude:
|
|
|
|
- "exported .* should have comment"
|
|
|
|
- "comment on .* should be of the form"
|
2019-09-17 10:24:38 +00:00
|
|
|
- "at least one file in a package should have a package comment"
|
2019-03-28 14:31:54 +00:00
|
|
|
exclude-rules:
|
2020-06-06 05:48:14 +00:00
|
|
|
- path: (pkg/csource/generated.go|pkg/build/linux_generated.go)
|
2019-03-28 14:31:54 +00:00
|
|
|
linters:
|
|
|
|
- lll
|
2019-04-23 13:58:23 +00:00
|
|
|
- path: (sys/.*/init.*|sys/targets/common.go)
|
2020-06-06 05:40:04 +00:00
|
|
|
text: "don't use ALL_CAPS in Go names|should not use ALL_CAPS in Go names"
|
2020-06-06 05:55:42 +00:00
|
|
|
- path: (prog/.*)
|
2020-06-06 05:40:04 +00:00
|
|
|
text: "methods on the same type should have the same receiver name"
|
2020-06-04 21:29:54 +00:00
|
|
|
- path: (dashboard/app/.*_test\.go)
|
|
|
|
linters:
|
|
|
|
- dupl
|
2020-06-06 09:34:20 +00:00
|
|
|
- path: (prog/.*_test\.go)
|
|
|
|
linters:
|
|
|
|
- goconst
|
2020-06-06 12:21:54 +00:00
|
|
|
- path: (.*_test\.go)
|
|
|
|
text: "Function '.*' is too long"
|