-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Expand file tree
/
Copy path.golangci.yml
More file actions
102 lines (102 loc) · 2.72 KB
/
.golangci.yml
File metadata and controls
102 lines (102 loc) · 2.72 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
version: "2"
linters:
enable:
- depguard
- errorlint
- godot
- misspell
- modernize
- revive
- sloglint
- testifylint
settings:
depguard:
rules:
main:
deny:
- pkg: github.com/stretchr/testify/assert
desc: "Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert"
- pkg: github.com/go-kit/kit/log
desc: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
- pkg: github.com/pkg/errors
desc: "Use errors or fmt instead of github.com/pkg/errors"
errcheck:
exclude-functions:
# Don't flag lines such as "io.Copy(io.Discard, resp.Body)".
- io.Copy
# The next two are used in HTTP handlers, any error is handled by the server itself.
- io.WriteString
- (net/http.ResponseWriter).Write
# No need to check for errors on server's shutdown.
- (*net/http.Server).Shutdown
# Never check for rollback errors as Rollback() is called when a previous error was detected.
- (github.com/prometheus/prometheus/storage.Appender).Rollback
godot:
scope: toplevel
exclude:
- "^ ?This file is safe to edit"
- "^ ?scheme value"
period: true
capital: true
revive:
rules:
- name: blank-imports
- name: context-as-argument
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: exported
arguments:
- disableStutteringCheck
- name: if-return
- name: increment-decrement
- name: indent-error-flow
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: var-declaration
- name: var-naming
disabled: true
testifylint:
disable:
- float-compare
- go-require
enable-all: true
exclusions:
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
# Skip autogenerated files.
- ^.*\.(pb|y)\.go$
rules:
- linters:
- errcheck
path: _test.go
- linters:
- modernize
text: "omitzero: Omitempty has no effect on nested struct fields"
- linters:
- staticcheck
text: "SA1019:.*types\\.Alert.*"
warn-unused: true
issues:
max-issues-per-linter: 0
max-same-issues: 0
run:
timeout: 5m
formatters:
enable:
- gofumpt
- goimports
settings:
gofumpt:
extra-rules: true
goimports:
local-prefixes:
- github.com/prometheus/alertmanager