tests: add support for running golangci-lint automatically

The plugin paths must be computed at execution because not all plugins contain golang code.
This commit is contained in:
Jose Diaz-Gonzalez
2024-01-17 02:28:11 -05:00
committed by GitHub
parent 3a47e5f54d
commit b8329d76ec

View File

@@ -1,6 +1,7 @@
SYSTEM := $(shell sh -c 'uname -s 2>/dev/null')
DOKKU_SSH_PORT ?= 22
DOKKU_DOMAIN ?= dokku.me
GO_PLUGINS := $(shell sh -c 'find plugins -type f -name "go.mod" -exec dirname "{}" \; | sort -u | sed -e "s/$$/\/.../" | xargs')
SYSTEM := $(shell sh -c 'uname -s 2>/dev/null')
bats:
ifeq ($(SYSTEM),Darwin)
@@ -130,6 +131,9 @@ lint-ci: lint-setup
@echo linting...
@cat tmp/shellcheck/test-files | xargs shellcheck | tests/shellcheck-to-junit --output test-results/shellcheck/results.xml --files tmp/shellcheck/test-files --exclude $(shell cat tmp/shellcheck/exclude)
lint-golang:
golangci-lint run $(GO_PLUGINS)
lint-shfmt: shfmt
# verifying via shfmt
# shfmt -l -bn -ci -i 2 -d .