forked from go-vela/vela-kaniko
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
137 lines (121 loc) · 3.57 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
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
# This is a manually created golangci.com yaml configuration with
# some defaults explicitly provided. There is a large number of
# linters we've enabled that are usually disabled by default.
#
# https://golangci-lint.run/usage/configuration/#config-file
# This section provides the configuration for how golangci
# outputs it results from the linters it executes.
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number
# print lines of code with issue, default is true
print-issued-lines: true
# print linter name in the end of issue text, default is true
print-linter-name: true
# make issues output unique by line, default is true
uniq-by-line: true
# This section provides the configuration for each linter
# we've instructed golangci to execute.
linters-settings:
# https://github.com/mibk/dupl
dupl:
threshold: 100
# https://github.com/ultraware/funlen
funlen:
lines: 100
statements: 50
# https://github.com/golang/lint
golint:
min-confidence: 0
# https://github.com/tommy-muehle/go-mnd
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks: argument,case,condition,return
# https://github.com/walle/lll
lll:
line-length: 100
# https://github.com/mdempsky/maligned
maligned:
suggest-new: true
# https://github.com/client9/misspell
misspell:
locale: US
# https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint
nolintlint:
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
# This section provides the configuration for which linters
# golangci will execute. Several of them were disabled by
# default but we've opted to enable them.
linters:
# disable all linters as new linters might be added to golangci
disable-all: true
# enable a specific set of linters to run
enable:
- bodyclose
- deadcode # enabled by default
- dupl
- errcheck # enabled by default
- funlen
- goconst
- gocyclo
- godot
- gofmt
- goimports
- golint
- gomnd
- goprintffuncname
- gosec
- gosimple # enabled by default
- govet # enabled by default
- ineffassign # enabled by default
- lll
- maligned
- misspell
- nakedret
- nolintlint
- staticcheck # enabled by default
- structcheck # enabled by default
- stylecheck
- typecheck # enabled by default
- unconvert
- unparam
- unused # enabled by default
- varcheck # enabled by default
- whitespace
# static list of linters we know golangci can run but we've
# chosen to leave disabled for now
# - asciicheck
# - depguard
# - dogsled
# - exhaustive
# - gochecknoinits
# - gochecknoglobals
# - gocognit
# - gocritic
# - godox
# - goerr113
# - interfacer
# - nestif
# - noctx
# - prealloc
# - rowserrcheck
# - scopelint
# - testpackage
# - wsl
# This section provides the configuration for how golangci
# will report the issues it finds.
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# prevent linters from running on *_test.go files
- path: _test\.go
linters:
- funlen
- goconst
- gocyclo
- gomnd