Skip to content

Commit 013e964

Browse files
committed
.golangci.yml: update linter rules
1 parent a6dd981 commit 013e964

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.golangci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,42 @@ linters-settings:
1515
govet:
1616
# Don't report about shadowed variables
1717
check-shadowing: false
18+
1819
gofmt:
1920
# simplify code: gofmt with `-s` option, true by default
2021
simplify: true
22+
2123
funlen:
2224
# Checks the number of lines in a function.
2325
# If lower than 0, disable the check.
2426
lines: 200
2527
# Checks the number of statements in a function.
2628
statements: 80
29+
2730
gosec:
2831
excludes:
2932
- G402 # Look for bad TLS connection settings.
3033
- G306 # Poor file permissions used when writing to a new file.
3134

35+
whitespace:
36+
multi-func: true
37+
multi-if: true
38+
3239
linters:
3340
enable-all: true
3441
disable:
42+
# Allow dynamic errors.
43+
- goerr113
44+
45+
# We want to allow short variable names.
46+
- varnamelen
47+
48+
# Allow tests to be put in the same package.
49+
- testpackage
50+
51+
# We want to allow TODOs.
52+
- godox
53+
3554
# Init functions are used by loggers throughout the codebase.
3655
- gochecknoinits
3756

@@ -46,6 +65,17 @@ linters:
4665
# instances are created.
4766
- exhaustruct
4867

68+
# Disable gofumpt as it has weird behavior regarding formatting multiple
69+
# lines for a function which is in conflict with our contribution
70+
# guidelines. See https://github.com/mvdan/gofumpt/issues/235.
71+
- gofumpt
72+
73+
# Disable whitespace linter as it has conflict rules against our
74+
# contribution guidelines. See https://github.com/bombsimon/wsl/issues/109.
75+
#
76+
# TODO: bring it back when the above issue is fixed.
77+
- wsl
78+
4979
# Deprecated linters. See https://golangci-lint.run/usage/linters/.
5080
- interfacer
5181
- golint

0 commit comments

Comments
 (0)