Skip to content

Commit 99c124c

Browse files
committed
fix wsl_v5
1 parent 0578755 commit 99c124c

8 files changed

Lines changed: 14 additions & 8 deletions

File tree

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ linters:
1414
- embeddedstructfieldcheck # this is a trash rule.
1515
- funcorder # also lame.
1616
- noinlineerr # I like inline errors.
17-
- wsl_v5 # this one sucks compared to wsl, and lacks configurability.
1817
- goconst # noisy af.
1918
- gomodguard # deprecated.
2019

pkg/unpackerr/cmdhook.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ func (u *Unpackerr) runCmdhookWithLog(hook *WebhookConfig, payload *WebhookPaylo
4949

5050
hook.Lock() // we only lock for the integer increments.
5151
defer hook.Unlock()
52-
hook.posts++ //nolint:wsl
52+
hook.posts++ //nolint:wsl_v5
5353

5454
switch {
5555
case err != nil:
5656
u.Errorf("Command Hook (%s) %s: %v: %s", payload.Event, hook.Name, err, out.String())
57-
hook.fails++ //nolint:wsl
57+
hook.fails++
5858
case hook.Silent || out == nil:
5959
u.Printf("[Cmdhook] Queue: %d/%d. Ran command %s", len(u.hookChan), cap(u.hookChan), hook.Name)
6060
default:
@@ -127,7 +127,7 @@ func (u *Unpackerr) logCmdhook() {
127127
prefix = " => Command Hook Config: 1 cmd"
128128
} else {
129129
u.Printf(" => Command Hook Configs: %d commands", len(u.Cmdhook))
130-
prefix = " => Command" //nolint:wsl
130+
prefix = " => Command" //nolint:wsl_v5
131131
}
132132

133133
for _, f := range u.Cmdhook {

pkg/unpackerr/folder.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ func (u *Unpackerr) PollFolders() {
141141
}
142142

143143
go u.folders.watchFSNotify()
144+
144145
u.Printf("[Folder] Watching (fsnotify): %s", strings.Join(flist, ", "))
145146

146147
// Setting an interval of any value less than 5 milliseconds
@@ -154,6 +155,7 @@ func (u *Unpackerr) PollFolders() {
154155
u.Errorf("Folder poller stopped: %v", err)
155156
}
156157
}()
158+
157159
u.Printf("[Folder] Polling @ %s: %s", u.Folder.Interval.String(), strings.Join(flist, ", "))
158160
}
159161

@@ -597,7 +599,7 @@ func (u *Unpackerr) checkFolderStats(now time.Time) {
597599
}
598600
}
599601

600-
//nolint:wsl
602+
//nolint:wsl_v5
601603
func (u *Unpackerr) deleteAfterReached(name string, now time.Time, folder *Folder) {
602604
var webhook bool
603605
// Folder reached delete delay (after extraction), nuke it.

pkg/unpackerr/handlers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,15 @@ func (u *Unpackerr) checkExtractDone(now time.Time) {
209209

210210
if item.DeleteOrig {
211211
u.delChan <- &fileDeleteReq{Paths: []string{item.Path}}
212-
webhook = true
212+
webhook = true //nolint:wsl_v5
213213
} else if item.Resp != nil && len(item.Resp.NewFiles) > 0 && item.DeleteDelay >= 0 {
214214
// Delete extracted files and purge empty parents up to and including the download path.
215215
u.delChan <- &fileDeleteReq{
216216
Paths: item.Resp.NewFiles,
217217
PurgeEmptyParent: true,
218218
PurgeEmptyRoot: item.Path,
219219
}
220-
webhook = true
220+
webhook = true //nolint:wsl_v5
221221
}
222222

223223
u.updateQueueStatus(&newStatus{Name: name, Status: DELETED, Resp: item.Resp}, now, webhook)

pkg/unpackerr/metrics.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ func (c *MetricsCollector) Describe(ch chan<- *prometheus.Desc) {
3939
}
4040

4141
// Collect satisfies the Prometheus custom metrics collector.
42+
//
43+
//nolint:wsl_v5
4244
func (c *MetricsCollector) Collect(metrics chan<- prometheus.Metric) {
4345
stats := c.stats()
4446
newMetric := prometheus.MustNewConstMetric

pkg/unpackerr/start.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ func Start() error {
191191
}
192192

193193
go unpackerr.watchDeleteChannel()
194+
194195
unpackerr.startWebServer()
195196
unpackerr.watchWorkThread()
196197
unpackerr.startTray() // runs tray or waits for exit depending on hasGUI.

pkg/unpackerr/tray.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,13 @@ func (u *Unpackerr) checkForUpdate() {
232232
}
233233

234234
const limitUnit = 3
235+
235236
ago := durafmt.Parse(time.Since(update.RelDate)).LimitFirstN(limitUnit).Format(durafmtUnits)
236237

237238
if !update.Outdate {
238239
_, _ = ui.Info("Unpackerr", "You're up to date! Version: %s\nUpdated: %s (%s ago)",
239240
update.Version, update.RelDate.Format("Jan 2, 2006"), ago)
241+
240242
return
241243
}
242244

pkg/unpackerr/webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ func (u *Unpackerr) logWebhook() {
272272
prefix = " => Webhook Config: 1 URL"
273273
} else {
274274
u.Printf(" => Webhook Configs: %d URLs", len(u.Webhook))
275-
prefix = " => URL" //nolint:wsl
275+
prefix = " => URL" //nolint:wsl_v5
276276
}
277277

278278
for _, hook := range u.Webhook {

0 commit comments

Comments
 (0)