Skip to content

Commit e5ec801

Browse files
authored
fix: make format and golangci-lint errors (cosmos#1894)
* removing gofmt from golangci.yml * attempt to fix gofmt interacer lint errors * updating makefile and running gofumpt * adding exception to makefile for misspell, fixing chanOpenConfirm godoc * removing unnecessary -s flag
1 parent 44541b8 commit e5ec801

File tree

16 files changed

+55
-39
lines changed

16 files changed

+55
-39
lines changed

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ linters:
1313
- errcheck
1414
- goconst
1515
- gocritic
16-
- gofmt
1716
- gofumpt
1817
- goimports
1918
- gosec

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ lint-fix:
338338
.PHONY: lint lint-fix
339339

340340
format: goimports
341-
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' | xargs gofmt -w -s
342-
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' | xargs misspell -w
341+
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' -not -name '*.pb.gw.go' | xargs gofumpt -w
342+
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' -not -name '*.pb.gw.go' | xargs misspell -w
343343
.PHONY: format
344344

345345
goimports:

e2e/testsuite/testsuite.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"fmt"
66
"io/ioutil"
7-
87
"strings"
98
"time"
109

modules/apps/transfer/types/msgs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const (
1616
)
1717

1818
// NewMsgTransfer creates a new MsgTransfer instance
19+
//
1920
//nolint:interfacer
2021
func NewMsgTransfer(
2122
sourcePort, sourceChannel string,

modules/apps/transfer/types/trace.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ func (t Traces) Sort() Traces {
178178
// ValidatePrefixedDenom checks that the denomination for an IBC fungible token packet denom is correctly prefixed.
179179
// The function will return no error if the given string follows one of the two formats:
180180
//
181-
// - Prefixed denomination: '{portIDN}/{channelIDN}/.../{portID0}/{channelID0}/baseDenom'
182-
// - Unprefixed denomination: 'baseDenom'
181+
// - Prefixed denomination: '{portIDN}/{channelIDN}/.../{portID0}/{channelID0}/baseDenom'
182+
// - Unprefixed denomination: 'baseDenom'
183183
//
184184
// 'baseDenom' may or may not contain '/'s
185185
func ValidatePrefixedDenom(denom string) error {
@@ -205,8 +205,8 @@ func ValidatePrefixedDenom(denom string) error {
205205

206206
// ValidateIBCDenom validates that the given denomination is either:
207207
//
208-
// - A valid base denomination (eg: 'uatom' or 'gamm/pool/1' as in https://github.com/cosmos/ibc-go/issues/894)
209-
// - A valid fungible token representation (i.e 'ibc/{hash}') per ADR 001 https://github.com/cosmos/ibc-go/blob/main/docs/architecture/adr-001-coin-source-tracing.md
208+
// - A valid base denomination (eg: 'uatom' or 'gamm/pool/1' as in https://github.com/cosmos/ibc-go/issues/894)
209+
// - A valid fungible token representation (i.e 'ibc/{hash}') per ADR 001 https://github.com/cosmos/ibc-go/blob/main/docs/architecture/adr-001-coin-source-tracing.md
210210
func ValidateIBCDenom(denom string) error {
211211
if err := sdk.ValidateDenom(denom); err != nil {
212212
return err

modules/core/02-client/types/msgs.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ var (
3030
)
3131

3232
// NewMsgCreateClient creates a new MsgCreateClient instance
33+
//
3334
//nolint:interfacer
3435
func NewMsgCreateClient(
3536
clientState exported.ClientState, consensusState exported.ConsensusState, signer string,
@@ -102,6 +103,7 @@ func (msg MsgCreateClient) UnpackInterfaces(unpacker codectypes.AnyUnpacker) err
102103
}
103104

104105
// NewMsgUpdateClient creates a new MsgUpdateClient instance
106+
//
105107
//nolint:interfacer
106108
func NewMsgUpdateClient(id string, header exported.Header, signer string) (*MsgUpdateClient, error) {
107109
anyHeader, err := PackHeader(header)
@@ -151,7 +153,8 @@ func (msg MsgUpdateClient) UnpackInterfaces(unpacker codectypes.AnyUnpacker) err
151153
}
152154

153155
// NewMsgUpgradeClient creates a new MsgUpgradeClient instance
154-
// nolint: interfacer
156+
//
157+
//nolint:interfacer
155158
func NewMsgUpgradeClient(clientID string, clientState exported.ClientState, consState exported.ConsensusState,
156159
proofUpgradeClient, proofUpgradeConsState []byte, signer string,
157160
) (*MsgUpgradeClient, error) {
@@ -228,6 +231,7 @@ func (msg MsgUpgradeClient) UnpackInterfaces(unpacker codectypes.AnyUnpacker) er
228231
}
229232

230233
// NewMsgSubmitMisbehaviour creates a new MsgSubmitMisbehaviour instance.
234+
//
231235
//nolint:interfacer
232236
func NewMsgSubmitMisbehaviour(clientID string, misbehaviour exported.Misbehaviour, signer string) (*MsgSubmitMisbehaviour, error) {
233237
anyMisbehaviour, err := PackMisbehaviour(misbehaviour)

modules/core/03-connection/keeper/handshake.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ func (k Keeper) ConnOpenInit(
5656
// code is executed on chain B).
5757
//
5858
// NOTE:
59-
// - Here chain A acts as the counterparty
60-
// - Identifiers are checked on msg validation
59+
// - Here chain A acts as the counterparty
60+
// - Identifiers are checked on msg validation
6161
func (k Keeper) ConnOpenTry(
6262
ctx sdk.Context,
6363
counterparty types.Counterparty, // counterpartyConnectionIdentifier, counterpartyPrefix and counterpartyClientIdentifier

modules/core/03-connection/types/msgs.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ var (
2323

2424
// NewMsgConnectionOpenInit creates a new MsgConnectionOpenInit instance. It sets the
2525
// counterparty connection identifier to be empty.
26+
//
2627
//nolint:interfacer
2728
func NewMsgConnectionOpenInit(
2829
clientID, counterpartyClientID string,
@@ -72,6 +73,7 @@ func (msg MsgConnectionOpenInit) GetSigners() []sdk.AccAddress {
7273
}
7374

7475
// NewMsgConnectionOpenTry creates a new MsgConnectionOpenTry instance
76+
//
7577
//nolint:interfacer
7678
func NewMsgConnectionOpenTry(
7779
clientID, counterpartyConnectionID, counterpartyClientID string,
@@ -165,6 +167,7 @@ func (msg MsgConnectionOpenTry) GetSigners() []sdk.AccAddress {
165167
}
166168

167169
// NewMsgConnectionOpenAck creates a new MsgConnectionOpenAck instance
170+
//
168171
//nolint:interfacer
169172
func NewMsgConnectionOpenAck(
170173
connectionID, counterpartyConnectionID string, counterpartyClient exported.ClientState,
@@ -246,6 +249,7 @@ func (msg MsgConnectionOpenAck) GetSigners() []sdk.AccAddress {
246249
}
247250

248251
// NewMsgConnectionOpenConfirm creates a new MsgConnectionOpenConfirm instance
252+
//
249253
//nolint:interfacer
250254
func NewMsgConnectionOpenConfirm(
251255
connectionID string, proofAck []byte, proofHeight clienttypes.Height,

modules/core/04-channel/keeper/handshake.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ func (k Keeper) WriteOpenAckChannel(
291291
}
292292

293293
// ChanOpenConfirm is called by the counterparty module to close their end of the
294-
// channel, since the other end has been closed.
294+
// channel, since the other end has been closed.
295295
func (k Keeper) ChanOpenConfirm(
296296
ctx sdk.Context,
297297
portID,

modules/core/04-channel/types/msgs.go

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ var _ sdk.Msg = &MsgChannelOpenInit{}
1515

1616
// NewMsgChannelOpenInit creates a new MsgChannelOpenInit. It sets the counterparty channel
1717
// identifier to be empty.
18-
// nolint:interfacer
18+
//
19+
//nolint:interfacer
1920
func NewMsgChannelOpenInit(
2021
portID, version string, channelOrder Order, connectionHops []string,
2122
counterpartyPortID string, signer string,
@@ -64,7 +65,8 @@ var _ sdk.Msg = &MsgChannelOpenTry{}
6465
// NewMsgChannelOpenTry creates a new MsgChannelOpenTry instance
6566
// The version string is deprecated and will be ignored by core IBC.
6667
// It is left as an argument for go API backwards compatibility.
67-
// nolint:interfacer
68+
//
69+
//nolint:interfacer
6870
func NewMsgChannelOpenTry(
6971
portID, version string, channelOrder Order, connectionHops []string,
7072
counterpartyPortID, counterpartyChannelID, counterpartyVersion string,
@@ -126,7 +128,8 @@ func (msg MsgChannelOpenTry) GetSigners() []sdk.AccAddress {
126128
var _ sdk.Msg = &MsgChannelOpenAck{}
127129

128130
// NewMsgChannelOpenAck creates a new MsgChannelOpenAck instance
129-
// nolint:interfacer
131+
//
132+
//nolint:interfacer
130133
func NewMsgChannelOpenAck(
131134
portID, channelID, counterpartyChannelID string, cpv string, proofTry []byte, proofHeight clienttypes.Height,
132135
signer string,
@@ -178,7 +181,8 @@ func (msg MsgChannelOpenAck) GetSigners() []sdk.AccAddress {
178181
var _ sdk.Msg = &MsgChannelOpenConfirm{}
179182

180183
// NewMsgChannelOpenConfirm creates a new MsgChannelOpenConfirm instance
181-
// nolint:interfacer
184+
//
185+
//nolint:interfacer
182186
func NewMsgChannelOpenConfirm(
183187
portID, channelID string, proofAck []byte, proofHeight clienttypes.Height,
184188
signer string,
@@ -225,7 +229,8 @@ func (msg MsgChannelOpenConfirm) GetSigners() []sdk.AccAddress {
225229
var _ sdk.Msg = &MsgChannelCloseInit{}
226230

227231
// NewMsgChannelCloseInit creates a new MsgChannelCloseInit instance
228-
// nolint:interfacer
232+
//
233+
//nolint:interfacer
229234
func NewMsgChannelCloseInit(
230235
portID string, channelID string, signer string,
231236
) *MsgChannelCloseInit {
@@ -263,7 +268,8 @@ func (msg MsgChannelCloseInit) GetSigners() []sdk.AccAddress {
263268
var _ sdk.Msg = &MsgChannelCloseConfirm{}
264269

265270
// NewMsgChannelCloseConfirm creates a new MsgChannelCloseConfirm instance
266-
// nolint:interfacer
271+
//
272+
//nolint:interfacer
267273
func NewMsgChannelCloseConfirm(
268274
portID, channelID string, proofInit []byte, proofHeight clienttypes.Height,
269275
signer string,
@@ -310,7 +316,8 @@ func (msg MsgChannelCloseConfirm) GetSigners() []sdk.AccAddress {
310316
var _ sdk.Msg = &MsgRecvPacket{}
311317

312318
// NewMsgRecvPacket constructs new MsgRecvPacket
313-
// nolint:interfacer
319+
//
320+
//nolint:interfacer
314321
func NewMsgRecvPacket(
315322
packet Packet, proofCommitment []byte, proofHeight clienttypes.Height,
316323
signer string,
@@ -357,7 +364,8 @@ func (msg MsgRecvPacket) GetSigners() []sdk.AccAddress {
357364
var _ sdk.Msg = &MsgTimeout{}
358365

359366
// NewMsgTimeout constructs new MsgTimeout
360-
// nolint:interfacer
367+
//
368+
//nolint:interfacer
361369
func NewMsgTimeout(
362370
packet Packet, nextSequenceRecv uint64, proofUnreceived []byte,
363371
proofHeight clienttypes.Height, signer string,
@@ -399,7 +407,8 @@ func (msg MsgTimeout) GetSigners() []sdk.AccAddress {
399407
}
400408

401409
// NewMsgTimeoutOnClose constructs new MsgTimeoutOnClose
402-
// nolint:interfacer
410+
//
411+
//nolint:interfacer
403412
func NewMsgTimeoutOnClose(
404413
packet Packet, nextSequenceRecv uint64,
405414
proofUnreceived, proofClose []byte,
@@ -448,7 +457,8 @@ func (msg MsgTimeoutOnClose) GetSigners() []sdk.AccAddress {
448457
var _ sdk.Msg = &MsgAcknowledgement{}
449458

450459
// NewMsgAcknowledgement constructs a new MsgAcknowledgement
451-
// nolint:interfacer
460+
//
461+
//nolint:interfacer
452462
func NewMsgAcknowledgement(
453463
packet Packet,
454464
ack, proofAcked []byte,

0 commit comments

Comments
 (0)