Skip to content

Commit

Permalink
sort imports with gci
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Jun 18, 2023
1 parent 05c2dae commit 3e9ced7
Show file tree
Hide file tree
Showing 119 changed files with 584 additions and 447 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.52.2
version: v1.53.2

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
13 changes: 12 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ run:
linters:
disable-all: true
enable:
- depguard
- dogsled
- exportloopref
- gci
- goconst
- gocritic
- gofumpt
Expand Down Expand Up @@ -60,6 +60,17 @@ issues:
max-same-issues: 10000

linters-settings:
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/interchain-security)
custom-order: true
gofumpt:
# Choose whether to use the extra rules.
# Default: false
Expand Down
4 changes: 3 additions & 1 deletion app/consumer-democracy/ante/forbidden_proposals_ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ package ante_test
import (
"testing"

"github.com/stretchr/testify/require"

sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/cosmos/cosmos-sdk/x/params/types/proposal"

app "github.com/cosmos/interchain-security/v2/app/consumer-democracy"
"github.com/cosmos/interchain-security/v2/app/consumer-democracy/ante"
"github.com/stretchr/testify/require"
)

func TestForbiddenProposalsDecorator(t *testing.T) {
Expand Down
7 changes: 5 additions & 2 deletions app/consumer-democracy/ante_handler.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package app

import (
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"

errorsmod "cosmossdk.io/errors"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"

democracyante "github.com/cosmos/interchain-security/v2/app/consumer-democracy/ante"
consumerante "github.com/cosmos/interchain-security/v2/app/consumer/ante"
ibcconsumerkeeper "github.com/cosmos/interchain-security/v2/x/ccv/consumer/keeper"
Expand Down
86 changes: 40 additions & 46 deletions app/consumer-democracy/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,25 @@ import (
"os"
"path/filepath"

genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
appparams "github.com/cosmos/interchain-security/v2/app/params"
"github.com/cosmos/ibc-go/v4/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v4/modules/core"
ibcconnectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"
porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
"github.com/spf13/cast"
abci "github.com/tendermint/tendermint/abci/types"
tmjson "github.com/tendermint/tendermint/libs/json"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

// unnamed import of statik for swagger UI support
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -47,72 +64,49 @@ import (
"github.com/cosmos/cosmos-sdk/x/crisis"
crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper"
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
distr "github.com/cosmos/cosmos-sdk/x/distribution"
distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client"
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
"github.com/cosmos/cosmos-sdk/x/evidence"
evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
"github.com/cosmos/cosmos-sdk/x/feegrant"
feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper"
feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
gov "github.com/cosmos/cosmos-sdk/x/gov"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
// add mint
mint "github.com/cosmos/cosmos-sdk/x/mint"
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
"github.com/cosmos/cosmos-sdk/x/params"
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"

paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
"github.com/cosmos/cosmos-sdk/x/slashing"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/cosmos/cosmos-sdk/x/upgrade"
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/v4/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v4/modules/core"
ibcconnectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"
porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"

appparams "github.com/cosmos/interchain-security/v2/app/params"
ibctestingcore "github.com/cosmos/interchain-security/v2/legacy_ibc_testing/core"
ibctesting "github.com/cosmos/interchain-security/v2/legacy_ibc_testing/testing"
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
"github.com/spf13/cast"
abci "github.com/tendermint/tendermint/abci/types"
tmjson "github.com/tendermint/tendermint/libs/json"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

distr "github.com/cosmos/cosmos-sdk/x/distribution"

distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client"
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
testutil "github.com/cosmos/interchain-security/v2/testutil/integration"
ccvdistr "github.com/cosmos/interchain-security/v2/x/ccv/democracy/distribution"

stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
ccvstaking "github.com/cosmos/interchain-security/v2/x/ccv/democracy/staking"

gov "github.com/cosmos/cosmos-sdk/x/gov"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
ccvgov "github.com/cosmos/interchain-security/v2/x/ccv/democracy/governance"

// add mint
mint "github.com/cosmos/cosmos-sdk/x/mint"
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"

paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
consumer "github.com/cosmos/interchain-security/v2/x/ccv/consumer"
consumerkeeper "github.com/cosmos/interchain-security/v2/x/ccv/consumer/keeper"
consumertypes "github.com/cosmos/interchain-security/v2/x/ccv/consumer/types"

// unnamed import of statik for swagger UI support
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"
ccvdistr "github.com/cosmos/interchain-security/v2/x/ccv/democracy/distribution"
ccvgov "github.com/cosmos/interchain-security/v2/x/ccv/democracy/governance"
ccvstaking "github.com/cosmos/interchain-security/v2/x/ccv/democracy/staking"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion app/consumer-democracy/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"fmt"

tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"

servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
tmtypes "github.com/tendermint/tendermint/types"
)

// ExportAppStateAndValidators exports the state of the application for a genesis
Expand Down
3 changes: 2 additions & 1 deletion app/consumer-democracy/proposals_whitelisting.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package app

import (
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"

banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
"github.com/cosmos/cosmos-sdk/x/params/types/proposal"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
)

func IsProposalWhitelisted(content govtypes.Content) bool {
Expand Down
3 changes: 2 additions & 1 deletion app/consumer-democracy/proposals_whitelisting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package app_test
import (
"testing"

"github.com/stretchr/testify/require"

appConsumer "github.com/cosmos/interchain-security/v2/app/consumer-democracy"
ibctesting "github.com/cosmos/interchain-security/v2/legacy_ibc_testing/testing"
icstestingutils "github.com/cosmos/interchain-security/v2/testutil/ibc_testing"
"github.com/stretchr/testify/require"
)

func TestDemocracyGovernanceWhitelistingKeys(t *testing.T) {
Expand Down
6 changes: 4 additions & 2 deletions app/consumer/ante/disabled_modules_ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ package ante_test
import (
"testing"

ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
"github.com/stretchr/testify/require"

sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"

"github.com/cosmos/interchain-security/v2/app/consumer/ante"
"github.com/cosmos/interchain-security/v2/app/params"
"github.com/stretchr/testify/require"
)

func TestDisabledModulesDecorator(t *testing.T) {
Expand Down
6 changes: 4 additions & 2 deletions app/consumer/ante/msg_filter_ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ package ante_test
import (
"testing"

ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
"github.com/stretchr/testify/require"

sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"

"github.com/cosmos/interchain-security/v2/app/consumer/ante"
"github.com/cosmos/interchain-security/v2/app/params"
"github.com/stretchr/testify/require"
)

type consumerKeeper struct {
Expand Down
7 changes: 5 additions & 2 deletions app/consumer/ante_handler.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package app

import (
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"

errorsmod "cosmossdk.io/errors"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"

consumerante "github.com/cosmos/interchain-security/v2/app/consumer/ante"
ibcconsumerkeeper "github.com/cosmos/interchain-security/v2/x/ccv/consumer/keeper"
)
Expand Down
43 changes: 22 additions & 21 deletions app/consumer/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@ import (
"os"
"path/filepath"

"github.com/cosmos/ibc-go/v4/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v4/modules/core"
ibcconnectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"
porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
"github.com/spf13/cast"
abci "github.com/tendermint/tendermint/abci/types"
tmjson "github.com/tendermint/tendermint/libs/json"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

// unnamed import of statik for swagger UI support
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
Expand Down Expand Up @@ -59,33 +79,14 @@ import (
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/cosmos/ibc-go/v4/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v4/modules/core"
ibcconnectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"
porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"

appparams "github.com/cosmos/interchain-security/v2/app/params"
ibctestingcore "github.com/cosmos/interchain-security/v2/legacy_ibc_testing/core"
ibctesting "github.com/cosmos/interchain-security/v2/legacy_ibc_testing/testing"
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
"github.com/spf13/cast"
abci "github.com/tendermint/tendermint/abci/types"
tmjson "github.com/tendermint/tendermint/libs/json"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

testutil "github.com/cosmos/interchain-security/v2/testutil/integration"
ibcconsumer "github.com/cosmos/interchain-security/v2/x/ccv/consumer"
ibcconsumerkeeper "github.com/cosmos/interchain-security/v2/x/ccv/consumer/keeper"
ibcconsumertypes "github.com/cosmos/interchain-security/v2/x/ccv/consumer/types"

// unnamed import of statik for swagger UI support
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"
testutil "github.com/cosmos/interchain-security/v2/testutil/integration"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion app/consumer/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"fmt"

tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"

servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
tmtypes "github.com/tendermint/tendermint/types"
)

// ExportAppStateAndValidators implements the simapp app interface
Expand Down
6 changes: 4 additions & 2 deletions app/provider/ante_handler.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package app

import (
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"

errorsmod "cosmossdk.io/errors"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
)

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
Expand Down
Loading

0 comments on commit 3e9ced7

Please sign in to comment.