diff --git a/.golangci.yaml b/.golangci.yaml index 766ec2a..3f33683 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,7 +1,8 @@ +version: "2" + linters: enable: - errcheck - - gosimple - govet - ineffassign - staticcheck @@ -22,18 +23,17 @@ linters: - gosec - perfsprint - testifylint - -linters-settings: - testifylint: - enable-all: true - disable: - - require-error - gocognit: - min-complexity: 16 - gocyclo: - min-complexity: 15 - gocritic: - enable-all: true - settings: - hugeParam: - sizeThreshold: 255 + settings: + testifylint: + enable-all: true + disable: + - require-error + gocognit: + min-complexity: 16 + gocyclo: + min-complexity: 15 + gocritic: + enable-all: true + settings: + hugeParam: + sizeThreshold: 255 diff --git a/cmd/ic-merge/main.go b/cmd/ic-merge/main.go index 63563b2..477317c 100644 --- a/cmd/ic-merge/main.go +++ b/cmd/ic-merge/main.go @@ -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() diff --git a/convids/logic.go b/convids/logic.go index 3786295..da53737 100644 --- a/convids/logic.go +++ b/convids/logic.go @@ -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) } } diff --git a/internal/cli/convids/app.go b/internal/cli/convids/app.go index 6bd349b..950dfaf 100644 --- a/internal/cli/convids/app.go +++ b/internal/cli/convids/app.go @@ -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 }