Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
tbruyelle committed Aug 23, 2024
1 parent ca0724f commit 0412468
Show file tree
Hide file tree
Showing 21 changed files with 67 additions and 80 deletions.
33 changes: 3 additions & 30 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
run:
tests: true
tests: false
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 5m
skip-dirs:
- tests/

linters:
disable-all: true
Expand All @@ -20,7 +22,6 @@ linters:
- misspell
- nakedret
- nolintlint
- revive
- staticcheck
- stylecheck
- typecheck
Expand Down Expand Up @@ -79,31 +80,3 @@ linters-settings:
allow-leading-space: true
require-explanation: false
require-specific: false
revive:
ignore-generated-header: true
severity: warning
rules:
- name: unused-parameter
disabled: true
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
- name: if-return
- name: increment-decrement
- name: var-naming
- name: var-declaration
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
- name: empty-block
- name: superfluous-else
- name: unreachable-code
- name: redefines-builtin-id
4 changes: 2 additions & 2 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (

"github.com/cometbft/cometbft/libs/log"

govkeeper "github.com/atomone-hub/atomone/x/gov/keeper"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
Expand Down Expand Up @@ -49,6 +47,8 @@ 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/atomone/x/gov/keeper"
)

type AppKeepers struct {
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (

tmrand "github.com/cometbft/cometbft/libs/rand"

atomoneparams "github.com/atomone-hub/atomone/app/params"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
Expand All @@ -22,6 +20,8 @@ import (
paramsproptypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

atomoneparams "github.com/atomone-hub/atomone/app/params"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions x/gov/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"fmt"
"time"

"github.com/atomone-hub/atomone/x/gov/keeper"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"

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

// 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 @@ -6,12 +6,10 @@ import (

"github.com/stretchr/testify/require"

"cosmossdk.io/math"
abci "github.com/cometbft/cometbft/abci/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"

"github.com/atomone-hub/atomone/x/gov"
"github.com/atomone-hub/atomone/x/gov/keeper"
"cosmossdk.io/math"

simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -22,6 +20,9 @@ import (
"github.com/cosmos/cosmos-sdk/x/staking"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

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

func TestTickExpiredDepositPeriod(t *testing.T) {
Expand Down
15 changes: 9 additions & 6 deletions x/gov/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,32 @@ import (
"sort"
"testing"

"github.com/atomone-hub/atomone/x/gov/keeper"
"github.com/stretchr/testify/require"

_ "github.com/cosmos/cosmos-sdk/x/auth"
_ "github.com/cosmos/cosmos-sdk/x/bank"
_ "github.com/cosmos/cosmos-sdk/x/consensus"
_ "github.com/cosmos/cosmos-sdk/x/params"
_ "github.com/cosmos/cosmos-sdk/x/staking"

"cosmossdk.io/math"

"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/testutil/configurator"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/cosmos-sdk/x/auth"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
_ "github.com/cosmos/cosmos-sdk/x/bank"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
_ "github.com/cosmos/cosmos-sdk/x/consensus"
"github.com/cosmos/cosmos-sdk/x/gov/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
_ "github.com/cosmos/cosmos-sdk/x/params"
_ "github.com/cosmos/cosmos-sdk/x/staking"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

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

var (
Expand Down
8 changes: 5 additions & 3 deletions x/gov/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ package gov
import (
"fmt"

"github.com/atomone-hub/atomone/x/gov/keeper"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"

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

// InitGenesis - store genesis parameters
func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper, data *v1.GenesisState) {
k.SetProposalID(ctx, data.StartingProposalId)
k.SetParams(ctx, *data.Params)
if err := k.SetParams(ctx, *data.Params); err != nil {
panic(fmt.Sprintf("%s module params has not been set", types.ModuleName))
}

// check if the deposits pool account exists
moduleAcc := k.GetGovernanceAccount(ctx)
Expand Down
4 changes: 2 additions & 2 deletions x/gov/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (

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

"github.com/atomone-hub/atomone/x/gov"

sdk "github.com/cosmos/cosmos-sdk/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"

"github.com/atomone-hub/atomone/x/gov"
)

func TestImportExportQueues_ErrorUnconsistentState(t *testing.T) {
Expand Down
7 changes: 4 additions & 3 deletions x/gov/keeper/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import (

"github.com/golang/mock/gomock"

"cosmossdk.io/math"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
tmtime "github.com/cometbft/cometbft/types/time"

"github.com/atomone-hub/atomone/x/gov/keeper"
govtestutil "github.com/atomone-hub/atomone/x/gov/testutil"
"cosmossdk.io/math"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/testutil"
Expand All @@ -24,6 +22,9 @@ import (
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"

"github.com/atomone-hub/atomone/x/gov/keeper"
govtestutil "github.com/atomone-hub/atomone/x/gov/testutil"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion x/gov/keeper/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package keeper
import (
"fmt"

sdkerrors "cosmossdk.io/errors"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/gov/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
)
Expand Down
6 changes: 3 additions & 3 deletions x/gov/keeper/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import (

"github.com/stretchr/testify/require"

"github.com/atomone-hub/atomone/x/gov"
"github.com/atomone-hub/atomone/x/gov/keeper"

simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"

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

var _ types.GovHooks = &MockGovHooksReceiver{}
Expand Down
6 changes: 3 additions & 3 deletions x/gov/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"

"github.com/atomone-hub/atomone/x/gov/keeper"
govtestutil "github.com/atomone-hub/atomone/x/gov/testutil"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
Expand All @@ -17,6 +14,9 @@ import (
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"

"github.com/atomone-hub/atomone/x/gov/keeper"
govtestutil "github.com/atomone-hub/atomone/x/gov/testutil"
)

type KeeperTestSuite struct {
Expand Down
1 change: 1 addition & 0 deletions x/gov/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

"cosmossdk.io/errors"

sdk "github.com/cosmos/cosmos-sdk/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
Expand Down
3 changes: 2 additions & 1 deletion x/gov/keeper/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"errors"
"fmt"

sdkerrors "cosmossdk.io/errors"

"github.com/cosmos/cosmos-sdk/client"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/gov/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
)
Expand Down
1 change: 1 addition & 0 deletions x/gov/keeper/tally.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package keeper

import (
"cosmossdk.io/math"

sdk "github.com/cosmos/cosmos-sdk/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
Expand Down
3 changes: 2 additions & 1 deletion x/gov/keeper/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package keeper
import (
"fmt"

sdkerrors "cosmossdk.io/errors"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/gov/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
)
Expand Down
6 changes: 3 additions & 3 deletions x/gov/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/depinject"

"github.com/atomone-hub/atomone/x/gov/keeper"
"github.com/atomone-hub/atomone/x/gov/simulation"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
Expand All @@ -37,6 +34,9 @@ import (
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"

"github.com/atomone-hub/atomone/x/gov/keeper"
"github.com/atomone-hub/atomone/x/gov/simulation"
)

const ConsensusVersion = 4
Expand Down
5 changes: 3 additions & 2 deletions x/gov/simulation/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ import (

"github.com/stretchr/testify/require"

"github.com/atomone-hub/atomone/x/gov/simulation"

sdkmath "cosmossdk.io/math"

"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/gov/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"

"github.com/atomone-hub/atomone/x/gov/simulation"
)

// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState.
Expand Down
4 changes: 2 additions & 2 deletions x/gov/simulation/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"math/rand"
"time"

"github.com/atomone-hub/atomone/x/gov/keeper"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
Expand All @@ -16,6 +14,8 @@ import (
"github.com/cosmos/cosmos-sdk/x/gov/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
"github.com/cosmos/cosmos-sdk/x/simulation"

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

var initialProposalID = uint64(100000000000000)
Expand Down
Loading

0 comments on commit 0412468

Please sign in to comment.