-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add linter recipe and lint all go code (#57)
- Loading branch information
1 parent
2cb288e
commit c9d09c9
Showing
135 changed files
with
1,187 additions
and
968 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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
run: | ||
tests: true | ||
# # timeout for analysis, e.g. 30s, 5m, default is 1m | ||
timeout: 5m | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- dogsled | ||
- copyloopvar | ||
- errcheck | ||
- gci | ||
- goconst | ||
- gocritic | ||
- gofumpt | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- nakedret | ||
- staticcheck | ||
- thelper | ||
- stylecheck | ||
- revive | ||
- typecheck | ||
- unconvert | ||
- unused | ||
- misspell | ||
|
||
issues: | ||
exclude-rules: | ||
- text: "unused-parameter" | ||
linters: | ||
- revive | ||
- text: "SA1019:" | ||
linters: | ||
- staticcheck | ||
- text: "Use of weak random number generator" | ||
linters: | ||
- gosec | ||
- text: "ST1003:" | ||
linters: | ||
- stylecheck | ||
# FIXME: Disabled until golangci-lint updates stylecheck with this fix: | ||
# https://github.com/dominikh/go-tools/issues/389 | ||
- text: "ST1016:" | ||
linters: | ||
- stylecheck | ||
max-issues-per-linter: 10000 | ||
max-same-issues: 10000 | ||
|
||
linters-settings: | ||
gosec: | ||
excludes: | ||
# Flags for potentially-unsafe casting of ints, similar problem to globally-disabled G103 | ||
- G115 | ||
gci: | ||
sections: | ||
- standard # Standard section: captures all standard packages. | ||
- default # Default section: contains all imports that could not be matched to another section type. | ||
- blank # blank imports | ||
- dot # dot imports | ||
- prefix(cosmossdk.io) | ||
- prefix(github.com/cosmos/cosmos-sdk) | ||
- prefix(github.com/cometbft/cometbft) | ||
- prefix(github.com/cosmos/ibc-go) | ||
- prefix(github.com/strangelove-ventures/interchaintest) | ||
- prefix(github.com/cosmos/interchain-attestation) | ||
|
||
custom-order: true | ||
dogsled: | ||
max-blank-identifiers: 3 | ||
maligned: | ||
# print struct with more effective memory layout or not, false by default | ||
suggest-new: true | ||
nolintlint: | ||
allow-unused: false | ||
allow-leading-space: true | ||
require-explanation: false | ||
require-specific: false | ||
revive: | ||
rules: | ||
- name: if-return | ||
disabled: true |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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.