-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.golangci.yml
109 lines (106 loc) · 2.26 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
105
106
107
108
109
run:
tests: true
linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- copyloopvar
- dogsled
- dupl
- durationcheck
- errcheck
- errname
- forbidigo
- gci
- gocritic
- gofmt
- gofumpt
- goimports
- gomoddirectives
- gosec
- gosimple
- govet
- grouper
- importas
- ineffassign
- misspell
- nakedret
- nilerr
- nilnil
- noctx
- nosprintfhostport
- prealloc
- predeclared
- staticcheck
- stylecheck
- tenv
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- whitespace
disable:
- godox # Unfortunately we have some of these
- nonamedreturns # Used in some providers, we should restructure the code to not need it
- revive # Need to have a good look at its configuration
- wastedassign # Does not yet support generics
issues:
max-same-issues: 0
max-issues-per-linter: 0
exclude-files:
- ".*\\.pb\\.go$"
- "scripting/parser/herd_.*\\.go$"
exclude-rules:
# This needs to be disabled until we update the protobuf dependency
- path: provider/plugin/common/grpc.go
linters:
- staticcheck
# We ignore all i/o errors, needs a dedicated fix
- path: ui.go
linters:
- errcheck
# This file is deliberately not in alphabetical order. Will be fixed when
# ssh key discovery and host key discovery are separated
- path: cmd/herd/.*_providers.go
linters:
- gci
linters-settings:
forbidigo:
forbid:
- ^fmt\.Print.*
- ^spew\.Dump
gci:
sections:
- standard
- prefix(github.com/seveas/herd)
- default
custom-order: true
gocritic:
enabled-tags:
- diagnostic
- performance
# TODO try the other tags
disabled-checks:
- ifElseChain
- hugeParam
- equalFold
- rangeValCopy
gofumpt:
extra-rules: true
grouper:
import-require-single-import: true
prealloc:
simple: false
for-loops: true
predeclared:
q: true
stylecheck:
checks:
- all
- -ST1003 # FIXME: We have many miscapitalized names
- -ST1005 # Our error messages go straight to the user and are full sentences