-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.golangci.yml
127 lines (118 loc) · 3.66 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
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:
goheader:
template: |-
Copyright 2018 SumUp Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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
maligned:
suggest-new: true
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2
gocognit:
min-complexity: 55
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
# NOTE: Not used, but mistakenly approved by tooling such as editors and IDEs.
- github.com/pkg/errors
misspell:
locale: US
lll:
line-length: 140
goimports:
local-prefixes: github.com/sumup-oss/vaulted
gocritic:
enabled-tags:
- performance
cyclop:
# NOTE: Too-low cyclomatic complexity value
# results into worse code design and readability.
max-complexity: 25
linters:
enable-all: true
disable:
# NOTE: "effective" golang style is full of arguable practices.
# We don't need that and besides gofmt does the required minimum of style modifications.
- golint
# NOTE: Too much false positives
- unparam
# NOTE: It's a great linter, but gets in the way too often by not being customizable.
- gochecknoglobals
# NOTE: Full of false positives.
- interfacer
# NOTE: Function length is not an offense.
- funlen
# TODO: Fix false positives
- gomnd
# NOTE: "Packages names should not use underscores" is not a good practice while mixed caps is also disallowed.
- stylecheck
# NOTE: Too verbose
- exhaustivestruct
# NOTE: Worse readability
- nlreturn
# NOTE: False-positives
- nestif
# NOTE: Doesn't play nice with `stacktrace` pkg
- wrapcheck
# NOTE: More opinionated than useful
- revive
# NOTE: Very bad practice in terms of readability and code consistency.
# Questionable benefit of saving 1 line of code.
- ifshort
issues:
exclude-rules:
- text: "weak cryptographic primitive"
linters:
- gosec
- text: "appendAssign: append result not assigned to the same slice"
linters:
- gocritic
- path: pkg/vaulted/content/v1_encrypted_content_service.go
linters:
- dupl
- path: cmd/terraform/vault/rotate.go
linters:
- dupl
- path: cmd/terraform/vault/rekey.go
linters:
- dupl
- path: _test\.go
linters:
- gocyclo
- errcheck
- dupl
- gosec
- path: testing.go
linters:
- wrapcheck