forked from osmosis-labs/osmosis
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.golangci.yml
115 lines (113 loc) · 4.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
run:
tests: false
# # timeout for analysis, e.g. 30s, 5m, default is 1m
# timeout: 5m
linters:
disable-all: true
# Enable specific linter
# https://golangci-lint.run/usage/linters/#enabled-by-default-linters
enable:
- asciicheck
- bidichk
# - bodyclose <- needs go 1.18 support
# - contextcheck <- needs go 1.18 support
# - cyclop
- depguard
# - dogsled <- disabled because we would like to participate in the iditerod
# - dupl <- really just catches cli stub text
- durationcheck
- errcheck
- errname
# - errorlint <- later
# - exhaustive <- too picky
# - exhaustivestruct <- disabled because we don't want to use every element of every struct
- exportloopref
# - forbidigo <- forbids fmt.Print* by default
- forcetypeassert
# - funlen <- some of our functions are longer than this by necessity
# - gci <- questionable utility
# - gochecknoglobals <- disabled because we want some globals
# - gochecknoinits <- disabled because we want to use init()
# - gocognit <- disabled for same reason as gocyclo
- goconst
# - gocritic <- re enable later to catch capitalized local variables
# - gocyclo <- disabled because it won't work with how we cosmos
# - godot
# - godox <- detects TODO/BUG/FIXME and we may wantnthis later but isn't appropriate now
# - goerr113 <- disabled due to lack of comprehension
- gofmt
# - gofumpt <- disabled https://github.com/osmosis-labs/osmosis/issues/1309
- goheader
- goimports
# - gomoddirectives <- disables replaces
- gomodguard
- goprintffuncname
# - gosec <- triggers too much for this round and should be re-enabled later
- gosimple # specializes in simplifying code, subset of staticcheck binary.
- govet
# - ifshort <- questionable value, unclear if globally helping readability.
- importas
- ineffassign
# - ireturn <- disabled because we want to return interfaces
# - lll <- disabled as it is a bit much. Maybe we have a desired limit?
- makezero
- misspell
- nakedret
# - nestif <- ?
# - nilerr <- needs go 1.18 support
- nilnil
# - nlreturn <- disabled as it doesn't auto-fix something simple and doesn't add anything useful
# - noctx <- needs go 1.18 support
# - nolintlint <- disabled because we use nolint in some places
- paralleltest
# - prealloc <- disabled because it makes simple code complicated
# - predeclared <- later
- promlinter
# - revive <- temporarily disabled while jacob figures out how to make poolId not trigger it.
# - rowserrcheck <- needs go 1.18 support
# - sqlclosecheck <- needs go 1.18 support
- staticcheck # set of rules from staticcheck, subset of staticcheck binary.
- stylecheck # replacement of golint, subset of staticcheck binary.
# - tagliatelle <- disabled for defying cosmos idiom
- tenv
- testpackage
# - thelper <- later
# - tparallel <- needs go 1.18 support
- typecheck
- unconvert
# - unparam <- looks for unused parameters (enable later)
- unused # looks for unused variables, subset of staticcheck binary.
# - varnamelen <- disabled because defies idiom
# - wastedassign
- whitespace
# - wrapcheck
# - wsl
issues:
exclude-rules:
- path: bench_test\.go
linters:
- errcheck
- path: client/docs
linters:
- all
- path: x/gamm/pool-models/stableswap
linters:
# Stableswap is in development.
# We should re-enable deadcode and unused linting
# across its files, once stableswap is fully complete.
- unused
- deadcode
- linters:
- staticcheck
text: "SA1024: cutset contains duplicate characters" # proved to not provide much value, only false positives.
- linters:
- staticcheck
text: "SA9004: only the first constant in this group has an explicit type" # explicitly recommended in go syntax
- linters:
- stylecheck
text: "ST1003:" # requires identifiers with "id" to be "ID".
- linters:
- stylecheck
text: "ST1005:" # punctuation in error messages
max-issues-per-linter: 10000
max-same-issues: 10000