Skip to content

feat(linter): enable copyloopvar && check all #2180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,43 +31,44 @@ linters:
- revive
- stylecheck
- typecheck
# - thelper # too many positives with table tests that have custom setup(*testing.T)
# - thelper # too many positives with table tests that have custom setup(*testing.T)
- unconvert
- unused
- copyloopvar

issues:
exclude-rules:
- text: 'Use of weak random number generator'
- text: "Use of weak random number generator"
linters:
- gosec
- text: 'ST1003:'
- text: "ST1003:"
linters:
- stylecheck
# FIXME: Disabled until golangci-lint updates stylecheck with this fix:
# https://github.com/dominikh/go-tools/issues/389
- text: 'ST1016:'
- text: "ST1016:"
linters:
- stylecheck
- path: 'migrations'
text: 'SA1019:'
- path: "migrations"
text: "SA1019:"
linters:
- staticcheck
- text: 'SA1019: codec.NewAminoCodec is deprecated' # TODO remove once migration path is set out
- text: "SA1019: codec.NewAminoCodec is deprecated" # TODO remove once migration path is set out
linters:
- staticcheck
- text: 'SA1019: legacybech32.MustMarshalPubKey' # TODO remove once ready to remove from the sdk
- text: "SA1019: legacybech32.MustMarshalPubKey" # TODO remove once ready to remove from the sdk
linters:
- staticcheck
- text: 'SA1019: legacybech32.MarshalPubKey' # TODO remove once ready to remove from the sdk
- text: "SA1019: legacybech32.MarshalPubKey" # TODO remove once ready to remove from the sdk
linters:
- staticcheck
- text: 'SA1019: legacybech32.UnmarshalPubKey' # TODO remove once ready to remove from the sdk
- text: "SA1019: legacybech32.UnmarshalPubKey" # TODO remove once ready to remove from the sdk
linters:
- staticcheck
- text: 'SA1019: params.SendEnabled is deprecated' # TODO remove once ready to remove from the sdk
- text: "SA1019: params.SendEnabled is deprecated" # TODO remove once ready to remove from the sdk
linters:
- staticcheck
- text: 'leading space'
- text: "leading space"
linters:
- nolintlint
max-issues-per-linter: 10000
Expand Down Expand Up @@ -140,7 +141,7 @@ linters-settings:
require-explanation: false
require-specific: false
gosimple:
checks: ['all']
checks: ["all"]
gocritic:
disabled-checks:
- regexpMust
Expand Down
1 change: 0 additions & 1 deletion app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func (app *WasmApp) RegisterUpgradeHandlers() {

func setupLegacyKeyTables(k *paramskeeper.Keeper) {
for _, subspace := range k.GetSubspaces() {
subspace := subspace

var keyTable paramstypes.KeyTable
switch subspace.Name() {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func TestHandleCreate(t *testing.T) {
}

for name, tc := range cases {
tc := tc

t.Run(name, func(t *testing.T) {
data := setupTest(t)

Expand Down
1 change: 0 additions & 1 deletion x/wasm/keeper/query_plugins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,6 @@ func TestGRPCQuerier(t *testing.T) {
errorsCount := atomic.Uint64{}
for range 50 {
for _, denom := range []string{denom1, denom2} {
denom := denom // copy
eg.Go(func() error {
queryReq := &banktypes.QueryBalanceRequest{
Address: addr,
Expand Down