Skip to content

Commit

Permalink
fix lint (#79)
Browse files Browse the repository at this point in the history
* fix lint

* remove unnecessary deps

* remove out-format

* removed deprecated

* fix missing import

* updates
  • Loading branch information
anilcse authored Oct 17, 2022
1 parent 790aece commit 4ddc51b
Show file tree
Hide file tree
Showing 41 changed files with 317 additions and 161 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: Checkout code
uses: actions/checkout@v3
- name: Display go version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
-
name: Run GoReleaser
uses: goreleaser/[email protected]
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
version: latest
args: --out-format=tab
skip-go-installation: true
if: env.GIT_DIFF
12 changes: 6 additions & 6 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- run: make build
Expand All @@ -34,7 +34,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- name: Install runsim
Expand All @@ -53,7 +53,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- uses: technote-space/[email protected]
Expand All @@ -80,7 +80,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- uses: technote-space/[email protected]
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- uses: technote-space/[email protected]
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- uses: technote-space/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: Unshallow
run: git fetch --prune --unshallow
- name: Create release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: Checkout code
uses: actions/checkout@v3
- uses: technote-space/[email protected]
Expand Down
4 changes: 0 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- errcheck
- exportloopref
- goconst
- gocritic
- gofmt
Expand All @@ -24,9 +22,7 @@ linters:
- nakedret
- nolintlint
- prealloc
- revive
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
Expand Down
3 changes: 2 additions & 1 deletion app/addr_prefixes.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package app

import (
"fmt"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/address"
)
Expand Down Expand Up @@ -37,5 +38,5 @@ func SetAddressPrefixes() {
}
return fmt.Errorf("unexpected address length %d", n)
})
//config.Seal()
// config.Seal()
}
15 changes: 8 additions & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ import (
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/ibc-go/v2/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v2/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v2/modules/core"
porttypes "github.com/cosmos/ibc-go/v2/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v2/modules/core/keeper"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
Expand Down Expand Up @@ -87,13 +95,6 @@ import (
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/cosmos/ibc-go/v2/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v2/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v2/modules/core"
porttypes "github.com/cosmos/ibc-go/v2/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v2/modules/core/keeper"

claimkeeper "github.com/envadiv/Passage3D/x/claim/keeper"
claimtypes "github.com/envadiv/Passage3D/x/claim/types"
Expand Down
8 changes: 5 additions & 3 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@ package app

import (
"encoding/json"
"github.com/envadiv/Passage3D/x/claim"
"os"
"testing"

"github.com/envadiv/Passage3D/x/claim"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/ibc-go/v2/modules/apps/transfer"
ibc "github.com/cosmos/ibc-go/v2/modules/core"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/tests/mocks"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -34,8 +38,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/slashing"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/upgrade"
"github.com/cosmos/ibc-go/v2/modules/apps/transfer"
ibc "github.com/cosmos/ibc-go/v2/modules/core"
)

func TestSimAppExportAndBlockedAddrs(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion app/encoding.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package app

import (
"github.com/cosmos/cosmos-sdk/std"
"github.com/envadiv/Passage3D/app/params"

"github.com/cosmos/cosmos-sdk/std"
)

// MakeEncodingConfig creates an EncodingConfig for testing.
Expand Down
3 changes: 2 additions & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ func (app *PassageApp) ExportAppStateAndValidators(

// prepare for fresh start at zero height
// NOTE zero height genesis is a temporary feature which will be deprecated
// in favour of export at a block height
//
// in favour of export at a block height
func (app *PassageApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
applyAllowedAddrs := false

Expand Down
1 change: 1 addition & 0 deletions app/params/amino.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build test_amino
// +build test_amino

package params
Expand Down
4 changes: 2 additions & 2 deletions cmd/passage/cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
func TestInitCmd(t *testing.T) {
rootCmd, _ := cmd.NewRootCmd()
rootCmd.SetArgs([]string{
"init", // Test the init cmd
"simapp-test", // Moniker
"init", // Test the init cmd
"passage-app-test", // Moniker
fmt.Sprintf("--%s=%s", cli.FlagOverwrite, "true"), // Overwrite genesis.json, in case it already exists
})

Expand Down
3 changes: 2 additions & 1 deletion cmd/passage/cmd/genaccounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"

simcmd "github.com/envadiv/Passage3D/cmd/passage/cmd"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/server"
Expand All @@ -21,7 +23,6 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltest "github.com/cosmos/cosmos-sdk/x/genutil/client/testutil"
simcmd "github.com/envadiv/Passage3D/cmd/passage/cmd"
)

var testMbm = module.NewBasicManager(genutil.AppModuleBasic{})
Expand Down
9 changes: 6 additions & 3 deletions cmd/passage/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@ package cmd

import (
"errors"
appparams "github.com/envadiv/Passage3D/app/params"
"io"
"os"
"path/filepath"

serverconfig "github.com/cosmos/cosmos-sdk/server/config"
appparams "github.com/envadiv/Passage3D/app/params"

"github.com/spf13/cast"
"github.com/spf13/cobra"
tmcli "github.com/tendermint/tendermint/libs/cli"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

serverconfig "github.com/cosmos/cosmos-sdk/server/config"

"github.com/envadiv/Passage3D/app"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/config"
Expand All @@ -31,7 +35,6 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
"github.com/envadiv/Passage3D/app"
)

// NewRootCmd creates a new root command for simd. It is called once in the
Expand Down
7 changes: 4 additions & 3 deletions cmd/passage/cmd/testnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ import (
"fmt"
"testing"

"github.com/spf13/viper"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/simapp"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
genutiltest "github.com/cosmos/cosmos-sdk/x/genutil/client/testutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"
)

func Test_TestnetCmd(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions cmd/passage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package main
import (
"os"

"github.com/cosmos/cosmos-sdk/server"
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
"github.com/envadiv/Passage3D/app"
"github.com/envadiv/Passage3D/cmd/passage/cmd"

"github.com/cosmos/cosmos-sdk/server"
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
)

func main() {
Expand Down
Loading

0 comments on commit 4ddc51b

Please sign in to comment.