forked from hyperledger-labs/perun-node
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.golangci.yml
143 lines (120 loc) · 3.21 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# This file contains all available configuration options
# with their default values.
# options for analysis running
run:
timeout: 5m
issues-exit-code: 1
build-tags:
# include integration text files
- integration
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: 'colored-line-number'
linters:
disable-all: true
enable:
# detect possible issues in code or coding style
- errcheck
- gofmt
- gofumpt
- goimports
- revive
- gosec
- gosimple
- govet
- ineffassign
- megacheck
- nolintlint
- testpackage
- staticcheck
- stylecheck
# restrict dependencies
- depguard
# detect unused, duplicate code
- dupl
- goconst
- unconvert
- unparam
- unused
# check code complexity
- funlen
- gocognit
- gocyclo
- lll
# detect grammatical aspects
- godot
- misspell
# detect possible optimizations
fast: false
# all available settings of specific linters
linters-settings:
errcheck:
# report about assignment of errors to blank identifiers, default is false.
check-blank: true
depguard:
rules:
main:
deny:
- pkg: "github.com/ethereum/go-ethereum"
desc: It contains code licensed under LGPL, import is allowed only inside perun-node/blockchain/ethereum
- pkg: "perun.network/go-perun/backend/ethereum"
desc: It uses code licensed under LGPL, import is allowed only inside perun-node/blockchain/ethereum"
dupl:
# tokens count to trigger issue, 150 by default
threshold: 100
funlen:
lines: 60
statements: 40
goconst:
# minimal length of string constant, 3 by default
min-len: 3
# minimal occurrences count to trigger, 3 by default
min-occurrences: 5
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
goimports:
local-prefixes: github.com/hyperledger-labs/perun-node
govet:
check-shadowing: true
lll:
line-length: 120
tab-width: 1
misspell:
locale: US
testpackage:
skip-regexp: internal_test\.go
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# Exclude some linters from running on tests files and test helper packages.
- path: _test\.go
linters:
- funlen
- gosec
- depguard
- path: test/
linters:
- funlen
- gosec
- path: blockchain/ethereum/
linters:
- depguard
# Grpc adapter does have some repetitive boilerplate code.
- path: api/grpc/
linters:
- dupl
# It is okay to return an unexported type when the type satisfies a public interface.
- linters:
- golint
text: "returns unexported type"
- linters:
- lll
source: "^//go:generate "
# Default value for this option is true.
# Set it to false, because it discards errors from golint.
# Especially missing comments for exported types & variables.
exclude-use-default: false