chore: fix all linting (#24101)

This commit is contained in:
Alex | Interchain Labs
2025-03-21 15:04:36 -07:00
committed by GitHub
parent b7fb7f4858
commit 7fd79df4e1
329 changed files with 1282 additions and 1251 deletions
-1
View File
@@ -71,7 +71,6 @@ func TestAminoCodecMarshalJSONIndent(t *testing.T) {
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
cdc := codec.NewAminoCodec(createTestCodec())
bz, err := cdc.MarshalJSONIndent(tc.input, "", " ")
+5 -3
View File
@@ -92,7 +92,9 @@ func testMarshaling(t *testing.T, cdc interface {
codec.JSONCodec
},
) {
any, err := types.NewAnyWithValue(&testdata.Dog{Name: "rufus"})
t.Helper()
cdcAny, err := types.NewAnyWithValue(&testdata.Dog{Name: "rufus"})
require.NoError(t, err)
testCases := []testCase{
@@ -113,8 +115,8 @@ func testMarshaling(t *testing.T, cdc interface {
if _, ok := cdc.(*codec.AminoCodec); ok {
testCases = append(testCases, testCase{
"any marshaling",
&testdata.HasAnimal{Animal: any},
&testdata.HasAnimal{Animal: any},
&testdata.HasAnimal{Animal: cdcAny},
&testdata.HasAnimal{Animal: cdcAny},
false,
false,
})
-1
View File
@@ -11,7 +11,6 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
// nolint:revive // XXX is reqired for proto compatibility
type Any struct {
// A URL/resource name that uniquely identifies the type of the serialized
// protocol buffer message. This string must contain at least
+1 -1
View File
@@ -17,7 +17,7 @@ func (d Dog) Greet() string { return d.Name }
func (d *Dog) Reset() { d.Name = "" }
func (d *Dog) String() string { return d.Name }
func (d *Dog) ProtoMessage() {}
func (d *Dog) XXX_MessageName() string { return "tests/dog" } //nolint:revive // XXX_ prefix is required
func (d *Dog) XXX_MessageName() string { return "tests/dog" }
type Animal interface {
Greet() string
+1 -1
View File
@@ -19,7 +19,7 @@ var _ proto.Message = (*errOnMarshal)(nil)
var errAlways = fmt.Errorf("always erroring")
func (eom *errOnMarshal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { //nolint:revive // XXX_ prefix is intentional
func (eom *errOnMarshal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return nil, errAlways
}
+1 -1
View File
@@ -44,7 +44,7 @@ var (
func (dog FakeDog) Reset() {}
func (dog FakeDog) String() string { return "fakedog" }
func (dog FakeDog) ProtoMessage() {}
func (dog FakeDog) XXX_MessageName() string { return proto.MessageName(&testdata.Dog{}) } //nolint:revive // XXX_ prefix is intentional
func (dog FakeDog) XXX_MessageName() string { return proto.MessageName(&testdata.Dog{}) }
func (dog FakeDog) Greet() string { return "fakedog" }
func TestRegister(t *testing.T) {
+2
View File
@@ -51,6 +51,7 @@ func BenchmarkRejectUnknownFields_parallel(b *testing.B) {
}
func benchmarkRejectUnknownFields(b *testing.B, parallel bool) {
b.Helper()
b.ReportAllocs()
if !parallel {
@@ -89,6 +90,7 @@ func BenchmarkProtoUnmarshal_parallel(b *testing.B) {
}
func benchmarkProtoUnmarshal(b *testing.B, parallel bool) {
b.Helper()
b.ReportAllocs()
if !parallel {
-1
View File
@@ -22,7 +22,6 @@ func TestWireTypeToString(t *testing.T) {
}
for _, tt := range tests {
tt := tt
t.Run(fmt.Sprintf("wireType=%d", tt.typ), func(t *testing.T) {
if g, w := wireTypeToString(tt.typ), tt.want; g != w {
t.Fatalf("Mismatch:\nGot: %q\nWant: %q\n", g, w)
@@ -223,7 +223,6 @@ func TestRejectUnknownFieldsRepeated(t *testing.T) {
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
protoBlob, err := proto.Marshal(tt.in)
if err != nil {
@@ -280,7 +279,6 @@ func TestRejectUnknownFields_allowUnknownNonCriticals(t *testing.T) {
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
blob, err := proto.Marshal(tt.in)
if err != nil {
@@ -483,7 +481,6 @@ func TestRejectUnknownFieldsNested(t *testing.T) {
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
protoBlob, err := proto.Marshal(tt.in)
if err != nil {
@@ -634,7 +631,6 @@ func TestRejectUnknownFieldsFlat(t *testing.T) {
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
blob, err := proto.Marshal(tt.in)
if err != nil {