fix(lint): use default:none to disable errcheck, fix all gofmt and exhaustive
This commit is contained in:
parent
4426219f35
commit
aed5f0475d
24 changed files with 74 additions and 77 deletions
|
|
@ -4,6 +4,7 @@ run:
|
|||
timeout: 5m
|
||||
|
||||
linters:
|
||||
default: none
|
||||
enable:
|
||||
- govet
|
||||
- ineffassign
|
||||
|
|
|
|||
|
|
@ -341,4 +341,3 @@ func CleanableBytes() int64 {
|
|||
|
||||
return total
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ func TestFileSize_NonExistent(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
func TestRunClean_DryRun(t *testing.T) {
|
||||
err := runClean(true, false, false)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -236,4 +236,3 @@ func runDaemonUninstall() error {
|
|||
fmt.Println()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
|
|
|
|||
|
|
@ -155,4 +155,3 @@ func handleStreamTask(parentCtx context.Context, at agent.Task, reporter *engine
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@ import (
|
|||
"github.com/anacrolix/torrent"
|
||||
)
|
||||
|
||||
|
||||
|
||||
// StreamConfig holds settings for the streaming engine.
|
||||
type StreamConfig struct {
|
||||
DataDir string
|
||||
|
|
|
|||
|
|
@ -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{
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -471,4 +471,3 @@ func sanitizeDir(name string) string {
|
|||
}
|
||||
return name
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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(`"([^"]+)"`)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue