Skip to content

Commit

Permalink
Switch to new boilerplate convention with golangci-lint
Browse files Browse the repository at this point in the history
Signed-off-by: Arjun Naik <anaik@redhat.com>
  • Loading branch information
Arjun Naik committed Aug 26, 2020
1 parent e1c4485 commit 2c63aeb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 94 deletions.
15 changes: 15 additions & 0 deletions boilerplate/_lib/ensure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -euo pipefail

GOLANGCI_LINT_VERSION="1.30.0"
DEPENDENCY=${1:-}

case "${DEPENDENCY}" in
golangci-lint)
GOPATH=$(go env GOPATH)
if [ ! -f "${GOPATH}/bin/golangci-lint" ]; then
DOWNLOAD_URL="https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz"
curl -sfL "${DOWNLOAD_URL}" | tar -C "${GOPATH}/bin" -zx --strip-components=1 "golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64/golangci-lint"
fi
;;
esac
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# options for analysis running
run:
# default concurrency is a available CPU number
concurrency: 10
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 2m
92 changes: 0 additions & 92 deletions boilerplate/openshift/golang_osd_cluster_operator/golint.sh

This file was deleted.

4 changes: 2 additions & 2 deletions boilerplate/openshift/golang_osd_cluster_operator/standard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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/_lib/ensure.sh golangci-lint
GOLANGCI_LINT_CACHE=/tmp/golangci-cache golangci-lint run -c boilerplate/openshift/golang_osd_cluster_operator/golangci.yml ./...

.PHONY: gogenerate
gogenerate:
Expand Down

0 comments on commit 2c63aeb

Please sign in to comment.