🚨 Update linter and fix new warnings
This commit is contained in:
parent
24436ce28b
commit
186bf5fcba
4 changed files with 24 additions and 21 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue