compose-action/Makefile
Emilien Escalle bd3d352542
Some checks failed
Internal - Main - Continuous Integration / ci (push) Has been cancelled
Need fix to Issue / main (push) Has been cancelled
Prepare release / release (push) Has been cancelled
Internal - Main - Continuous Integration / prepare-docs (push) Has been cancelled
Internal - Main - Continuous Integration / sync-docs (push) Has been cancelled
Mark stale issues and pull requests / main (push) Has been cancelled
chore: misc DevX improvments
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
2026-08-06 11:29:04 +02:00

47 lines
1.1 KiB
Makefile

.PHONY: help
help: ## Display help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
setup: ## Install dependencies
@npm install
lint: ## Execute linting
$(call run_linter,)
lint-fix: ## Execute linting and fix
@npm run format
$(call run_linter, \
-e FIX_MARKDOWN=true \
-e FIX_NATURAL_LANGUAGE=true \
-e FIX_SHELL_SHFMT=true \
-e FIX_BIOME_LINT=true \
-e FIX_BIOME_FORMAT=true \
)
ci: ## Execute all formats and checks
$(MAKE) setup
@npm audit fix || true
@npm run all
$(MAKE) lint-fix
define run_linter
DEFAULT_WORKSPACE="$(CURDIR)"; \
LINTER_IMAGE="linter:latest"; \
VOLUME="$$DEFAULT_WORKSPACE:$$DEFAULT_WORKSPACE"; \
docker build --platform=linux/amd64 --build-arg UID=$(shell id -u) --build-arg GID=$(shell id -g) --tag $$LINTER_IMAGE .; \
docker run \
--platform=linux/amd64 \
-v $$VOLUME \
--rm \
-e DEFAULT_WORKSPACE="$$DEFAULT_WORKSPACE" \
-e FILTER_REGEX_INCLUDE="$(filter-out $@,$(MAKECMDGOALS))" \
$(1) \
$$LINTER_IMAGE
endef
#############################
# Argument fix workaround
#############################
%:
@: