0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 02:31:10 +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:
Pavel Boldyrev 2025-05-24 15:54:23 +00:00
parent 6a7801e62a
commit 77127b2c62
No known key found for this signature in database
GPG Key ID: 637146A2A6804C59

View File

@ -3,7 +3,7 @@ TARGETS=darwin linux windows
TERRAFORM_PLUGIN_EXTENSION=
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,
# 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/...
.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
golangci-lint fmt
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
release-build:
goreleaser build --clean --skip=validate