Skip to content

Commit

Permalink
style: replace deprecated linters with new ones (#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkxkd0159 authored May 9, 2024
1 parent df3e353 commit bfdd0ab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
15 changes: 2 additions & 13 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@
linters:
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- errcheck
- goconst
- gocritic
- gofmt
- goimports
- golint
- gosec
- gosimple
- govet
- ineffassign
- misspell
- maligned
- nakedret
- prealloc
- scopelint
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
- gocyclo
- whitespace
- dupl
- revive
- exportloopref

issues:
exclude-rules:
Expand All @@ -40,9 +35,6 @@ linters-settings:
dogsled:
# checks assignments with too many blank identifiers; default is 2
max-blank-identifiers: 7
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
errcheck:
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
Expand All @@ -51,9 +43,6 @@ linters-settings:
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: true
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0
prealloc:
# XXX: we don't recommend using this linter before doing performance profiling.
# For most programs usage of prealloc will be a premature optimization.
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Build, CI
* (build) [\#340](https://github.com/Finschia/finschia/pull/340) Set Finschia/ostracon version
* (ci) [\#361](https://github.com/Finschia/finschia/pull/361) Replace deprecated linters with new ones

### Docs

Expand Down
2 changes: 1 addition & 1 deletion app/helpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var DefaultConsensusParams = &abci.ConsensusParams{

type EmptyAppOptions struct{}

func (EmptyAppOptions) Get(o string) interface{} { return nil }
func (EmptyAppOptions) Get(_ string) interface{} { return nil }

func Setup(t *testing.T, isCheckTx bool, invCheckPeriod uint) *linkapp.LinkApp {
t.Helper()
Expand Down
12 changes: 6 additions & 6 deletions cli_test/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,14 @@ func (f *Fixtures) KeysAdd(name string, flags ...string) {
}

// KeysAddRecover prepares fnsad keys add --recover
func (f *Fixtures) KeysAddRecover(name, mnemonic string, flags ...string) (testutil.BufferWriter, error) {
func (f *Fixtures) KeysAddRecover(name, _ string, flags ...string) (testutil.BufferWriter, error) {
args := fmt.Sprintf("add --keyring-backend=test --recover %s", name)
cmd := clientkeys.Commands(f.Home)
return testcli.ExecTestCLICmd(getCliCtx(f), cmd, addFlags(args, flags...))
}

// KeysAddRecoverHDPath prepares fnsad keys add --recover --account --index
func (f *Fixtures) KeysAddRecoverHDPath(name, mnemonic string, account uint32, index uint32, flags ...string) {
func (f *Fixtures) KeysAddRecoverHDPath(name, _ string, account uint32, index uint32, flags ...string) {
args := fmt.Sprintf("add --keyring-backend=test --recover %s --account=%d --index=%d", name, account, index)
cmd := clientkeys.Commands(f.Home)
_, err := testcli.ExecTestCLICmd(getCliCtx(f), cmd, addFlags(args, flags...))
Expand Down Expand Up @@ -588,7 +588,7 @@ func (f *Fixtures) TxGovSubmitParamChangeProposal(
// TxGovSubmitCommunityPoolSpendProposal executes a CLI community pool spend proposal
// submission.
func (f *Fixtures) TxGovSubmitCommunityPoolSpendProposal(
from, proposalPath string, deposit sdk.Coin, flags ...string,
from, proposalPath string, _ sdk.Coin, flags ...string,
) (testutil.BufferWriter, error) {
args := fmt.Sprintf("%s --keyring-backend=test --from=%s --node=%s", proposalPath, from, f.RPCAddr)
cmd := govcli.NewCmdSubmitProposal()
Expand Down Expand Up @@ -1048,7 +1048,7 @@ func (f *Fixtures) QueryTotalSupplyOf(denom string, flags ...string) sdk.Coin {

// ___________________________________________________________________________________
// tendermint rpc
func (f *Fixtures) NetInfo(flags ...string) *ostctypes.ResultNetInfo {
func (f *Fixtures) NetInfo(_ ...string) *ostctypes.ResultNetInfo {
ostc, err := osthttp.New(fmt.Sprintf("tcp://0.0.0.0:%s", f.Port), "/websocket")
if err != nil {
panic(fmt.Sprintf("failed to create Tendermint HTTP client: %s", err))
Expand Down Expand Up @@ -1088,7 +1088,7 @@ func (f *Fixtures) Status() *ostctypes.ResultStatus {
// linkcli mempool

// MempoolNumUnconfirmedTxs is linkcli mempool num-unconfirmed-txs
func (f *Fixtures) MempoolNumUnconfirmedTxs(flags ...string) *ostctypes.ResultUnconfirmedTxs {
func (f *Fixtures) MempoolNumUnconfirmedTxs(_ ...string) *ostctypes.ResultUnconfirmedTxs {
ostc, err := osthttp.New(fmt.Sprintf("tcp://0.0.0.0:%s", f.Port), "/websocket")
if err != nil {
panic(fmt.Sprintf("failed to create Tendermint HTTP client: %s", err))
Expand Down Expand Up @@ -1186,7 +1186,7 @@ func (fg *FixtureGroup) initNodes(numberOfNodes int) {
require.NoError(t, err)
}
}
func (fg *FixtureGroup) FinschiaStartCluster(minGasPrices string, flags ...string) {
func (fg *FixtureGroup) FinschiaStartCluster(minGasPrices string, _ ...string) {
genDoc, err := osttypes.GenesisDocFromJSON(fg.genesisFileContent)
require.NoError(fg.T, err)

Expand Down

0 comments on commit bfdd0ab

Please sign in to comment.