blob: e5d605ce5e1dc5bf381eb51a3518332f5c97466a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
# 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.
version: "2"
run:
timeout: 8m
# Autogenerated files take too much time and memory to load,
# even if we skip them with issues.exclude-dirs.
# So we define this tag and use it in the autogenerated files.
build-tags:
- codeanalysis
output:
formats:
text:
print-issued-lines: false
formatters:
enable:
- gofmt
disable:
- goimports
linters:
enable:
- lll
- govet
- revive
- unconvert
- goconst
- unused
- misspell
- gocyclo
- govet
- whitespace
- nestif
- goprintffuncname
- godot
- gocognit
- funlen
- dupl
- staticcheck
- syz-linter
- errorlint
- recvcheck
disable:
- bodyclose
- depguard
- dogsled
- gochecknoglobals
- gochecknoinits
- godox
- gomodguard
- gosec
- rowserrcheck
- testpackage
- ineffassign
# errcheck would be good to enable, but we need to fix existing warnings first.
- errcheck
- unparam
- nakedret
- prealloc
- gocritic
- wsl
settings:
revive:
rules:
- name: package-comments
disabled: true
- name: argument-limit
arguments: [ 7 ]
lll:
line-length: 120
gocyclo:
# TODO: consider reducing this value.
min-complexity: 24
dupl:
threshold: 60
goconst:
min-len: 3
min-occurrences: 3
ignore-string-values: ['\.html|^true$']
nestif:
# TODO: consider reducing this value.
min-complexity: 12
staticcheck:
checks:
- all
- -ST1000 # at least one file in a package should have a package comment
- -ST1020 # comment on exported function Foo should be of the form "Foo ..."
- -ST1021 # comment on exported type Foo should be of the form "Foo ..." (with optional leading article)
- -ST1022 # comment on exported const Foo should be of the form "Foo ..."
- -QF1008 # could remove embedded field "..." from selector
godot:
scope: toplevel
exclude: ["keep-sorted"]
gocognit:
# TODO: consider reducing this value.
min-complexity: 70
funlen:
# TODO: consider reducing these value.
lines: 140
statements: 80
custom:
syz-linter:
path: bin/syz-linter.so
errorlint:
comparison: false # we want to use "err == iterator.Done"
exclusions:
warn-unused: true # Log a warning if an exclusion path is unused.
rules:
- path: (sys/.*/init.*|sys/targets/common.go)
text: "don't use ALL_CAPS in Go names|should not use ALL_CAPS in Go names"
- path: (prog/.*)
text: "methods on the same type should have the same receiver name"
- path: (dashboard/app/.*_test\.go)
linters:
- dupl
- path: (prog/.*_test\.go)
linters:
- goconst
- path: (.*_test\.go)
text: "Function '.*' is too long"
- path: tools/syz-trace2syz
linters:
- unused
- syz-linter
- godot
- path: sys/register.go
linters:
- whitespace # TODO: fix the code generation
- path: (.*_test.go)
linters:
- goconst
issues:
max-same-issues: 0
|