-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
79 lines (68 loc) · 2.51 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
linters:
enable:
- dogsled
- exportloopref
- gocognit
- goconst
- gocritic
- gocyclo
- gofmt
- gosec
- govet
- nakedret
- prealloc
- unconvert
- unparam
- whitespace
- revive
linters-settings:
gocognit:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 20
gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 20
gofmt:
simplify: false
# a good description of maligned structs
# https://medium.com/@sebassegros/golang-dealing-with-maligned-structs-9b77bacf4b97
# govet:
# enable:
# - fieldalignment
nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
max-func-lines: 30
unparam:
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false
whitespace:
# Enforces newlines (or comments) after every multi-line if statement
multi-if: false
# Enforces newlines (or comments) after every multi-line function signature
multi-func: false
issues:
# Not using default exclusions because we want to require comments on public
# functions and types.
exclude-use-default: false
exclude:
- should have a package comment
- package comment should be of the form
# options for analysis running
run:
# include test files or not, default is true
tests: false
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
# to go.mod are needed. This setting is most useful to check that go.mod does
# not need updates, such as in a continuous integration and testing system.
# If invoked with -mod=vendor, the go command assumes that the vendor
# directory holds the correct copies of dependencies and ignores
# the dependency descriptions in go.mod.
modules-download-mode: vendor
service:
# use the fixed version to not introduce new linters unexpectedly
golangci-lint-version: 1.52.x