tomarrell / wrapcheck

A Go linter to check that errors from external packages are wrapped
https://blog.tomarrell.com/post/introducing_wrapcheck_linter_for_go
MIT License
291 stars 26 forks source link

False positive when return errors.Newf() #43

Closed m3dwards closed 5 months ago

m3dwards commented 9 months ago
return nil, errors.Newf("Unknown node implementation: %v", n.Impl)

Gives me a false positive

m3dwards commented 9 months ago

Using with golangci so the following fixes it for me:

.golangci file:

linters-settings:
  wrapcheck:
    ignoreSigs:
      - .Errorf(
      - errors.New(
      - errors.Newf(
      - errors.Unwrap(
      - .Wrap(
      - .Wrapf(
      - .WithMessage(
      - .WithMessagef(
      - .WithStack(