-
Notifications
You must be signed in to change notification settings - Fork 69
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
Switch to golangci-lint for the gocheck target #3
Conversation
@@ -0,0 +1,15 @@ | |||
#!/bin/bash |
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.
This is a cool idea. It would be neat to see as much of it as possible made part of _lib and just have the configuration (some kind of declarative list of dep/ver/loc) in the convention subdir in a file with a known name.
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.
Gah, ignore this comment. I was thinking of this completely wrong. Your intent was (correctly) to run this as part of the make
target, not to run it during update
.
@@ -71,8 +71,8 @@ docker-push: push | |||
|
|||
.PHONY: gocheck | |||
gocheck: ## Lint code | |||
boilerplate/openshift/golang_osd_cluster_operator/golint.sh | |||
${GOENV} go vet ./cmd/... ./pkg/... | |||
boilerplate/openshift/golang_osd_cluster_operator/ensure.sh golangci-lint |
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.
Yeah, I missed this line before
boilerplate/openshift/golang_osd_cluster_operator/golint.sh | ||
${GOENV} go vet ./cmd/... ./pkg/... | ||
boilerplate/openshift/golang_osd_cluster_operator/ensure.sh golangci-lint | ||
GOLANGCI_LINT_CACHE=/tmp/golanci-cache golangci-lint run -c boilerplate/openshift/golang_osd_cluster_operator/golangci.yml ./... |
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.
nit:
GOLANGCI_LINT_CACHE=/tmp/golanci-cache golangci-lint run -c boilerplate/openshift/golang_osd_cluster_operator/golangci.yml ./... | |
GOLANGCI_LINT_CACHE=/tmp/golangci-cache golangci-lint run -c boilerplate/openshift/golang_osd_cluster_operator/golangci.yml ./... |
I'm curious how this env var is used by golangci-lint. If you don't set it, does it use a default? (I couldn't find documentation for it at a quick glance.)
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'm not sure why it resolves to /.cache
as the default directory for caching but this issue summarizes what's going on.
Signed-off-by: Arjun Naik <anaik@redhat.com>
/lgtm Do we want to wait to merge this until one or more of the following is in place?
If not, that's fine, just a thought. |
Signed-off-by: Arjun Naik <anaik@redhat.com>
Thanks for the updates @arjunrn /lgtm again |
Apparently gh picks and chooses which directives are allowed to have stuff on the same line. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 2uasimojo, arjunrn The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Update the README for the openshift/golang_osd_cluster_operator convention to stop talking about golint.sh and start talking about golangci-lint. This was missed in 2c63aeb (PR openshift#3).
Replace all the linting tooling with golangci-lint which is a wrapper for the major linting tools. The changes also add a script which ensures that the linting tool is present on the path before doing the actual linting.