Skip to content

Commit f090948

Browse files
authored
chore(golangci-lint): enable format, import, and unused presets; disable depguard (#386)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 3b61c36 commit f090948

File tree

13 files changed

+20
-22
lines changed

13 files changed

+20
-22
lines changed

.golangci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ issues:
44
max-issues-per-linter: 0
55
max-same-issues: 0
66
linters:
7+
disable:
8+
- depguard
79
enable:
810
- errcheck
911
- gosimple
@@ -12,9 +14,15 @@ linters:
1214
- staticcheck
1315
- unused
1416
# Defaults above ours below
17+
- copyloopvar
18+
- usestdlibvars
19+
- whitespace
1520
presets:
1621
- bugs
22+
- format
23+
- import
1724
- performance
25+
- unused
1826
#linters-settings:
1927
# errcheck:
2028
# check-type-assertions: true

cmd/adder/main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ import (
2222
"runtime"
2323
"time"
2424

25-
"github.com/inconshreveable/mousetrap"
26-
"go.uber.org/automaxprocs/maxprocs"
27-
2825
"github.com/blinklabs-io/adder/api"
2926
_ "github.com/blinklabs-io/adder/filter"
3027
_ "github.com/blinklabs-io/adder/input"
@@ -34,6 +31,8 @@ import (
3431
_ "github.com/blinklabs-io/adder/output"
3532
"github.com/blinklabs-io/adder/pipeline"
3633
"github.com/blinklabs-io/adder/plugin"
34+
"github.com/inconshreveable/mousetrap"
35+
"go.uber.org/automaxprocs/maxprocs"
3736
)
3837

3938
var programName string = "adder"

filter/chainsync/chainsync.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ import (
1818
"encoding/hex"
1919
"strings"
2020

21-
"github.com/blinklabs-io/gouroboros/ledger"
22-
"github.com/btcsuite/btcd/btcutil/bech32"
23-
2421
"github.com/blinklabs-io/adder/event"
2522
"github.com/blinklabs-io/adder/input/chainsync"
2623
"github.com/blinklabs-io/adder/plugin"
24+
"github.com/blinklabs-io/gouroboros/ledger"
25+
"github.com/btcsuite/btcd/btcutil/bech32"
2726
)
2827

2928
type ChainSync struct {

input/chainsync/chainsync.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ import (
2626
"time"
2727

2828
"github.com/SundaeSwap-finance/kugo"
29-
3029
"github.com/SundaeSwap-finance/ogmigo/ouroboros/chainsync"
3130
"github.com/blinklabs-io/adder/event"
3231
"github.com/blinklabs-io/adder/internal/logging"
3332
"github.com/blinklabs-io/adder/plugin"
34-
3533
ouroboros "github.com/blinklabs-io/gouroboros"
3634
"github.com/blinklabs-io/gouroboros/ledger"
3735
"github.com/blinklabs-io/gouroboros/protocol/blockfetch"

input/chainsync/plugin.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222

2323
"github.com/blinklabs-io/adder/internal/logging"
2424
"github.com/blinklabs-io/adder/plugin"
25-
2625
ocommon "github.com/blinklabs-io/gouroboros/protocol/common"
2726
)
2827

internal/config/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"os"
2121

2222
"github.com/blinklabs-io/adder/plugin"
23-
2423
"github.com/kelseyhightower/envconfig"
2524
"gopkg.in/yaml.v2"
2625
)

internal/logging/logging.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ func Configure() {
5555
Level: level,
5656
})
5757
globalLogger = slog.New(handler).With("component", "main")
58-
5958
}
6059

6160
func GetLogger() *slog.Logger {

internal/version/version.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ import (
1919
)
2020

2121
// These are populated at build time
22-
var Version string
23-
var CommitHash string
22+
var (
23+
Version string
24+
CommitHash string
25+
)
2426

2527
func GetVersionString() string {
2628
if Version != "" {

output/notify/notify.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ import (
1919
"fmt"
2020
"os"
2121

22-
"github.com/gen2brain/beeep"
23-
2422
"github.com/blinklabs-io/adder/event"
2523
"github.com/blinklabs-io/adder/input/chainsync"
2624
"github.com/blinklabs-io/adder/plugin"
25+
"github.com/gen2brain/beeep"
2726
)
2827

2928
//go:embed icon.png
@@ -67,7 +66,7 @@ func (n *NotifyOutput) Start() error {
6766
}
6867
}
6968
filename := fmt.Sprintf("%s/%s/%s", userCacheDir, "adder", "icon.png")
70-
if err := os.WriteFile(filename, icon, 0600); err != nil {
69+
if err := os.WriteFile(filename, icon, 0o600); err != nil {
7170
panic(err)
7271
}
7372
go func() {

output/push/api_routes.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
var routesRegistered = false
2222

2323
func (p *PushOutput) RegisterRoutes() {
24-
2524
if routesRegistered {
2625
return
2726
}

0 commit comments

Comments
 (0)