-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
104 lines (103 loc) · 2.39 KB
/
.golangci.yml
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
run: # https://golangci-lint.run/usage/configuration/#run-configuration
go: '1.23'
timeout: 3m
linters-settings: # https://golangci-lint.run/usage/configuration/#linters-settings-configuration
dupl:
# Tokens count to trigger issue.
threshold: 150
funlen:
lines: 200
statements: 200
stylecheck: # https://golangci-lint.run/usage/linters/#stylecheck
checks: [ "-ST1000" ]
gocyclo:
min-complexity: 36
gosec:
excludes:
- G115 # Potential integer overflow when converting between integer types
gofmt:
# Simplify code: gofmt with `-s` option.
# Default: true
simplify: true
# Apply the rewrite rules to the source before reformatting.
# https://pkg.go.dev/cmd/gofmt
# Default: []
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'
- pattern: 'a[b:len(a)]'
replacement: 'a[b:]'
revive:
enable-all-rules: false
rules:
- name: empty-lines
- name: use-any
- name: struct-tag
- name: context-as-argument
- name: context-keys-type
- name: error-return
- name: error-naming
- name: exported
disabled: true
- name: if-return
- name: increment-decrement
- name: var-declaration
- name: package-comments
disabled: true
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
- name: superfluous-else
- name: unused-parameter
disabled: true
- name: unreachable-code
- name: redefines-builtin-id
linters: # https://golangci-lint.run/usage/linters/
disable-all: true
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- contextcheck
- copyloopvar
- dogsled
# - dupl
- errcheck
- fatcontext
- funlen
- gci
- gocyclo
- gocritic
- gofmt
- goheader
- goimports
- gosec
- gosimple
- govet
- ineffassign
# - lll
- prealloc
- misspell
- mirror
- staticcheck
- stylecheck
- typecheck
- unconvert
- unused
- whitespace
- revive
- protogetter
- tagalign
issues: # https://golangci-lint.run/usage/configuration/#issues-configuration
exclude-rules:
- path: _test\.go
linters:
- dupl
- funlen
- gosec
- gocritic
- errcheck