-
Notifications
You must be signed in to change notification settings - Fork 48
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
🌱 Use errors.Is() to silence lint warnings #834
base: main
Are you sure you want to change the base?
Conversation
I'm not opposed to this, but what IDE is giving these errors? VSCode does not, and our lint target does not. I wonder if we can do something in our linter to catch these. I agree we should use |
c549529
to
b64bd95
Compare
Add errorlint linter to golangci: only enable the wrapped error check until we fix all the others.
b64bd95
to
25ea363
Compare
Minimum allowed line rate is |
@@ -143,11 +143,16 @@ linters-settings: | |||
desc: "replaced by internal packages like pkg/util/ptr" | |||
- pkg: github.com/onsi/ginkgo$ | |||
desc: "replaced by github.com/onsi/ginkgo/v2" | |||
|
|||
errorlint: | |||
# Check whether fmt.Errorf uses the %w verb for formatting errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want Errorf
to use %w
to format errors. Why would we wish to disable that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That disables the lint for not using %w. There's lots of places where we're not and something that can be addressed later (along with the other disabled check)
What does this PR do, and why is it needed?
In case these become wrapped errors later.
Which issue(s) is/are addressed by this PR? (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Are there any special notes for your reviewer:
Please add a release note if necessary: