ci: Fix linter complaint (backport #9645) (#9647)

* ci: Fix linter complaint (#9645)

Fixes a very silly linter complaint that makes absolutely no sense and is blocking the merging of several PRs.

---

#### PR checklist

- [x] Tests written/updated, or no tests needed
- [x] `CHANGELOG_PENDING.md` updated, or no changelog entry needed
- [x] Updated relevant documentation (`docs/`) and code comments, or no
      documentation updates needed

(cherry picked from commit 83b7f4ad5b)

# Conflicts:
#	.github/workflows/lint.yml
#	.golangci.yml
#	cmd/tendermint/commands/debug/util.go

* Resolve conflicts

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* ci: Sync golangci-lint config with main

Minus the spelling configuration that restricts spelling to US English
only.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* make format

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove usage of deprecated io/ioutil package

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove unused mockBlockStore

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockchain/v2: Remove unused method

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Bulk fix lints

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* lint: Ignore auto-generated query PEG

Signed-off-by: Thane Thomson <connect@thanethomson.com>

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
mergify[bot]
2022-10-29 08:58:18 -04:00
committed by GitHub
parent a6dd0d270a
commit e914fe40ec
93 changed files with 425 additions and 476 deletions

View File

@@ -23,7 +23,7 @@ type EventBusSubscriber interface {
type Subscription interface {
Out() <-chan tmpubsub.Message
Cancelled() <-chan struct{} //nolint: misspell
Cancelled() <-chan struct{}
Err() error
}

View File

@@ -5,7 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"time"
"github.com/tendermint/tendermint/crypto"
@@ -52,7 +52,7 @@ func (genDoc *GenesisDoc) SaveAs(file string) error {
if err != nil {
return err
}
return tmos.WriteFile(file, genDocBytes, 0644)
return tmos.WriteFile(file, genDocBytes, 0o644)
}
// ValidatorHash returns the hash of the validator set contained in the GenesisDoc
@@ -126,7 +126,7 @@ func GenesisDocFromJSON(jsonBlob []byte) (*GenesisDoc, error) {
// GenesisDocFromFile reads JSON data from a file and unmarshalls it into a GenesisDoc.
func GenesisDocFromFile(genDocFile string) (*GenesisDoc, error) {
jsonBlob, err := ioutil.ReadFile(genDocFile)
jsonBlob, err := os.ReadFile(genDocFile)
if err != nil {
return nil, fmt.Errorf("couldn't read GenesisDoc file: %w", err)
}

View File

@@ -1,7 +1,6 @@
package types
import (
"io/ioutil"
"os"
"testing"
@@ -122,7 +121,7 @@ func TestGenesisGood(t *testing.T) {
}
func TestGenesisSaveAs(t *testing.T) {
tmpfile, err := ioutil.TempFile("", "genesis")
tmpfile, err := os.CreateTemp("", "genesis")
require.NoError(t, err)
defer os.Remove(tmpfile.Name())

View File

@@ -1,7 +1,7 @@
package types
import (
"io/ioutil"
"io"
"testing"
"github.com/stretchr/testify/assert"
@@ -57,7 +57,7 @@ func TestBasicPartSet(t *testing.T) {
// Reconstruct data, assert that they are equal.
data2Reader := partSet2.GetReader()
data2, err := ioutil.ReadAll(data2Reader)
data2, err := io.ReadAll(data2Reader)
require.NoError(t, err)
assert.Equal(t, data, data2)
@@ -145,8 +145,10 @@ func TestParSetHeaderProtoBuf(t *testing.T) {
expPass bool
}{
{"success empty", &PartSetHeader{}, true},
{"success",
&PartSetHeader{Total: 1, Hash: []byte("hash")}, true},
{
"success",
&PartSetHeader{Total: 1, Hash: []byte("hash")}, true,
},
}
for _, tc := range testCases {
@@ -162,7 +164,6 @@ func TestParSetHeaderProtoBuf(t *testing.T) {
}
func TestPartProtoBuf(t *testing.T) {
proof := merkle.Proof{
Total: 1,
Index: 1,
@@ -175,8 +176,10 @@ func TestPartProtoBuf(t *testing.T) {
}{
{"failure empty", &Part{}, false},
{"failure nil", nil, false},
{"success",
&Part{Index: 1, Bytes: tmrand.Bytes(32), Proof: proof}, true},
{
"success",
&Part{Index: 1, Bytes: tmrand.Bytes(32), Proof: proof}, true,
},
}
for _, tc := range testCases {