syzkaller/.golangci.yml
Dmitry Vyukov 01d1494471 .golangci.yml: add codeanalysis build tag
Using a build tag to exclude files for golangci-lint
reduces memory consumption (it does not parse them).
The naive attempt with skip-dirs did not work.
So add codeanalysis build tag and use it in auto-generated files.

Update #977
2019-05-15 11:39:31 +02:00

67 lines
1.3 KiB
YAML

# 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
# 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
linters:
enable:
- lll
- vet
- gofmt
- golint
- structcheck
- unconvert
- deadcode
- goconst
- unused
- gosimple
- varcheck
- misspell
- gocyclo
- vetshadow
- megacheck
- stylecheck
- govet
disable:
- typecheck
- ineffassign
- errcheck
- interfacer
- unparam
- nakedret
- prealloc
- scopelint
- gocritic
linters-settings:
lll:
line-length: 120
gocyclo:
min-complexity: 24
dupl:
threshold: 60
goconst:
min-len: 7
min-occurrences: 4
issues:
exclude-use-default: false
exclude:
- "exported .* should have comment"
- "comment on .* should be of the form"
- "declaration of \"err\" shadows"
exclude-rules:
- path: (pkg/csource/generated.go|pkg/report/linux.go|pkg/build/linux_generated.go)
linters:
- lll
- path: (sys/.*/init.*|sys/targets/common.go)
text: "don't use ALL_CAPS in Go names"