forked from hyperledger-labs/go-perun
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.golangci.yml
81 lines (73 loc) · 2.47 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
run:
timeout: 2m
# Skip the eth bindings.
skip-dirs:
- backend/ethereum/bindings/
# Do not change go.{mod,sum}.
modules-download-mode: readonly
linters:
enable-all: true
disable:
# Disabled as a style choice:
- wrapcheck # We do not rewrap all errors from other packages.
- varnamelen # We often use single letter arguments.
- exhaustivestruct # We often have uninitialized fields of structs.
- errorlint # We have interface errors which an impl needs to return.
- lll # We use long lines.
- gochecknoglobals # We have a lot of globals.
- nlreturn # "new line before return"; not useful.
- paralleltest # We like parallel tests.
- ireturn # We often return interfaces.
- wsl # Formatting disabled for now.
- gochecknoinits # We use init functions.
- gci # We have our own import order.
- goerr113 # We do not strictly require static errors.
- promlinter # Disabled because unstable.
# These could be enabled in the future:
- ifshort # we often don't use `if err := …` for readability.
- tparallel # We don't always use parallel tests.
# Deprecated:
- maligned
- scopelint
- golint
- interfacer
linters-settings:
cyclop:
# 15 is used by go-report-card as well.
max-complexity: 15
goheader:
values:
regexp:
ANY_YEAR: "20(19|2\\d)" # 2019-2029
template-path: ".scripts/copyright-notice"
forbidigo:
forbid:
# Forbid functions to start with "get" or "Get".
- ^[Gg]et.*$
- ^[Ee]quals$
# Default values:
- ^print.*$
- 'fmt\.Print.*'
exclude-rules:
- path: ".*\\.pb\\.go$" # Exclude protobuf generated files.
issues:
# Re-enable default excludes.
include:
- EXC0012 # revive: exported (.+) should have comment or be unexported
- EXC0013 # revive: package comment should be of the form "(.+)..."
- EXC0014 # revive: comment on exported (.+) should be of the form "(.+)..."
- EXC0015 # revive: package should have comment
exclude-rules:
- path: test
linters:
# We often have long test or test helper functions.
- funlen
# Can use panicing interface casts.
- forcetypeassert
# Can create dynamic errors with errors.New.
- goerr113
# We always use testing.T as first argument in testing functions,
# therefore disable the "context must be the first argument" check in tests.
- path: test
linters: [revive]
text: "context-as-argument"