-
Notifications
You must be signed in to change notification settings - Fork 7
/
.golangci.yml
103 lines (99 loc) · 3.15 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
run:
tests: false
# NOTE: Verify `go.{mod,sum}` is up-to-date by attempting to download dependencies
# if anything is missing
modules-download-mode: readonly
output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
linters-settings:
errcheck:
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: false
# print linter name in the end of issue text, default is true
govet:
check-shadowing: true
gocyclo:
# NOTE: Too-low cyclomatic complexity value
# results into worse code design and readability.
min-complexity: 25
maligned:
suggest-new: true
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2
depguard:
list-type: blacklist
packages:
# logging is allowed only by logutils.Log, logrus
# is allowed to use only in logutils package
- github.com/sirupsen/logrus
# NOTE: Be very, very wary not to use GPL3 software as library
- github.com/golangci/golangci-lint
misspell:
locale: US
lll:
line-length: 140
goimports:
local-prefixes: github.com/sumup-oss/go-pkgs
gocritic:
enabled-tags:
- performance
linters:
enable-all: true
disable:
# 'scopelint' is deprecated (since v1.39.0) due to:
# The repository of the linter has been deprecated by the owner. Replaced by exportloopref.
- scopelint
# 'maligned' is deprecated (since v1.38.0) due to:
# The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'.
- maligned
# 'interfacer' is deprecated (since v1.38.0) due to:
# The repository of the linter has been archived by the owner.
- interfacer
# "effective" golang style is full of arguable practices.
# We don't need that and besides gofmt does the required minimum of style modifications.
- golint
# Too much false positives
- unparam
# It's a great linter, but gets in the way too often by not being customizable.
- gochecknoglobals
# It considers too much things as magic numbers.
- gomnd
# False positives.
- wsl
# Pointless.
- funlen
# `TODO` comments are not offences.
- godox
# It is sometimes beneficial to create structs with default zero values,
# without writing all those zero values.
- exhaustivestruct
# Short ifs are ugly.
- ifshort
# Things like cyclomatic complexity will be left to the developer's critical thinking.
- cyclop
- nestif
# Linting of tag names can be good for new code and API, but if there is an existing
# API well, you have to use the naming from the API.
- tagliatelle
# We just don't like revive.
- revive
# It's good, but the code is not yet migrated.
- goerr113
# We use stacktrace, which is incompatible with standard errors wrapping.
- wrapcheck
# We use stacktrace, which is incompatible with standard errors wrapping.
- errorlint
# We use goimports
- gci
- gofumpt
issues:
exclude-rules:
- text: "weak cryptographic primitive"
linters:
- gosec