-
Notifications
You must be signed in to change notification settings - Fork 25
/
.golangci.yaml
122 lines (110 loc) · 3.13 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
---
# Options for analysis running.
run:
timeout: 5m
tests: true
linters:
enable:
- bodyclose
- errorlint
# - gci # fixme: disable for now, see https://github.com/daixiang0/gci/issues/209
- loggercheck
- gosec
- revive
- thelper
- nolintlint
- dupword
- usestdlibvars
- mirror
- testifylint
- contextcheck
- gofumpt
linters-settings:
loggercheck:
require-string-key: true
# Require printf-like format specifier (%s, %d for example) not present.
# Default: false
no-printf-like: true
nolintlint:
# Disable to ensure that all nolint directives actually have an effect.
# Default: false
allow-unused: true
# Enable to require an explanation of nonzero length
# after each nolint directive.
# Default: false
require-explanation: true
# Enable to require nolint directives to mention the specific
# linter being suppressed.
# Default: false
require-specific: true
gci:
sections:
- standard
- prefix(syscall/js,unique,iter) # fixme: workaround, wait for https://github.com/daixiang0/gci/pull/208 merged
- default
- localmodule
custom-order: true
staticcheck:
# SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
checks: [ "all" ]
revive:
enable-all-rules: true
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported
- name: exported
arguments:
# enables checking public methods of private types
- "checkPrivateReceivers"
# make error messages clearer
- "sayRepetitiveInsteadOfStutters"
- name: unhandled-error
arguments: # here are the exceptions we don't want to be reported
- "fmt.Print.*"
- "fmt.Fprint.*"
- "bytes.Buffer.Write"
- "bytes.Buffer.WriteByte"
- "bytes.Buffer.WriteString"
- "strings.Builder.WriteString"
- "strings.Builder.WriteRune"
- name: cognitive-complexity
severity: warning
arguments: [ 300 ]
- name: cyclomatic
arguments: [ 100 ]
- name: struct-tag
disabled: true
- name: add-constant
disabled: true
- name: flag-parameter
disabled: true
- name: imports-blocklist
disabled: true
- name: nested-structs
disabled: true
- name: modifies-value-receiver
disabled: true
- name: line-length-limit
disabled: true
- name: argument-limit
disabled: true
- name: banned-characters
disabled: true
- name: max-public-structs
disabled: true
- name: function-result-limit
disabled: true
- name: function-length
disabled: true
- name: file-header
disabled: true
- name: empty-lines
disabled: true
gosec:
excludes:
- G115
output:
# Make issues output unique by line.
# Default: true
# Note: unique in this case means that you can have at most 1 issue per line of code.
# one issue with a given line and we want to see them all at once.
uniq-by-line: false