-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update linter * begin lint * linting * finalize * timeout * revert * revert * properly use %q * regenerate proto * fix test --------- Co-authored-by: aljo242 <[email protected]>
- Loading branch information
Alex Johnson
and
aljo242
authored
Mar 30, 2023
1 parent
8f9ddd9
commit 00907da
Showing
227 changed files
with
3,326 additions
and
3,015 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,152 @@ | ||
run: | ||
tests: false | ||
tests: true | ||
# timeout for analysis, e.g. 30s, 5m, default is 1m | ||
timeout: 5m | ||
timeout: 10m | ||
skip-dirs: | ||
- osmosis-types/* | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
# Check for pass []any as any in variadic func(...any). | ||
# Rare case but saved me from debugging a few times. | ||
- asasalint | ||
# I prefer plane ASCII identifiers. | ||
# Symbol `∆` instead of `delta` looks cool but no thanks. | ||
- asciicheck | ||
# Checks for dangerous unicode character sequences. | ||
# Super rare but why not to be a bit paranoid? | ||
- bidichk | ||
- bodyclose | ||
# Check whether the function uses a non-inherited context. | ||
- contextcheck | ||
# Check for two durations multiplied together. | ||
- durationcheck | ||
- depguard | ||
- dogsled | ||
- errcheck | ||
# Checks `Err-` prefix for var and `-Error` suffix for error type. | ||
- errname | ||
# Suggests to use `%w` for error-wrapping. | ||
- errorlint | ||
# Checks for pointers to enclosing loop variables. | ||
- exportloopref | ||
- goconst | ||
- gocritic | ||
# Forces to put `.` at the end of the comment. Code is poetry. | ||
- godot | ||
# Might not be that important, but I prefer to keep all of them. | ||
# `gofumpt` is amazing, kudos to Daniel Marti https://github.com/mvdan/gofumpt | ||
- gofmt | ||
- gofumpt | ||
- revive | ||
- goimports | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- nakedret | ||
- exportloopref | ||
# Finds sending HTTP request without context.Context. | ||
- noctx | ||
# Finds slices that could potentially be pre-allocated. | ||
# Small performance win + cleaner code. | ||
- prealloc | ||
# Finds shadowing of Go's predeclared identifiers. | ||
# I hear a lot of complaints from junior developers. | ||
# But after some time they find it very useful. | ||
- predeclared | ||
# Lint your Prometheus metrics name. | ||
- promlinter | ||
# Checks that package variables are not reassigned. | ||
# Super rare case but can catch bad things (like `io.EOF = nil`) | ||
- reassign | ||
- revive | ||
- staticcheck | ||
- stylecheck | ||
# Checks that package variables are not reassigned. | ||
# Super rare case but can catch bad things (like `io.EOF = nil`) | ||
- reassign | ||
- typecheck | ||
# Test-related checks. All of them are good. | ||
- tenv | ||
- testableexamples | ||
- thelper | ||
- tparallel | ||
- unconvert | ||
- unused | ||
- unparam | ||
- misspell | ||
- nolintlint | ||
# Detect the possibility to use variables/constants from stdlib. | ||
- usestdlibvars | ||
# Finds wasted assignment statements. | ||
- wastedassign | ||
|
||
exclude-rules: | ||
- linters: | ||
- nolintlint | ||
text: "should be written without leading space" | ||
text: | ||
- "should be written without leading space" | ||
|
||
issues: | ||
exclude-rules: | ||
# Exclude some linters from running on tests files. | ||
- path: _test\.go | ||
linters: | ||
- gocyclo | ||
- errcheck | ||
- dupl | ||
- gosec | ||
|
||
linters-settings: | ||
# I'm biased and I'm enabling more than 100 checks | ||
# Might be too much for you. See https://go-critic.com/overview.html | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- experimental | ||
- opinionated | ||
- performance | ||
- style | ||
disabled-checks: | ||
- hugeParam | ||
- rangeExprCopy | ||
- rangeValCopy | ||
- timeCmpSimplify | ||
- unlabelStmt | ||
- unnamedResult | ||
- tooManyResultsChecker | ||
- whyNoLint | ||
- commentedOutCode | ||
|
||
gosec: | ||
excludes: | ||
- G306 | ||
|
||
errcheck: | ||
# Report `a := b.(MyStruct)` when `a, ok := ...` should be. | ||
check-type-assertions: true # Default: false | ||
|
||
|
||
# Function to skip. | ||
exclude-functions: | ||
- io/ioutil.ReadFile | ||
- io.Copy(*bytes.Buffer) | ||
- io.Copy(os.Stdout) | ||
|
||
govet: | ||
disable: | ||
- fieldalignment # I'm ok to waste some bytes | ||
|
||
|
||
nakedret: | ||
# No naked returns, ever. | ||
max-func-lines: 1 # Default: 30 | ||
|
||
tagliatelle: | ||
case: | ||
rules: | ||
json: snake # why it's not a `snake` by default?! | ||
yaml: snake # why it's not a `snake` by default?! | ||
xml: camel | ||
bson: camel | ||
avro: snake | ||
mapstructure: kebab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.