-
Notifications
You must be signed in to change notification settings - Fork 719
/
Copy path.golangci.yaml
127 lines (124 loc) · 3 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
version: "2"
linters:
default: all
disable:
- cyclop
- depguard
- dupl
- err113
- exhaustive
- exhaustruct
- fatcontext
- funlen
- gocognit
- goconst
- gocyclo
- godot
- lll
- maintidx
- mnd
- paralleltest
- testpackage
- varnamelen
- wrapcheck
settings:
forbidigo:
forbid:
- pattern: ^(fmt\.Print(|f|ln)|print|println)$
- pattern: ^syscall\.(.{1,7}|.{7}[^N]|.{9,})$
msg: use golang.org/x/sys/windows instead of syscall
- pattern: ^windows\.NewLazyDLL$
msg: use NewLazySystemDLL instead NewLazyDLL
goheader:
values:
const:
COMPANY: The Prometheus Authors
template: |-
SPDX-License-Identifier: Apache-2.0
Copyright {{ YEAR }} {{ COMPANY }}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
gomoddirectives:
toolchain-forbidden: true
gosec:
excludes:
- G101
- G115
sloglint:
no-mixed-args: true
kv-only: false
attr-only: true
no-global: all
context: scope
static-msg: false
no-raw-keys: false
key-naming-case: snake
forbidden-keys:
- time
- level
- msg
- source
args-on-sep-lines: true
staticcheck:
checks:
- -ST1003
- all
tagliatelle:
case:
rules:
json: camel
yaml: snake
use-field-name: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- revive
text: '`?\w+`? should be `?\w+`?'
- linters:
- revive
text: don't use ALL_CAPS in Go names; use CamelCase
- path: .+\.go$
text: don't use underscores in Go names
- path: .+\.go$
text: don't use an underscore in package name
- path: .+\.go$
text: exported type .+ should have comment or be unexported
- linters:
- staticcheck
text: "ST1003:"
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
settings:
gci:
sections:
- prefix(github.com/prometheus-community/windows_exporter/internal/windowsservice)
- standard
- default
custom-order: true
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$