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
|
timeout: 5m
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
|
default: none
|
||||||
enable:
|
enable:
|
||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
|
|
|
||||||
|
|
@ -341,4 +341,3 @@ func CleanableBytes() int64 {
|
||||||
|
|
||||||
return total
|
return total
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@ func TestFileSize_NonExistent(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func TestRunClean_DryRun(t *testing.T) {
|
func TestRunClean_DryRun(t *testing.T) {
|
||||||
err := runClean(true, false, false)
|
err := runClean(true, false, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -236,4 +236,3 @@ func runDaemonUninstall() error {
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ import (
|
||||||
|
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
tc "github.com/torrentclaw/go-client"
|
||||||
"github.com/torrentclaw/unarr/internal/config"
|
"github.com/torrentclaw/unarr/internal/config"
|
||||||
"github.com/torrentclaw/unarr/internal/sentry"
|
"github.com/torrentclaw/unarr/internal/sentry"
|
||||||
tc "github.com/torrentclaw/go-client"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
||||||
|
|
@ -155,4 +155,3 @@ func handleStreamTask(parentCtx context.Context, at agent.Task, reporter *engine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@ import (
|
||||||
"github.com/anacrolix/torrent"
|
"github.com/anacrolix/torrent"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// StreamConfig holds settings for the streaming engine.
|
// StreamConfig holds settings for the streaming engine.
|
||||||
type StreamConfig struct {
|
type StreamConfig struct {
|
||||||
DataDir string
|
DataDir string
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,8 @@ func (t *Task) ToStatusUpdate() agent.StatusUpdate {
|
||||||
apiStatus = "completed"
|
apiStatus = "completed"
|
||||||
case StatusFailed:
|
case StatusFailed:
|
||||||
apiStatus = "failed"
|
apiStatus = "failed"
|
||||||
|
default:
|
||||||
|
// StatusPending, StatusClaimed, StatusCancelled — not reported
|
||||||
}
|
}
|
||||||
|
|
||||||
return agent.StatusUpdate{
|
return agent.StatusUpdate{
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
alog "github.com/anacrolix/log"
|
|
||||||
"github.com/anacrolix/dht/v2"
|
"github.com/anacrolix/dht/v2"
|
||||||
"github.com/anacrolix/dht/v2/krpc"
|
"github.com/anacrolix/dht/v2/krpc"
|
||||||
|
alog "github.com/anacrolix/log"
|
||||||
"github.com/anacrolix/torrent"
|
"github.com/anacrolix/torrent"
|
||||||
"github.com/anacrolix/torrent/storage"
|
"github.com/anacrolix/torrent/storage"
|
||||||
"github.com/torrentclaw/unarr/internal/config"
|
"github.com/torrentclaw/unarr/internal/config"
|
||||||
|
|
|
||||||
|
|
@ -471,4 +471,3 @@ func sanitizeDir(name string) string {
|
||||||
}
|
}
|
||||||
return name
|
return name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -263,6 +263,7 @@ func (f *File) TotalBytes() int64 {
|
||||||
|
|
||||||
// subjectFilenameRe matches the filename in a typical Usenet subject line.
|
// subjectFilenameRe matches the filename in a typical Usenet subject line.
|
||||||
// Examples:
|
// Examples:
|
||||||
|
//
|
||||||
// "Movie.2024.1080p.mkv" yEnc (1/50)
|
// "Movie.2024.1080p.mkv" yEnc (1/50)
|
||||||
// [PRiVATE]-[#a]- "file.rar" yEnc (01/99)
|
// [PRiVATE]-[#a]- "file.rar" yEnc (01/99)
|
||||||
var subjectFilenameRe = regexp.MustCompile(`"([^"]+)"`)
|
var subjectFilenameRe = regexp.MustCompile(`"([^"]+)"`)
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ func IsPasswordProtected(archivePath string) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
switch extType {
|
switch extType { //nolint:exhaustive // ExtractorNone handled above
|
||||||
case ExtractorUnrar:
|
case ExtractorUnrar:
|
||||||
cmd := exec.Command(extPath, "t", "-p-", archivePath)
|
cmd := exec.Command(extPath, "t", "-p-", archivePath)
|
||||||
output, err := cmd.CombinedOutput()
|
output, err := cmd.CombinedOutput()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue