mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-07-02 19:43:00 +00:00
ensure golangci-lint installed when run out of devcontainer
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
parent
6a7801e62a
commit
77127b2c62
12
Makefile
12
Makefile
@ -3,7 +3,7 @@ TARGETS=darwin linux windows
|
|||||||
TERRAFORM_PLUGIN_EXTENSION=
|
TERRAFORM_PLUGIN_EXTENSION=
|
||||||
VERSION=0.78.0# x-release-please-version
|
VERSION=0.78.0# x-release-please-version
|
||||||
|
|
||||||
GOLANGCI_LINT_VERSION=v2.1.6# renovate: depName=golangci/golangci-lint datasource=github-releases
|
GOLANGCI_LINT_VERSION=2.1.6# renovate: depName=golangci/golangci-lint datasource=github-releases
|
||||||
|
|
||||||
# check if opentofu is installed and use it if it is,
|
# check if opentofu is installed and use it if it is,
|
||||||
# otherwise use terraform
|
# otherwise use terraform
|
||||||
@ -110,11 +110,19 @@ testacc:
|
|||||||
@TF_ACC=1 env $$(cat testacc.env | xargs) go test --timeout=30m --tags=acceptance -count=1 -v github.com/bpg/terraform-provider-proxmox/fwprovider/...
|
@TF_ACC=1 env $$(cat testacc.env | xargs) go test --timeout=30m --tags=acceptance -count=1 -v github.com/bpg/terraform-provider-proxmox/fwprovider/...
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint:
|
lint: ensure-golangci-lint
|
||||||
# NOTE: This target is for local runs only. For linting in CI see .github/workflows/golangci-lint.yml
|
# NOTE: This target is for local runs only. For linting in CI see .github/workflows/golangci-lint.yml
|
||||||
golangci-lint fmt
|
golangci-lint fmt
|
||||||
golangci-lint run --fix
|
golangci-lint run --fix
|
||||||
|
|
||||||
|
.PHONY: ensure-golangci-lint
|
||||||
|
ensure-golangci-lint:
|
||||||
|
@CURRENT_VERSION=$$(golangci-lint version --short 2>/dev/null || echo "not installed"); \
|
||||||
|
if [ "$$CURRENT_VERSION" != "$(GOLANGCI_LINT_VERSION)" ]; then \
|
||||||
|
echo "Installing golangci-lint $(GOLANGCI_LINT_VERSION) (current: $$CURRENT_VERSION)"; \
|
||||||
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin $(GOLANGCI_LINT_VERSION); \
|
||||||
|
fi
|
||||||
|
|
||||||
.PHONY: release-build
|
.PHONY: release-build
|
||||||
release-build:
|
release-build:
|
||||||
goreleaser build --clean --skip=validate
|
goreleaser build --clean --skip=validate
|
||||||
|
Loading…
Reference in New Issue
Block a user