mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-18 22:14:35 +00:00
chore: Format and fix lints (#9336)
* make format Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix linting directives Signed-off-by: Thane Thomson <connect@thanethomson.com> * make mockery Signed-off-by: Thane Thomson <connect@thanethomson.com> * Appease CI linter Signed-off-by: Thane Thomson <connect@thanethomson.com> * Appease CI linter Signed-off-by: Thane Thomson <connect@thanethomson.com> Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
@@ -5,8 +5,8 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
@@ -234,7 +234,7 @@ func getRandomValidatorIndex(privVals []types.MockPV, vals *types.ValidatorSet)
|
||||
}
|
||||
|
||||
func readPrivKey(keyFilePath string) (crypto.PrivKey, error) {
|
||||
keyJSONBytes, err := ioutil.ReadFile(keyFilePath)
|
||||
keyJSONBytes, err := os.ReadFile(keyFilePath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
//nolint: gosec
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -10,7 +9,7 @@ import (
|
||||
|
||||
// execute executes a shell command.
|
||||
func exec(args ...string) error {
|
||||
cmd := osexec.Command(args[0], args[1:]...)
|
||||
cmd := osexec.Command(args[0], args[1:]...) //nolint:gosec
|
||||
out, err := cmd.CombinedOutput()
|
||||
switch err := err.(type) {
|
||||
case nil:
|
||||
@@ -24,7 +23,7 @@ func exec(args ...string) error {
|
||||
|
||||
// execVerbose executes a shell command while displaying its output.
|
||||
func execVerbose(args ...string) error {
|
||||
cmd := osexec.Command(args[0], args[1:]...)
|
||||
cmd := osexec.Command(args[0], args[1:]...) //nolint:gosec
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
return cmd.Run()
|
||||
|
||||
@@ -57,7 +57,7 @@ func NewCLI() *CLI {
|
||||
return err
|
||||
}
|
||||
|
||||
r := rand.New(rand.NewSource(randomSeed)) // nolint: gosec
|
||||
r := rand.New(rand.NewSource(randomSeed)) //nolint: gosec
|
||||
|
||||
chLoadResult := make(chan error)
|
||||
ctx, loadCancel := context.WithCancel(context.Background())
|
||||
@@ -203,7 +203,7 @@ func NewCLI() *CLI {
|
||||
|
||||
return InjectEvidence(
|
||||
cmd.Context(),
|
||||
rand.New(rand.NewSource(randomSeed)), // nolint: gosec
|
||||
rand.New(rand.NewSource(randomSeed)), //nolint: gosec
|
||||
cli.testnet,
|
||||
amount,
|
||||
)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// nolint: gosec
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -52,7 +51,7 @@ func Setup(testnet *e2e.Testnet) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.WriteFile(filepath.Join(testnet.Dir, "docker-compose.yml"), compose, 0644)
|
||||
err = os.WriteFile(filepath.Join(testnet.Dir, "docker-compose.yml"), compose, 0o644) //nolint:gosec
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -75,7 +74,7 @@ func Setup(testnet *e2e.Testnet) error {
|
||||
if node.Mode == e2e.ModeLight && strings.Contains(dir, "app") {
|
||||
continue
|
||||
}
|
||||
err := os.MkdirAll(dir, 0755)
|
||||
err := os.MkdirAll(dir, 0o755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -91,7 +90,7 @@ func Setup(testnet *e2e.Testnet) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.WriteFile(filepath.Join(nodeDir, "config", "app.toml"), appCfg, 0644)
|
||||
err = os.WriteFile(filepath.Join(nodeDir, "config", "app.toml"), appCfg, 0o644) //nolint:gosec
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -400,5 +399,5 @@ func UpdateConfigStateSync(node *e2e.Node, height int64, hash []byte) error {
|
||||
}
|
||||
bz = regexp.MustCompile(`(?m)^trust_height =.*`).ReplaceAll(bz, []byte(fmt.Sprintf(`trust_height = %v`, height)))
|
||||
bz = regexp.MustCompile(`(?m)^trust_hash =.*`).ReplaceAll(bz, []byte(fmt.Sprintf(`trust_hash = "%X"`, hash)))
|
||||
return os.WriteFile(cfgPath, bz, 0644)
|
||||
return os.WriteFile(cfgPath, bz, 0o644) //nolint:gosec
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user