forked from ObolNetwork/charon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
124 lines (121 loc) · 3.1 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
run:
timeout: 5m
go: "1.19.3"
linters-settings:
cyclop:
max-complexity: 15
skip-tests: true
dupl:
# tokens count to trigger issue, 150 by default
threshold: 400
exhaustive:
default-signifies-exhaustive: true
forbidigo:
forbid:
- 'fmt\.Print.*(# Avoid debug logging)?'
gci:
local-prefixes: github.com/obolnetwork/charon
gocritic:
disabled-checks:
- ifElseChain
govet:
enable-all: true
disable:
- fieldalignment
- shadow
nlreturn:
block-size: 2
revive:
enable-all-rules: true
severity: warning
rules:
# Disabled revive rules
- name: banned-characters
disabled: true
- name: add-constant
disabled: true
- name: file-header
disabled: true
- name: function-result-limit
disabled: true
- name: cyclomatic
disabled: true
- name: line-length-limit
disabled: true
- name: max-public-structs
disabled: true
- name: argument-limit
disabled: true
- name: function-length
disabled: true
- name: cognitive-complexity
disabled: true
# Some configured revive rules
- name: imports-blacklist
arguments:
- "errors" # Prefer ./app/errors
- "github.com/pkg/errors" # Prefer ./app/errors
- "github.com/golang/protobuf" # Prefer google.golang.org/protobuf
- "github.com/prometheus/client_golang/prometheus/promauto" # Prefer ./app/promauto
staticcheck:
go: "1.19.3"
checks:
- "all"
- "-SA1019" # Ignoring since github.com/drand/kyber/sign/bls uses Proof Of Possession as does Ethereum.
testpackage:
skip-regexp: internal_test\.go
wrapcheck:
ignoreSigs:
- github.com/obolnetwork/charon/
- github.com/attestantio/go-eth2-client
issues:
fix: true
exclude-rules:
- path: '(.+)_test\.go'
linters:
- bodyclose
- gosec
- noctx
- revive
exclude:
- "error returned from interface method should be wrapped" # Relax wrapcheck
- "defer: prefer not to defer chains of function calls" # Relax revive
- "avoid control coupling" # Relax revive
- "shadows an import name" # Relax revive
- "confusing-naming" # Relax revive
- "nested-structs" # Relax revive
- "0xhex" # Relax revive and staticcheck about our custom struct tag
- "shadow: declaration of \"err\" shadows declaration" # Relax govet
- "bls_sig contains underscore" # Relax nosnakecase
- "v\\d_\\d contains underscore" # Relax nosnakecase
- "P_\\w+ contains underscore" # Relax nosnakecase
linters:
enable-all: true
disable:
# Keep disabled
- containedctx
- cyclop
- exhaustivestruct
- exhaustruct
- funlen
- forcetypeassert
- gci
- gochecknoglobals
- gocyclo
- godox
- goerr113
- golint
- gomnd
- gomoddirectives
- ifshort
- interfacer
- ireturn
- lll # Think about adding this (max line length)
- maligned
- nonamedreturns
- paralleltest
- prealloc
- scopelint
- tagliatelle
- varnamelen
- wsl