-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yaml
127 lines (117 loc) · 3.76 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
125
126
127
###golangci-lint:version: 1.60
run:
timeout: 30s
allow-parallel-runners: true
issues:
max-issues-per-linter: 0
max-same-issues: 0
linters:
enable-all: true
disable:
- depguard
- gci
- godox
- gofmt
- gomnd # obsolete now, replaced by mnd
- gofumpt
- goheader
- goimports
- varnamelen
- nonamedreturns # there is nothing wrong with named returns
- errname # naming is too strict and is not observed in many places
- importas # may be useful later, requires configuration
- misspell # we have IDE speller
- govet # invoked by the goland internally
- tagliatelle # it isn't very handy to have such linter in a monorepo with a lot of different coding standards
- nlreturn # disabled in favor of wsl
- lll # disabled in favor of revive
- funlen # disabled in favor of revive
- gocognit # disabled in favor of revive
- cyclop # disabled in favor of revive
- gocyclo # disabled in favor of revive
- tagalign # freakingly noisy linter
- whitespace # disabled in a favor of revive
- execinquery # deprecated
- exportloopref # deprecated
- intrange # it is broken
- ireturn
linters-settings:
gomoddirectives:
replace-local: true
mnd:
ignored-functions:
- os\.(OpenFile|WriteFile|Chmod),p?flag\..*
- strconv\.(Format|Parse|Append).*
gosec:
config:
G306: "0666" # enable to create files with permissions 0666 (before umask) or lesser
forbidigo:
forbid:
- (?i)(^|\.)print(f|ln)?$ #forbidden: print, println, fmt.Print, fmt.Println, fmt.Printf
exhaustruct:
exclude:
- net/http\.Transport
- net/http\.Server
- net/http\.Client
- crypto/tls\.Config
wsl:
force-case-trailing-whitespace: 1
allow-trailing-comment: true
allow-separated-leading-comment: true
revive:
enable-all-rules: true
confidence: 0.8
rules:
- name: function-length
severity: warning
disabled: false
arguments: [ 50, 0 ]
- name: function-result-limit
severity: warning
disabled: false
arguments: [ 3 ]
- name: cognitive-complexity
severity: warning
disabled: false
arguments: [ 20 ]
- name: cyclomatic
severity: warning
disabled: false
arguments: [ 10 ]
- name: line-length-limit
severity: warning
disabled: false
arguments: [ 120 ]
- name: argument-limit
severity: warning
disabled: false
arguments: [ 6 ]
- name: unhandled-error
disabled: false
arguments:
- "bytes\\.Buffer\\.Write.*" # always returns nil error
- "strings\\.Builder\\.Write.*" # always returns nil error
# disabled rules
- name: comment-spacings # many false-positives
disabled: true
- name: unchecked-type-assertion # we use forcetypeassert for that
disabled: true
- name: max-public-structs # annoying and mostly useless linter
disabled: true
- name: banned-characters # we don't have banned chars
disabled: true
- name: file-header # we don't have file headers
disabled: true
- name: flag-parameter # extremely annoying linter, it is absolutely okay to have boolean args
disabled: true
- name: struct-tag # false-positive on tags implemented by other linters
disabled: true
- name: add-constant # dont have exclusions list
disabled: true
- name: empty-lines # it false-positives on one-liners
disabled: true
- name: range-val-in-closure # it's not actual with 1.22+ version of Golang
disabled: true
testifylint:
disable:
- require-error # too many FP. Usually we can decide correctly what ensurance level to use