-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.golangci.yml
More file actions
177 lines (163 loc) · 5.13 KB
/
Copy path.golangci.yml
File metadata and controls
177 lines (163 loc) · 5.13 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# options for analysis running
linters-settings:
dogsled:
# checks assignments with too many blank identifiers
max-blank-identifiers: 2
errcheck:
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
check-type-assertions: true
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
check-blank: true
exhaustive:
# Presence of "default" case in switch statements satisfies exhaustiveness,
# even if all enum members are not listed.
default-signifies-exhaustive: true
gci:
# Section configuration to compare against.
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/go-passwd/validator) # Custom section: groups all imports with the specified Prefix.
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
# Skip generated files.
skip-generated: true
# Enable custom order of sections.
custom-order: true
gofmt:
# simplify code: gofmt with `-s` option
simplify: true
goimports:
# put imports beginning with prefix after 3rd-party packages;
local-prefixes: github.com/go-passwd/validator
prealloc:
# Report pre-allocation suggestions only on simple loops that have no returns/breaks/continues/goto's in them.
simple: true
# Report pre-allocation suggestions on range loops
range-loops: true
# Report pre-allocation suggestions on for loops
for-loops: true
revive:
# When set to false, ignores files with "GENERATED" header, similar to golint.
# See https://github.com/mgechev/revive#available-rules for details.
ignore-generated-header: true
severity: warning
stylecheck:
# STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
checks: [ "all", "-ST1005" ]
# https://staticcheck.io/docs/configuration/options/#dot_import_whitelist
dot-import-whitelist: [ ]
# https://staticcheck.io/docs/configuration/options/#initialisms
initialisms: [ ]
# https://staticcheck.io/docs/configuration/options/#http_status_code_whitelist
http-status-code-whitelist: [ "200", "400", "404", "500" ]
testifylint:
# Enable all checkers (https://github.com/Antonboom/testifylint#checkers).
enable-all: true
linters:
disable-all: true
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- decorder
- dogsled
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- exhaustive
- fatcontext
- forbidigo
- forcetypeassert
- gci
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoinits
- gochecksumtype
- goconst
- gocritic
- godot
- gofmt
- gofumpt
- goheader
- goimports
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
- gosmopolitan
- govet
- grouper
- importas
- inamedparam
- ineffassign
- loggercheck
- maintidx
- makezero
- mirror
- musttag
- nakedret
- nolintlint
- nonamedreturns
- nosprintfhostport
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
- stylecheck
- tagalign
- tenv
- testableexamples
- testifylint
- testpackage
- thelper
- tparallel
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
- zerologlint
issues:
# Show only new issues: if there are unstaged changes or untracked files,
# only those changes are analyzed, else only changes in HEAD~ are analyzed.
# It's a super-useful option for integration of golangci-lint into existing large codebase.
# It's not practical to fix all existing issues at the moment of integration:
# much better don't allow issues in new code.
new: false
# output configuration options
output:
# The formats used to render issues.
# Format: `colored-line-number`, `line-number`, `json`, `colored-tab`, `tab`, `checkstyle`, `code-climate`, `junit-xml`, `github-actions`, `teamcity`
# Output path can be either `stdout`, `stderr` or path to the file to write to.
#
# For the CLI flag (`--out-format`), multiple formats can be specified by separating them by comma.
# The output can be specified for each of them by separating format name and path by colon symbol.
# Example: "--out-format=checkstyle:report.xml,json:stdout,colored-line-number"
# The CLI flag (`--out-format`) override the configuration file.
#
# Default:
# formats:
# - format: colored-line-number
# path: stdo
formats: [ { format: colored-line-number } ]
# Print lines of code with issue.
print-issued-lines: false
# Print linter name in the end of issue text.
print-linter-name: true