-
Notifications
You must be signed in to change notification settings - Fork 702
/
.golangci.yaml
89 lines (85 loc) · 2.11 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
linters:
enable-all: true
disable:
- cyclop
- depguard
- dupl
- err113
- execinquery
- exhaustive
- exhaustruct
- exportloopref
- fatcontext
- funlen
- gocognit
- goconst
- gocyclo
- godot
- gomnd
- paralleltest
- lll
- maintidx
- mnd
- testpackage
- varnamelen
- wrapcheck
run:
timeout: 15m
output:
sort-results: true
linters-settings:
gosec:
excludes:
- G101 # Potential hardcoded credentials
- G115 # integer overflow conversion
gci:
sections:
- prefix(github.com/prometheus-community/windows_exporter/internal/windowsservice)
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
custom-order: true
tagliatelle:
case:
use-field-name: true
rules:
# Any struct tag type can be used.
# Support string case: `camel`, `pascal`, `kebab`, `snake`, `upperSnake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`, `header`
json: camel
yaml: snake
forbidigo:
forbid:
- "^(fmt\\.Print(|f|ln)|print|println)$"
- p: "^syscall\\.(.{1,7}|.{7}[^N]|.{9,})$"
msg: use golang.org/x/sys/windows instead of syscall
- p: "^windows\\.NewLazyDLL$"
msg: use NewLazySystemDLL instead NewLazyDLL
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
stylecheck:
checks: ["all", "-ST1003"]
issues:
exclude:
- don't use underscores in Go names
- don't use an underscore in package name
- exported type .+ should have comment or be unexported
exclude-rules:
- # Golint has many capitalisation complaints on WMI class names
text: "`?\\w+`? should be `?\\w+`?"
linters:
- revive
- text: "don't use ALL_CAPS in Go names; use CamelCase"
linters:
- revive