Skip to content

Commit 3fdc4e0

Browse files
committed
Fix lint issues
1 parent ec79d26 commit 3fdc4e0

File tree

8 files changed

+17
-12
lines changed

8 files changed

+17
-12
lines changed

.github/workflows/go.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
- name: Set up Go 1.x
1010
uses: actions/setup-go@v2
1111
with:
12-
go-version: ^1.15
12+
go-version: ^1.18
1313
id: go
1414

1515
- name: Check out code into the Go module directory

.golangci.yml

+7
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ issues:
5656
- text: "SA1019:"
5757
linters:
5858
- staticcheck
59+
- path: test/
60+
linters:
61+
- deadcode
62+
- unused
63+
- ineffassign
64+
- prealloc
65+
- staticcheck
5966
# Not a real issue here, so ignore
6067
- path: x/clp/keeper/pureCalculation_test.go
6168
text: "G113:"

x/clp/keeper/msg_server.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -785,9 +785,8 @@ func (k msgServer) RemoveLiquidityUnits(goCtx context.Context, msg *types.MsgRem
785785
Asymmetry: sdk.ZeroInt(),
786786
}, extRowanValue.Add(withdrawNativeAssetAmount))
787787
return nil, types.ErrQueued
788-
} else {
789-
return nil, types.ErrRemovalsBlockedByHealth
790788
}
789+
return nil, types.ErrRemovalsBlockedByHealth
791790
}
792791
}
793792

@@ -891,9 +890,8 @@ func (k msgServer) RemoveLiquidity(goCtx context.Context, msg *types.MsgRemoveLi
891890
if k.IsRemovalQueueEnabled(ctx) {
892891
k.QueueRemoval(ctx, msg, extRowanValue.Add(withdrawExternalAssetAmount))
893892
return nil, types.ErrQueued
894-
} else {
895-
return nil, types.ErrRemovalsBlockedByHealth
896893
}
894+
return nil, types.ErrRemovalsBlockedByHealth
897895
}
898896
}
899897

x/margin/client/rest/tx.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type (
4141
CloseReq struct {
4242
BaseReq rest.BaseReq `json:"base_req"`
4343
Signer string `json:"signer"` // User who is trying to close margin position
44-
// nolint:golint
44+
// nolint:revive
4545
Id uint64 `json:"id"` // Id of the mtp
4646

4747
}
@@ -50,7 +50,7 @@ type (
5050
BaseReq rest.BaseReq `json:"base_req"`
5151
Signer string `json:"signer"` // User who is trying to close margin position
5252
MtpAddress string `json:"mtp_address"` // MtpAddress for position to force close
53-
// nolint:golint
53+
// nolint:revive
5454
Id uint64 `json:"id"` // Id of the mtp
5555

5656
}

x/margin/keeper/admin_msg_server_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func TestMsgServer_AdminCloseAll(t *testing.T) {
179179
return genesisState
180180
})
181181
i, _ := sdk.NewIntFromString("10000000000000000000000")
182-
app.BankKeeper.MintCoins(ctx, clptypes.ModuleName, sdk.NewCoins(sdk.NewCoin("rowan", i)))
182+
_ = app.BankKeeper.MintCoins(ctx, clptypes.ModuleName, sdk.NewCoins(sdk.NewCoin("rowan", i)))
183183
marginKeeper := app.MarginKeeper
184184
msgServer := keeper.NewMsgServerImpl(marginKeeper)
185185

x/margin/keeper/keeper.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ func (k Keeper) TakeOutCustody(ctx sdk.Context, mtp types.MTP, pool *clptypes.Po
358358
}
359359

360360
func (k Keeper) Repay(ctx sdk.Context, mtp *types.MTP, pool *clptypes.Pool, repayAmount sdk.Uint, takeInsurance bool) error {
361-
// nolint:ineffassign
361+
// nolint:staticcheck,ineffassign
362362
returnAmount, debtP, debtI := sdk.ZeroUint(), sdk.ZeroUint(), sdk.ZeroUint()
363363
Liabilities := mtp.Liabilities
364364
InterestUnpaidCollateral := mtp.InterestUnpaidCollateral

x/margin/keeper/msg_server_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ func TestKeeper_Close(t *testing.T) {
400400
require.NoError(t, err)
401401

402402
nativeCoin = sdk.NewCoin(nativeAsset, sdk.Int(sdk.NewUint(10000)))
403-
// nolint:ineffassign
403+
// nolint:staticcheck,ineffassign
404404
externalCoin = sdk.NewCoin(externalAsset.Symbol, sdk.Int(sdk.NewUint(10000)))
405405

406406
_signer := clptest.GenerateAddress(clptest.AddressKey1)

x/margin/types/params.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ func ParamKeyTable() paramtypes.KeyTable {
1717
return paramtypes.NewKeyTable().RegisterParamSet(&Params{})
1818
}
1919

20-
func validate(i interface{}) error {
20+
/* func validate(i interface{}) error {
2121
return nil
22-
}
22+
} */

0 commit comments

Comments
 (0)