🚨 Update linter and fix new warnings

This commit is contained in:
Dan Jones 2025-07-02 14:14:04 -05:00
commit 186bf5fcba
4 changed files with 24 additions and 21 deletions

View file

@ -1,7 +1,8 @@
version: "2"
linters:
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
@ -22,8 +23,7 @@ linters:
- gosec
- perfsprint
- testifylint
linters-settings:
settings:
testifylint:
enable-all: true
disable:

View file

@ -16,6 +16,7 @@ func main() {
m, err := ic.NewMerger(os.Args[1:])
e.HandleErr(err)
//nolint:errcheck // I don't care about this
defer m.Close()
err = m.ParseFiles()

View file

@ -1,6 +1,7 @@
package convids
import (
"cmp"
"context"
"errors"
"fmt"
@ -17,6 +18,7 @@ import (
)
func NewData(path string) (*Data, error) {
//nolint:gosec // I don't care if this is user input
f, err := os.Open(path)
if err != nil {
return nil, err
@ -152,8 +154,8 @@ func WalkFiles(d *Data, stopOnError bool, gp GroupPrinter, cb ShowWalker) (err e
func DryRun(out io.Writer) ShowWalker {
return func(s *Show, path string) error {
fmt.Fprintf(out, "Saving %s to %s\n", path, s.Folder)
return ErrSkipped
_, err := fmt.Fprintf(out, "Saving %s to %s\n", path, s.Folder)
return cmp.Or(err, ErrSkipped)
}
}
@ -175,6 +177,6 @@ func GetShowWithIO(ctx context.Context, stdin io.Reader, stdout, stderr io.Write
func PrintGroupName(out io.Writer) GroupPrinter {
return func(name string, group Shows) {
fmt.Fprintf(out, "Checking %s shows\n\n", name)
_, _ = fmt.Fprintf(out, "Checking %s shows\n\n", name)
}
}

View file

@ -50,11 +50,11 @@ func (a *App) run(ctx context.Context) error {
}
func (a *App) runInLoop(ctx context.Context) error {
fmt.Fprintln(a.stdout, "Looping")
_, _ = fmt.Fprintln(a.stdout, "Looping")
var err error
for err == nil {
err = a.run(ctx)
fmt.Fprintln(a.stdout, err)
_, _ = fmt.Fprintln(a.stdout, err)
}
return err
}