-
Notifications
You must be signed in to change notification settings - Fork 243
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
add additional checks to golangci-lint #5567
Labels
kind/task
Issue is actionable task
Comments
rm3l
added a commit
to rm3l/odo
that referenced
this issue
Apr 22, 2022
…d 'github.com/pkg/errors' package
rm3l
added a commit
to rm3l/odo
that referenced
this issue
Apr 22, 2022
…e 'revive' Linter - revive is a drop-in replacement for the deprecated golint Linter - revive will allow to check for error strings Note: We are purposely not using the latest golangci-lint (1.45.0) but the minimum version from which revive is available. This is because the latest 1.45.0 reports additional linting issues (from govet and staticcheck for example). And fixing those side errors is outside of the scope of this issue. Also some of those issues are already fixed in redhat-developer#5497 (update to Go 1.17).
rm3l
added a commit
to rm3l/odo
that referenced
this issue
Apr 22, 2022
…d 'github.com/pkg/errors' package
rm3l
added a commit
to rm3l/odo
that referenced
this issue
Apr 22, 2022
…e 'revive' Linter - revive is a drop-in replacement for the deprecated golint Linter - revive will allow to check for error strings Note: We are purposely not using the latest golangci-lint (1.45.0) but the minimum version from which revive is available. This is because the latest 1.45.0 reports additional linting issues (from govet and staticcheck for example). And fixing those side errors is outside of the scope of this issue. Also some of those issues are already fixed in redhat-developer#5497 (update to Go 1.17).
3 tasks
openshift-merge-robot
pushed a commit
that referenced
this issue
Apr 25, 2022
* Document golangci-lint configuration options * Do not limit the number of issues reported per linter * Add check preventing the use of the deprecated 'github.com/pkg/errors' package * Upgrade golangci-lint to 1.37.0, so we can use 'revive' Linter - revive is a drop-in replacement for the deprecated golint Linter - revive will allow to check for error strings Note: We are purposely not using the latest golangci-lint (1.45.0) but the minimum version from which revive is available. This is because the latest 1.45.0 reports additional linting issues (from govet and staticcheck for example). And fixing those side errors is outside of the scope of this issue. Also some of those issues are already fixed in #5497 (update to Go 1.17). * Configure revive to check for error strings More rules can be added later on if needed * Fix issues reported by revive's error-strings rule Some rules are purposely ignored when the error messages represent top-level errors that are displayed to be displayed as is to end users * Fix more error-strings issues For some reason, those were not reported by revive's error-strings rule, but only by GoLand inspection tool. * Fix missing `revive:disable:error-strings` comment directive Also replace "fmt.Errorf" by "errors.New" when the error message is static
3 tasks
cdrage
pushed a commit
to cdrage/odo
that referenced
this issue
Aug 31, 2022
…t-developer#5687) * Document golangci-lint configuration options * Do not limit the number of issues reported per linter * Add check preventing the use of the deprecated 'github.com/pkg/errors' package * Upgrade golangci-lint to 1.37.0, so we can use 'revive' Linter - revive is a drop-in replacement for the deprecated golint Linter - revive will allow to check for error strings Note: We are purposely not using the latest golangci-lint (1.45.0) but the minimum version from which revive is available. This is because the latest 1.45.0 reports additional linting issues (from govet and staticcheck for example). And fixing those side errors is outside of the scope of this issue. Also some of those issues are already fixed in redhat-developer#5497 (update to Go 1.17). * Configure revive to check for error strings More rules can be added later on if needed * Fix issues reported by revive's error-strings rule Some rules are purposely ignored when the error messages represent top-level errors that are displayed to be displayed as is to end users * Fix more error-strings issues For some reason, those were not reported by revive's error-strings rule, but only by GoLand inspection tool. * Fix missing `revive:disable:error-strings` comment directive Also replace "fmt.Errorf" by "errors.New" when the error message is static
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/kind task
configure golangci-lint (https://github.com/redhat-developer/odo/blob/main/.golangci.yaml) to perform two following additional checks:
check 1
This follows a discussion in #5557, related to the removal of the deprecated
github.com/pkg/errors
package.Originally posted by @rm3l in #5557 (comment)
check 2
/kind documentation
What mistake did you find / what is missing in the documentation?
See: https://github.com/golang/go/wiki/CodeReviewComments#error-strings
All error messages should not be capitalize or end with punctuation.
Unless it's the most top level error message.
What is the relevance of it?
A lot of our error output is inconsistent throughout
odo
#5611
The text was updated successfully, but these errors were encountered: