-
-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy path.golangci.yml
More file actions
153 lines (153 loc) · 4.65 KB
/
.golangci.yml
File metadata and controls
153 lines (153 loc) · 4.65 KB
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
version: "2"
linters:
default: all
disable:
- cyclop
- depguard # not configured, causes false positives
- dupl # duplicate code detection too noisy
- err113
- exhaustruct # was exhaustivestruct in v1, too strict
- funlen # function length too strict
- gochecknoglobals
- gocognit
- gocyclo # cyclomatic complexity too strict
- godoclint # godoc format too strict
- godot # comment punctuation too strict
- goconst # string constant extraction too strict
- ireturn
- lll # line length too strict
- maintidx
- modernize # new in v2
- mnd
- nestif # nested blocks too strict
- nlreturn # too strict
- noinlineerr # new in v2
- perfsprint # new in v2
- prealloc # slice preallocation too strict
- tagalign
- tagliatelle
- testpackage
- varnamelen
- wrapcheck
- wsl # whitespace style
- wsl_v5 # was wsl in v1
settings:
forbidigo:
forbid:
- pattern: ^print(ln)?$
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
# Global exclusions for gosec false positives / intentional patterns
- linters: [gosec]
text: "G107:"
- linters: [gosec]
text: "G114:"
- linters: [gosec]
text: "G115:"
- linters: [gosec]
text: "G122:"
- linters: [gosec]
text: "G204:"
- linters: [gosec]
text: "G306:"
- linters: [gosec]
text: "G404:"
- linters: [gosec]
text: "G704:"
- linters: [gosec]
text: "G117:"
# Global exclusions for staticcheck style suggestions
- linters: [staticcheck]
text: "SA1019:"
- linters: [staticcheck]
text: "SA4006:"
- linters: [staticcheck]
text: "QF1001:"
- linters: [staticcheck]
text: "QF1008:"
# wastedassign is noisy in complex init patterns
- linters: [wastedassign]
text: "assigned to .*, but reassigned without using the value"
# ineffassign after NoErrAlreadyUpToDate pattern
- linters: [ineffassign]
path: local/local.go
- linters: [ineffassign]
path: sourcehut/sourcehut.go
# types.go public API field naming (Url, TenantId, ClientId — schema compatibility)
- linters: [revive]
path: types/types.go
text: "var-naming:"
- linters: [revive]
path: types/types_test.go
text: "var-naming:"
# zip package name conflicts with std lib archive/zip — existing package structure
- linters: [revive]
path: zip/zip.go
text: "var-naming:"
# Per-file existing exclusions
- path: main.go
text: bad syntax for struct tag pair
- path: main.go
text: Function 'main' is too long
- path: metrics/prometheus/prometheus.go
text: counter metrics should have "_total" suffix
- path: local/local.go
text: has complex nested blocks
- path: local/local.go
text: Function 'Locally' has too many statements
- path: gitlab/gitlab.go
text: Function 'Backup' is too long
- path: gitlab/gitlab.go
text: Function 'Get' has too many statements
- path: gitlab/gitlab.go
text: cyclomatic complexity \d+ of func `Get` is high
- path: gitlab/gitlab.go
text: has complex nested blocks
- path: gogs/gogs.go
text: has complex nested blocks
- path: gogs/gogs.go
text: Function 'Backup' is too long
- path: gogs/gogs.go
text: Function 'Get' has too many statements
- path: bitbucket/bitbucket.go
text: Function 'Get' is too long
- path: bitbucket/bitbucket.go
text: right hand must be only type assertion
- path: gitea/gitea.go
text: .code.gitea.io/sdk/gitea.ListOrgReposOptions. composite literal uses unkeyed fields
- path: gitea/gitea.go
text: has complex nested blocks
- path: gitea/gitea.go
text: Function 'Backup' is too long
- path: gitea/gitea.go
text: Function 'Get' has too many statements
- path: gitea/gitea.go
text: cyclomatic complexity \d+ of func `Get` is high
- path: gitea/gitea.go
text: lines are duplicate of `gitea/gitea.go:\d+-\d+`
- path: github/github.go
text: Function 'Get' has too many statements
- path: github/github.go
text: has complex nested blocks
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$