mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
* 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
This commit is contained in:
2
Makefile
2
Makefile
@@ -111,7 +111,7 @@ clean:
|
||||
.PHONY: goget-tools
|
||||
goget-tools:
|
||||
mkdir -p $(shell go env GOPATH)/bin
|
||||
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.30.0
|
||||
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.37.0
|
||||
|
||||
.PHONY: goget-ginkgo
|
||||
goget-ginkgo:
|
||||
|
||||
Reference in New Issue
Block a user