-
Notifications
You must be signed in to change notification settings - Fork 361
/
.golangci.yaml
124 lines (122 loc) · 3.54 KB
/
.golangci.yaml
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
output:
sort-results: true
linters:
enable:
- gofmt
- goimports
# prettier-ignore
disable:
- tagliatelle # we're parsing data from external sources (g-rath)
- varnamelen # maybe later (g-rath)
- exhaustruct # overkill (g-rath)
- forcetypeassert # too hard (g-rath)
- lll # line length is hard (g-rath)
- godox # to-do comments are fine (g-rath)
- godot # comments are fine without full stops (g-rath)
- gomnd # not every number is magic (g-rath)
- mnd # not every number is magic (g-rath)
- wsl # disagree with, for now (g-rath)
- ireturn # disagree with, sort of (g-rath)
- gochecknoglobals # disagree with, for non changing variables (another-rex)
- wrapcheck # too difficult, will re-add later (another-rex)
- testpackage # will re-add later (another-rex)
- err113 # will re-add later (another-rex)
- nonamedreturns # disagree with, for now (another-rex)
- goconst # not everything should be a constant
presets:
- bugs
- comment
- error
- performance
- sql
- style
- test
- unused
linters-settings:
govet:
settings:
printf:
funcs:
- (github.com/google/osv-scanner/pkg/reporter.Reporter).Errorf
- (github.com/google/osv-scanner/pkg/reporter.Reporter).Warnf
- (github.com/google/osv-scanner/pkg/reporter.Reporter).Verbosef
- (github.com/google/osv-scanner/pkg/reporter.Reporter).Infof
depguard:
rules:
regexp:
files:
- "!**/internal/cachedregexp/**"
- "!**/main_test.go"
deny:
- pkg: "regexp"
desc: "Use github.com/google/osv-scanner/internal/cachedregexp instead"
gocritic:
disabled-checks:
- ifElseChain
revive:
# enable-all-rules: true
rules:
# Overrides ----
# This is just here for documentation purposes, as all rules are disabled by default
- name: increment-decrement
disabled: true
# Defaults ----
- name: blank-imports
disabled: false
- name: context-as-argument
disabled: false
- name: context-keys-type
disabled: false
- name: dot-imports
disabled: false
- name: empty-block
disabled: false
- name: error-naming
disabled: false
- name: error-return
disabled: false
- name: error-strings
disabled: false
- name: errorf
disabled: false
- name: exported
disabled: false
- name: indent-error-flow
disabled: false
- name: package-comments
disabled: false
- name: range
disabled: false
- name: receiver-naming
disabled: false
- name: redefines-builtin-id
disabled: false
- name: superfluous-else
disabled: false
- name: time-naming
disabled: false
- name: unexported-return
disabled: false
- name: unreachable-code
disabled: false
- name: unused-parameter
disabled: false
- name: var-declaration
disabled: false
- name: var-naming
disabled: false
nlreturn:
# Size of the block (including return statement that is still "OK")
# so no return split required.
# Default: 1
block-size: 2
issues:
exclude-rules:
- path: pkg/reporter
linters:
- dupl
- path: _test\.go
linters:
- dupl
exclude-dirs:
- internal/thirdparty/xml