Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (45 loc) · 1.47 KB
/
Copy pathMakefile
File metadata and controls
55 lines (45 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.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: ## Setup development environment
$(MAKE) deps-install
lint: ## Execute linting
$(call run_linter,)
lint-fix: ## Execute linting and fix
$(call run_linter, \
-e FIX_YAML_PRETTIER=true \
-e FIX_MARKDOWN=true \
-e FIX_NATURAL_LANGUAGE=true \
-e FIX_SHELL_SHFMT=true \
-e FIX_BIOME_LINT=true \
-e FIX_BIOME_FORMAT=true \
)
deps-install: ## Install dependencies for all package.json files under tests/
@sh scripts/test-packages.sh install
deps-update-interactive: ## Interactively update dependencies under tests/
@sh scripts/test-packages.sh update-interactive
deps-audit-fix: ## Execute dependency audit fix
@sh scripts/test-packages.sh audit-fix
ci: ## Execute CI tasks
$(MAKE) deps-install
$(MAKE) deps-audit-fix || true
$(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
#############################
%:
@: