Skip to content

Commit da6e88d

Browse files
committed
various lint fixes
1 parent dace04c commit da6e88d

File tree

7 files changed

+31
-25
lines changed

7 files changed

+31
-25
lines changed

framework/cmd/blockscout.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package main
22

33
import (
44
"fmt"
5-
"github.com/smartcontractkit/chainlink-testing-framework/framework"
65
"os"
76
"path/filepath"
7+
8+
"github.com/smartcontractkit/chainlink-testing-framework/framework"
89
)
910

1011
func blockscoutUp(url string) error {
@@ -35,12 +36,11 @@ func blockscoutDown(url string) error {
3536
if err != nil {
3637
return err
3738
}
38-
err = runCommand("bash", "-c", fmt.Sprintf(`
39+
return runCommand("bash", "-c", fmt.Sprintf(`
3940
cd %s && \
4041
rm -rf blockscout-db-data && \
4142
rm -rf logs && \
4243
rm -rf redis-data && \
4344
rm -rf stats-db-data
4445
`, filepath.Join("blockscout", "services")))
45-
return nil
4646
}

framework/cmd/ci.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,15 @@ func AnalyzeJobsSteps(ctx context.Context, client GitHubActionsClient, cfg *Anal
178178
stats.Jobs[name].TotalDuration += dur
179179
}
180180
if j.RunAttempt != nil && *j.RunAttempt > 1 {
181-
stats.Jobs[name].ReRuns += 1
181+
stats.Jobs[name].ReRuns++
182182
}
183183
if j.Conclusion != nil && *j.Conclusion == "failure" {
184-
stats.Jobs[name].Failures += 1
184+
stats.Jobs[name].Failures++
185185
} else {
186-
stats.Jobs[name].Successes += 1
186+
stats.Jobs[name].Successes++
187187
}
188188
if j.Conclusion != nil && *j.Conclusion == "cancelled" {
189-
stats.Jobs[name].Cancels += 1
189+
stats.Jobs[name].Cancels++
190190
}
191191
// analyze steps
192192
for _, s := range j.Steps {
@@ -204,9 +204,9 @@ func AnalyzeJobsSteps(ctx context.Context, client GitHubActionsClient, cfg *Anal
204204
stats.Steps[name].Durations = append(stats.Steps[name].Durations, dur)
205205
}
206206
if *s.Conclusion == "failure" {
207-
stats.Steps[name].Failures += 1
207+
stats.Steps[name].Failures++
208208
} else {
209-
stats.Steps[name].Successes += 1
209+
stats.Steps[name].Successes++
210210
}
211211
}
212212
}

framework/cmd/docker.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ package main
22

33
import (
44
"fmt"
5-
"github.com/rs/zerolog"
6-
"github.com/smartcontractkit/chainlink-testing-framework/framework"
75
"os"
86
"os/exec"
7+
8+
"github.com/rs/zerolog"
9+
"github.com/smartcontractkit/chainlink-testing-framework/framework"
910
)
1011

1112
func removeTestContainers() error {

framework/cmd/interactive.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@ package main
22

33
import (
44
"fmt"
5+
"os"
6+
"os/signal"
7+
"sync"
8+
"syscall"
9+
510
"github.com/charmbracelet/huh"
611
"github.com/charmbracelet/huh/spinner"
712
"github.com/smartcontractkit/chainlink-testing-framework/framework"
813
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
914
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/clnode"
1015
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/postgres"
1116
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set"
12-
"os"
13-
"os/signal"
14-
"sync"
15-
"syscall"
1617
)
1718

1819
type nodeSetForm struct {
@@ -114,10 +115,8 @@ func cleanup(form *nodeSetForm) error {
114115

115116
func runSetupForm() error {
116117
if !framework.IsDockerRunning() {
117-
return fmt.Errorf(`Docker daemon is not running!
118-
Please set up OrbStack (https://orbstack.dev/)
119-
or
120-
Docker Desktop (https://www.docker.com/products/docker-desktop/)
118+
//nolint
119+
return fmt.Errorf(`docker daemon is not running! Please set up OrbStack (https://orbstack.dev/) or Docker Desktop (https://www.docker.com/products/docker-desktop/)
121120
`)
122121
}
123122
f := &nodeSetForm{}

framework/cmd/logs.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"bytes"
66
"encoding/json"
77
"fmt"
8-
"github.com/pkg/errors"
9-
"github.com/smartcontractkit/chainlink-testing-framework/framework"
108
"io"
119
"net/http"
1210
"os"
@@ -15,6 +13,9 @@ import (
1513
"sync"
1614
"time"
1715

16+
"github.com/pkg/errors"
17+
"github.com/smartcontractkit/chainlink-testing-framework/framework"
18+
1819
"go.uber.org/ratelimit"
1920
)
2021

framework/cmd/main.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ package main
33
import (
44
"embed"
55
"fmt"
6-
"github.com/pelletier/go-toml"
7-
"github.com/smartcontractkit/chainlink-testing-framework/framework"
8-
"github.com/urfave/cli/v2"
96
"io/fs"
107
"log"
118
"os"
129
"path/filepath"
1310
"strings"
11+
12+
"github.com/pelletier/go-toml"
13+
"github.com/smartcontractkit/chainlink-testing-framework/framework"
14+
"github.com/urfave/cli/v2"
1415
)
1516

1617
//go:embed observability/*
@@ -317,6 +318,7 @@ func extractAllFiles(embeddedDir string) error {
317318
}
318319

319320
// Write the file content to the target path
321+
//nolint
320322
err = os.WriteFile(targetPath, content, 0777)
321323
if err != nil {
322324
return fmt.Errorf("failed to write file %s: %w", targetPath, err)
@@ -343,6 +345,7 @@ func PrettyPrintTOML(inputFile string, outputFile string) error {
343345
return fmt.Errorf("error converting to TOML string: %v", err)
344346
}
345347

348+
//nolint
346349
err = os.WriteFile(outputFile, []byte(dumpData), 0644)
347350
if err != nil {
348351
return fmt.Errorf("error writing to output file: %v", err)

framework/cmd/observability.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ package main
22

33
import (
44
"fmt"
5+
"net/http"
6+
57
"github.com/google/uuid"
68
"github.com/pkg/errors"
79
"github.com/smartcontractkit/chainlink-testing-framework/framework"
810
"go.uber.org/ratelimit"
9-
"net/http"
1011
)
1112

1213
func loadLogs(rawURL, dirPath string, rps, chunks int) error {
@@ -18,6 +19,7 @@ func loadLogs(rawURL, dirPath string, rps, chunks int) error {
1819
limiter := ratelimit.New(rps)
1920
if rawURL != "" {
2021
L.Info().Msg("Downloading raw logs from URL")
22+
//nolint:gosec
2123
resp, err := http.Get(rawURL)
2224
if err != nil {
2325
return errors.Wrap(err, "error downloading raw logs")

0 commit comments

Comments
 (0)