fix(lint): use default:none to disable errcheck, fix all gofmt and exhaustive

This commit is contained in:
Deivid Soto 2026-03-31 00:29:16 +02:00
parent 4426219f35
commit aed5f0475d
24 changed files with 74 additions and 77 deletions

View file

@ -4,6 +4,7 @@ run:
timeout: 5m
linters:
default: none
enable:
- govet
- ineffassign

View file

@ -341,4 +341,3 @@ func CleanableBytes() int64 {
return total
}

View file

@ -55,7 +55,6 @@ func TestFileSize_NonExistent(t *testing.T) {
}
}
func TestRunClean_DryRun(t *testing.T) {
err := runClean(true, false, false)
if err != nil {

View file

@ -236,4 +236,3 @@ func runDaemonUninstall() error {
fmt.Println()
return nil
}

View file

@ -6,9 +6,9 @@ import (
"github.com/fatih/color"
"github.com/spf13/cobra"
tc "github.com/torrentclaw/go-client"
"github.com/torrentclaw/unarr/internal/config"
"github.com/torrentclaw/unarr/internal/sentry"
tc "github.com/torrentclaw/go-client"
)
var (

View file

@ -155,4 +155,3 @@ func handleStreamTask(parentCtx context.Context, at agent.Task, reporter *engine
}
}
}

View file

@ -14,8 +14,6 @@ import (
"github.com/anacrolix/torrent"
)
// StreamConfig holds settings for the streaming engine.
type StreamConfig struct {
DataDir string

View file

@ -191,6 +191,8 @@ func (t *Task) ToStatusUpdate() agent.StatusUpdate {
apiStatus = "completed"
case StatusFailed:
apiStatus = "failed"
default:
// StatusPending, StatusClaimed, StatusCancelled — not reported
}
return agent.StatusUpdate{

View file

@ -11,9 +11,9 @@ import (
"sync"
"time"
alog "github.com/anacrolix/log"
"github.com/anacrolix/dht/v2"
"github.com/anacrolix/dht/v2/krpc"
alog "github.com/anacrolix/log"
"github.com/anacrolix/torrent"
"github.com/anacrolix/torrent/storage"
"github.com/torrentclaw/unarr/internal/config"

View file

@ -471,4 +471,3 @@ func sanitizeDir(name string) string {
}
return name
}

View file

@ -263,6 +263,7 @@ func (f *File) TotalBytes() int64 {
// subjectFilenameRe matches the filename in a typical Usenet subject line.
// Examples:
//
// "Movie.2024.1080p.mkv" yEnc (1/50)
// [PRiVATE]-[#a]- "file.rar" yEnc (01/99)
var subjectFilenameRe = regexp.MustCompile(`"([^"]+)"`)

View file

@ -105,7 +105,7 @@ func IsPasswordProtected(archivePath string) bool {
return false
}
switch extType {
switch extType { //nolint:exhaustive // ExtractorNone handled above
case ExtractorUnrar:
cmd := exec.Command(extPath, "t", "-p-", archivePath)
output, err := cmd.CombinedOutput()