Skip to content

Commit ece322e

Browse files
committed
update linter
1 parent 5071cac commit ece322e

File tree

5 files changed

+51
-47
lines changed

5 files changed

+51
-47
lines changed

.github/workflows/codetests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ jobs:
3737
- name: go-generate
3838
run: GOOS=darwin go generate ./...
3939
- name: golangci-lint
40-
uses: golangci/golangci-lint-action@v6
40+
uses: golangci/golangci-lint-action@v7
4141
with:
42-
version: 'v1.62'
42+
version: 'v2.0'
4343

4444
golangci-linux:
4545
# description: "Runs golangci-lint on linux against linux and windows."
@@ -58,6 +58,6 @@ jobs:
5858
- name: go-generate
5959
run: GOOS=linux go generate ./...
6060
- name: golangci-lint
61-
uses: golangci/golangci-lint-action@v6
61+
uses: golangci/golangci-lint-action@v7
6262
with:
63-
version: 'v1.62'
63+
version: 'v2.0'

.golangci.yml

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
version: "2"
12
linters:
2-
enable-all: true
3+
default: all
34
disable:
4-
# deprecated
5-
- exportloopref
65
# unused
76
- exhaustruct
87
- exhaustive
@@ -11,33 +10,45 @@ linters:
1110
- tagliatelle
1211
- cyclop
1312
- testpackage
13+
#fix this
14+
- staticcheck
15+
settings:
16+
depguard:
17+
rules:
18+
main:
19+
files:
20+
- $all
21+
allow:
22+
- $gostd
23+
- github.com/Unpackerr/unpackerr
24+
- github.com/lestrrat-go/apache-logformat
25+
- github.com/gen2brain/dlgs
26+
- github.com/getlantern/systray
27+
- github.com/hako/durafmt
28+
- github.com/mitchellh/go-homedir
29+
- github.com/fsnotify/fsnotify
30+
- github.com/radovskyb/watcher
31+
- github.com/prometheus/client_golang/
32+
- github.com/spf13/pflag
33+
- github.com/julienschmidt/httprouter
34+
- github.com/BurntSushi/toml
35+
- golift.io
36+
- golang.org/x
37+
- gopkg.in/yaml.v3
38+
39+
exclusions:
40+
generated: lax
41+
presets:
42+
- comments
43+
- common-false-positives
44+
- std-error-handling
1445

1546
issues:
1647
max-issues-per-linter: 0
1748
max-same-issues: 0
18-
19-
output:
20-
sort-results: true
21-
run:
22-
timeout: 3m
23-
24-
linters-settings:
25-
depguard:
26-
rules:
27-
main:
28-
files:
29-
- $all
30-
allow:
31-
- $gostd
32-
- github.com/Unpackerr/unpackerr
33-
- github.com/lestrrat-go/apache-logformat
34-
- github.com/gen2brain/dlgs
35-
- github.com/getlantern/systray
36-
- github.com/hako/durafmt
37-
- github.com/mitchellh/go-homedir
38-
- github.com/fsnotify/fsnotify
39-
- github.com/radovskyb/watcher
40-
- github.com/prometheus/client_golang/
41-
- github.com/spf13/pflag
42-
- github.com/julienschmidt/httprouter
43-
- github.com/BurntSushi/toml
49+
formatters:
50+
enable:
51+
- gci
52+
- gofmt
53+
- gofumpt
54+
- goimports

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/Unpackerr/unpackerr
22

3-
go 1.23
4-
5-
toolchain go1.23.4
3+
go 1.24
64

75
require (
86
github.com/BurntSushi/toml v1.4.0

pkg/unpackerr/start_test.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ import (
99
func TestDirIsEmpty(t *testing.T) {
1010
t.Parallel()
1111

12-
emptyDir, err := os.MkdirTemp("", "gobuildtestdir")
13-
if err != nil {
14-
t.Fatalf("Got an error making temp folder: %v", err)
15-
}
16-
12+
emptyDir := t.TempDir()
1713
if !dirIsEmpty(emptyDir) {
18-
t.Fatal("dirIsEmpty should return true on an emty folder")
14+
t.Fatal("dirIsEmpty should return true on an empty folder")
1915
}
2016

2117
f, err := os.Create(filepath.Join(emptyDir, "emptyFile"))

pkg/unpackerr/tray.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,26 +101,25 @@ func (u *Unpackerr) watchDebugChannels() {
101101

102102
func (u *Unpackerr) watchGuiChannels() {
103103
for {
104-
//nolint:errcheck
105104
select {
106105
case <-u.menu["conf"].Clicked():
107106
// does nothing on purpose
108107
case <-u.menu["edit"].Clicked():
109108
u.Printf("User Editing Config File: %s", u.Flags.ConfigFile)
110-
ui.OpenFile(u.Flags.ConfigFile)
109+
_ = ui.OpenFile(u.Flags.ConfigFile)
111110
case <-u.menu["link"].Clicked():
112111
// does nothing on purpose
113112
case <-u.menu["info"].Clicked():
114113
// does nothing on purpose
115114
case <-u.menu["disc"].Clicked():
116-
ui.OpenURL("https://golift.io/discord")
115+
_ = ui.OpenURL("https://golift.io/discord")
117116
case <-u.menu["gh"].Clicked():
118-
ui.OpenURL("https://github.com/Unpackerr/unpackerr/")
117+
_ = ui.OpenURL("https://github.com/Unpackerr/unpackerr/")
119118
case <-u.menu["logs"].Clicked():
120119
// does nothing on purpose
121120
case <-u.menu["logs_view"].Clicked():
122121
u.Printf("User Viewing Log File: %s", u.Config.LogFile)
123-
ui.OpenLog(u.Config.LogFile)
122+
_ = ui.OpenLog(u.Config.LogFile)
124123
case <-u.menu["logs_rotate"].Clicked():
125124
u.rotateLogs()
126125
case <-u.menu["update"].Clicked():

0 commit comments

Comments
 (0)