Skip to content

Commit

Permalink
chore: fix linter (#14)
Browse files Browse the repository at this point in the history
- fix govgen import path in gci tool configuration in the
`.golangci.yml` file
- fix import order in respect of that configuration (`make format` can
do that automatically)
- fix usage of `//nolint: unparam`

Not sure if we should target `feat/custom-gov-module` or `main` branch,
give me your though!
  • Loading branch information
tbruyelle authored Feb 13, 2024
1 parent 17c12d6 commit 86e32fb
Show file tree
Hide file tree
Showing 71 changed files with 217 additions and 181 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ linters-settings:
- prefix(github.com/cosmos) # cosmos org
- prefix(cosmossdk.io) # new modules
- prefix(github.com/cosmos/cosmos-sdk) # cosmos sdk
- prefix(github.com/govgen/govgen) # govgen
- prefix(github.com/atomone-hub/govgen) # govgen
dogsled:
max-blank-identifiers: 3
maligned:
Expand Down
6 changes: 3 additions & 3 deletions ante/ante.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package ante

import (
"github.com/atomone-hub/govgen/v1/types/errors"
govkeeper "github.com/atomone-hub/govgen/v1/x/gov/keeper"

errorsmod "cosmossdk.io/errors"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"

"github.com/atomone-hub/govgen/v1/types/errors"
govkeeper "github.com/atomone-hub/govgen/v1/x/gov/keeper"
)

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
Expand Down
7 changes: 4 additions & 3 deletions ante/fee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import (
"fmt"
"testing"

"github.com/atomone-hub/govgen/v1/ante"
govgenapp "github.com/atomone-hub/govgen/v1/app"
govgenhelpers "github.com/atomone-hub/govgen/v1/app/helpers"
"github.com/stretchr/testify/suite"
tmrand "github.com/tendermint/tendermint/libs/rand"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
Expand All @@ -19,6 +16,10 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
xauthsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"

"github.com/atomone-hub/govgen/v1/ante"
govgenapp "github.com/atomone-hub/govgen/v1/app"
govgenhelpers "github.com/atomone-hub/govgen/v1/app/helpers"
)

type FeeIntegrationTestSuite struct {
Expand Down
8 changes: 4 additions & 4 deletions ante/gov_ante.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package ante

import (
"github.com/atomone-hub/govgen/v1/types/errors"
govkeeper "github.com/atomone-hub/govgen/v1/x/gov/keeper"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"

errorsmod "cosmossdk.io/errors"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/authz"

"github.com/atomone-hub/govgen/v1/types/errors"
govkeeper "github.com/atomone-hub/govgen/v1/x/gov/keeper"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
)

// initial deposit must be greater than or equal to 1% of the minimum deposit
Expand Down
9 changes: 5 additions & 4 deletions ante/gov_ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ import (
"fmt"
"testing"

"github.com/atomone-hub/govgen/v1/ante"
govgenapp "github.com/atomone-hub/govgen/v1/app"
govgenhelpers "github.com/atomone-hub/govgen/v1/app/helpers"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
"github.com/stretchr/testify/suite"
tmrand "github.com/tendermint/tendermint/libs/rand"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/atomone-hub/govgen/v1/ante"
govgenapp "github.com/atomone-hub/govgen/v1/app"
govgenhelpers "github.com/atomone-hub/govgen/v1/app/helpers"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
)

var (
Expand Down
11 changes: 6 additions & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ import (
"os"
"path/filepath"

govgenante "github.com/atomone-hub/govgen/v1/ante"
"github.com/atomone-hub/govgen/v1/app/keepers"
govgenappparams "github.com/atomone-hub/govgen/v1/app/params"
"github.com/atomone-hub/govgen/v1/app/upgrades"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
"github.com/spf13/cast"
Expand Down Expand Up @@ -45,6 +40,12 @@ import (
"github.com/cosmos/cosmos-sdk/x/crisis"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

govgenante "github.com/atomone-hub/govgen/v1/ante"
"github.com/atomone-hub/govgen/v1/app/keepers"
govgenappparams "github.com/atomone-hub/govgen/v1/app/params"
"github.com/atomone-hub/govgen/v1/app/upgrades"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
)

var (
Expand Down
7 changes: 4 additions & 3 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package govgen_test
import (
"testing"

govgen "github.com/atomone-hub/govgen/v1/app"
govgenhelpers "github.com/atomone-hub/govgen/v1/app/helpers"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"
db "github.com/tendermint/tm-db"

authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

govgen "github.com/atomone-hub/govgen/v1/app"
govgenhelpers "github.com/atomone-hub/govgen/v1/app/helpers"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
)

type EmptyAppOptions struct{}
Expand Down
4 changes: 2 additions & 2 deletions app/encoding.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package govgen

import (
"github.com/atomone-hub/govgen/v1/app/params"

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

"github.com/atomone-hub/govgen/v1/app/params"
)

// MakeTestEncodingConfig creates an EncodingConfig for testing. This function
Expand Down
3 changes: 2 additions & 1 deletion app/helpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"testing"
"time"

govgenapp "github.com/atomone-hub/govgen/v1/app"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto"
Expand All @@ -33,6 +32,8 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

govgenapp "github.com/atomone-hub/govgen/v1/app"
)

// SimAppChainID hardcoded chainID for simulation
Expand Down
6 changes: 3 additions & 3 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ package keepers
import (
tmos "github.com/tendermint/tendermint/libs/os"

govkeeper "github.com/atomone-hub/govgen/v1/x/gov/keeper"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"

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

Expand Down Expand Up @@ -42,6 +39,9 @@ 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"

govkeeper "github.com/atomone-hub/govgen/v1/x/gov/keeper"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
)

type AppKeepers struct {
Expand Down
4 changes: 2 additions & 2 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package keepers

import (
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"

storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
Expand All @@ -17,6 +15,8 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
)

func (appKeepers *AppKeepers) GenerateKeys() {
Expand Down
8 changes: 4 additions & 4 deletions app/modules.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package govgen

import (
govgenappparams "github.com/atomone-hub/govgen/v1/app/params"
"github.com/atomone-hub/govgen/v1/x/gov"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"

"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth"
authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation"
Expand Down Expand Up @@ -39,6 +35,10 @@ import (
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

govgenappparams "github.com/atomone-hub/govgen/v1/app/params"
"github.com/atomone-hub/govgen/v1/x/gov"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
)

var maccPerms = map[string][]string{
Expand Down
5 changes: 3 additions & 2 deletions app/sim/sim_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"os"
"time"

govgen "github.com/atomone-hub/govgen/v1/app"
appparams "github.com/atomone-hub/govgen/v1/app/params"
tmjson "github.com/tendermint/tendermint/libs/json"
tmtypes "github.com/tendermint/tendermint/types"

Expand All @@ -21,6 +19,9 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

govgen "github.com/atomone-hub/govgen/v1/app"
appparams "github.com/atomone-hub/govgen/v1/app/params"
)

// AppStateFn returns the initial application state using a genesis or the simulation parameters.
Expand Down
4 changes: 2 additions & 2 deletions app/sim/sim_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import (
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

govgen "github.com/atomone-hub/govgen/v1/app"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/simapp/helpers"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
distrsim "github.com/cosmos/cosmos-sdk/x/distribution/simulation"

govgen "github.com/atomone-hub/govgen/v1/app"
)

// SetupSimulation creates the config, db (levelDB), temporary directory and logger for
Expand Down
9 changes: 5 additions & 4 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import (
"os"
"testing"

govgen "github.com/atomone-hub/govgen/v1/app"
"github.com/atomone-hub/govgen/v1/app/helpers"
"github.com/atomone-hub/govgen/v1/app/params"
"github.com/atomone-hub/govgen/v1/app/sim"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"
Expand All @@ -20,6 +16,11 @@ import (
"github.com/cosmos/cosmos-sdk/store"
simulation2 "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/simulation"

govgen "github.com/atomone-hub/govgen/v1/app"
"github.com/atomone-hub/govgen/v1/app/helpers"
"github.com/atomone-hub/govgen/v1/app/params"
"github.com/atomone-hub/govgen/v1/app/sim"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/types.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package upgrades

import (
"github.com/atomone-hub/govgen/v1/app/keepers"

store "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/atomone-hub/govgen/v1/app/keepers"
)

// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal
Expand Down
3 changes: 2 additions & 1 deletion cmd/govgend/cmd/bech32_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package cmd
import (
"fmt"

addressutil "github.com/atomone-hub/govgen/v1/pkg/address"
"github.com/spf13/cobra"

addressutil "github.com/atomone-hub/govgen/v1/pkg/address"
)

var flagBech32Prefix = "prefix"
Expand Down
5 changes: 3 additions & 2 deletions cmd/govgend/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
"os"
"path/filepath"

govgen "github.com/atomone-hub/govgen/v1/app"
"github.com/atomone-hub/govgen/v1/app/params"
"github.com/spf13/cast"
"github.com/spf13/cobra"
tmcli "github.com/tendermint/tendermint/libs/cli"
Expand All @@ -32,6 +30,9 @@ 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"

govgen "github.com/atomone-hub/govgen/v1/app"
"github.com/atomone-hub/govgen/v1/app/params"
)

// NewRootCmd creates a new root command for simd. It is called once in the
Expand Down
5 changes: 3 additions & 2 deletions cmd/govgend/cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package cmd_test
import (
"testing"

app "github.com/atomone-hub/govgen/v1/app"
"github.com/atomone-hub/govgen/v1/cmd/govgend/cmd"
"github.com/stretchr/testify/require"

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

app "github.com/atomone-hub/govgen/v1/app"
"github.com/atomone-hub/govgen/v1/cmd/govgend/cmd"
)

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

app "github.com/atomone-hub/govgen/v1/app"
"github.com/atomone-hub/govgen/v1/cmd/govgend/cmd"

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

app "github.com/atomone-hub/govgen/v1/app"
"github.com/atomone-hub/govgen/v1/cmd/govgend/cmd"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions x/gov/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"fmt"
"time"

"github.com/atomone-hub/govgen/v1/x/gov/keeper"
"github.com/atomone-hub/govgen/v1/x/gov/types"

"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/atomone-hub/govgen/v1/x/gov/keeper"
"github.com/atomone-hub/govgen/v1/x/gov/types"
)

// EndBlocker called every block, process inflation, update validator set.
Expand Down
7 changes: 4 additions & 3 deletions x/gov/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ import (
"testing"
"time"

govgenhelpers "github.com/atomone-hub/govgen/v1/app/helpers"
"github.com/atomone-hub/govgen/v1/x/gov"
"github.com/atomone-hub/govgen/v1/x/gov/types"
"github.com/golang/protobuf/proto" //nolint:staticcheck
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/staking"

govgenhelpers "github.com/atomone-hub/govgen/v1/app/helpers"
"github.com/atomone-hub/govgen/v1/x/gov"
"github.com/atomone-hub/govgen/v1/x/gov/types"
)

func TestTickExpiredDepositPeriod(t *testing.T) {
Expand Down
Loading

0 comments on commit 86e32fb

Please sign in to comment.