Skip to content

Commit ada573d

Browse files
committed
.golangci.yml: update linter rules
1 parent 9db0d53 commit ada573d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.golangci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,36 @@ 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+
3548
# Init functions are used by loggers throughout the codebase.
3649
- gochecknoinits
3750

@@ -46,6 +59,17 @@ linters:
4659
# instances are created.
4760
- exhaustruct
4861

62+
# Disable gofumpt as it has weird behavior regarding formatting multiple
63+
# lines for a function which is in conflict with our contribution
64+
# guidelines. See https://github.com/mvdan/gofumpt/issues/235.
65+
- gofumpt
66+
67+
# Disable whitespace linter as it has conflict rules against our
68+
# contribution guidelines. See https://github.com/bombsimon/wsl/issues/109.
69+
#
70+
# TODO: bring it back when the above issue is fixed.
71+
- wsl
72+
4973
# Deprecated linters. See https://golangci-lint.run/usage/linters/.
5074
- interfacer
5175
- golint

0 commit comments

Comments
 (0)