Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature reuqest: extra option to extend, rather than replace, ignoreSigs #54

Open
matthewhughes934 opened this issue Sep 18, 2024 · 0 comments

Comments

@matthewhughes934
Copy link

matthewhughes934 commented Sep 18, 2024

I have a use-case where I would like to add another signature to be ignored by wrapcheck[1], currently this means adding it to ignoreSigs which will stomp any of the defaults, so to keep current behaviour I need to:

  • Copy the current defaults to my config under ignoreSigs
  • Add another entry for my new signature

I find the current defaults very helpful, so this means I now need to manually keep my list in sync (e.g. if any new values are added as default I will need to also add them to my config).

Request: I was wondering if you would be open to accepting a change that adds a new config option like extraIgnoreSigs to address this, like:

extraIgnoreSigs:
    # ignore all the everything under `ignoreSigs` (or the defaults if that doesn't exist) and additionally:
    - SomeSpecialFunc(
    - SomeOtherFunc(

Currently the same behaviour would require a config like:

ignoreSigs:
# default values
- .Errorf(
- errors.New(
- errors.Unwrap(
- errors.Join(
- .Wrap(
- .Wrapf(
- .WithMessage(
- .WithMessagef(
- .WithStack(
# my extra bits
- SomeSpecialFunc(
- SomeOtherFunc(

I'd be happy to try and get this change up if there's interest

[1] My case was for ignoring google.golang.org/grpc/status.Error, note that package also has google.golang.org/grpc/status.Errorf which is ignored by the .Errorf( sig in the default list, so I was also wondering if .Error( functions might be considered for inclusion in the default list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant