-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Hey, great tool! This has been really useful to track down places I can apply some new error context packages I've been working on to provide additional structured information to errors.
After applying error contexts across our project I noticed a few places where it was unnecessary so I decided to disable reporting of imports from local packages (/pkg, etc)
However, maybe I'm misunderstanding this config option, but it doesn't appear to do what I expected.
Here's the configuration file: https://github.com/Southclaws/storyden/blob/main/.golangci.yml#L28
And here are the offending lines:
- https://github.com/Southclaws/storyden/blob/main/pkg/transports/http/bindings/threads.go#L39
- https://github.com/Southclaws/storyden/blob/main/pkg/transports/http/bindings/threads.go#L52
I assumed that a ignorePackageGlobs
value of github.com/Southclaws/storyden/*
would ignore these two lines as they are functions that are imported from within this pattern:
i.thread_svc.Create
:github.com/Southclaws/storyden/pkg/services/thread.Service.Create
i.thread_svc.ListAll
:github.com/Southclaws/storyden/pkg/services/thread.Service.Create
The actual output from running golangci-lint run
:
storyden on main [!] via 🐹 v1.18.3 on ☁️ (eu-central-1)
❯ golangci-lint run
pkg/transports/http/bindings/threads.go:39:10: error returned from interface method should be wrapped: sig: func (github.com/Southclaws/storyden/pkg/services/thread.Service).Create(ctx context.Context, title string, body string, authorID github.com/Southclaws/storyden/pkg/resources/account.AccountID, categoryID github.com/Southclaws/storyden/pkg/resources/category.CategoryID, tags []string) (*github.com/Southclaws/storyden/pkg/resources/thread.Thread, error) (wrapcheck)
return err
^
pkg/transports/http/bindings/threads.go:52:10: error returned from interface method should be wrapped: sig: func (github.com/Southclaws/storyden/pkg/services/thread.Service).ListAll(ctx context.Context, before time.Time, max int) ([]*github.com/Southclaws/storyden/pkg/resources/thread.Thread, error) (wrapcheck)
return err
^
I wondered if it was golangci lint just using an outdated version but this occurs on the latest standalone version of wrapcheck too.
I tried with a .wrapcheck.yaml file with:
ignorePackageGlobs:
- github.com/Southclaws/storyden/*
- github.com/Southclaws/storyden/pkg/*
- pkg/*
- ./pkg/*
but I can't seem to get any patterns to ignore correctly.
Thanks!