-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.golangci.yml
117 lines (112 loc) · 3.6 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
# This file configures github.com/golangci/golangci-lint.
run:
timeout: 3m
tests: true
linters:
disable-all: true
enable:
- whitespace # Tool for detection of leading and trailing whitespace
- wsl # Forces you to use empty lines
- wastedassign # Finds wasted assignment statements
- unconvert # Unnecessary type conversions
- tparallel # Detects inappropriate usage of t.Parallel() method in your Go test codes
- thelper # Detects golang test helpers without t.Helper() call and checks the consistency of test helpers
- stylecheck # Stylecheck is a replacement for golint
- prealloc # Finds slice declarations that could potentially be pre-allocated
- predeclared # Finds code that shadows one of Go's predeclared identifiers
- nolintlint # Ill-formed or insufficient nolint directives
- nlreturn # Checks for a new line before return and branch statements to increase code clarity
- misspell # Misspelled English words in comments
- makezero # Finds slice declarations with non-zero initial length
- lll # Long lines
- importas # Enforces consistent import aliases
- gosec # Security problems
- gofmt # Whether the code was gofmt-ed
- goimports # Unused imports
- goconst # Repeated strings that could be replaced by a constant
- forcetypeassert # Finds forced type assertions
- dogsled # Checks assignments with too many blank identifiers (e.g. x, , , _, := f())
- dupl # Code clone detection
- errname # Checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
- errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13
- gocritic
- errcheck # Errcheck is a go lint rule for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
- godox # Godox is a linter for TODOs and FIXMEs left in the code
linters-settings:
gofmt:
simplify: true
goconst:
min-len: 3
min-occurrences: 3
gocritic:
enabled-checks:
- ruleguard
settings:
ruleguard:
rules: "./gorules/rules.go"
lll:
line-length: 120
issues:
# report only new issues with reference to the selected revision
new-from-rev: d27793e73eb22c4464711b187b8c98f14f7b8b17
whole-files: true
exclude-dirs:
- archive
- blockchain
- command/bridge
- command/ibft
- command/rootchain
- consensus/dev
- consensus/ibft
- crypto
- gasprice
- helper/keccak
- helper/predeployment
- helper/staking
- jsonrpc
- state/immutable-trie
- state/runtime
- syncer
- tests
- tracker
- txpool
- types
exclude-rules:
- path: testing\.go
linters:
- gosec
- unparam
- lll
- path: _test\.go
linters:
- gosec
- gocritic
- unparam
- wsl
- lll
- predeclared
- wastedassign
- nolintlint
- forcetypeassert
- path: gen_sc_data\.go
linters:
- wsl
- lll
- stylecheck
- path: system_service\.go
linters:
- gosec
- path: proposer_calculator\.go
linters:
- predeclared
include:
- EXC0012 # Exported (.+) should have comment( \(or a comment on this block\))? or be unexported
- EXC0013 # Package comment should be of the form "(.+)...
- EXC0014 # Comment on exported (.+) should be of the form "(.+)..."
- EXC0015 # Should have a package comment
output:
sort-results: true
show-stats: true
sort-order:
- linter
- file