-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
42 lines (37 loc) · 1.2 KB
/
Makefile
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
.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}'
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_JSON_PRETTIER=true \
-e FIX_MARKDOWN_PRETTIER=true \
-e FIX_NATURAL_LANGUAGE=true)
define run_linter
DEFAULT_WORKSPACE="$(CURDIR)"; \
LINTER_IMAGE="linter:latest"; \
VOLUME="$$DEFAULT_WORKSPACE:$$DEFAULT_WORKSPACE"; \
docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) --tag $$LINTER_IMAGE .; \
docker run \
-e DEFAULT_WORKSPACE="$$DEFAULT_WORKSPACE" \
-e FILTER_REGEX_INCLUDE="$(filter-out $@,$(MAKECMDGOALS))" \
-e FILTER_REGEX_EXCLUDE=dist/**/* \
-e VALIDATE_JSCPD=false \
-e VALIDATE_TYPESCRIPT_STANDARD=false \
-e VALIDATE_TYPESCRIPT_ES=false \
-e VALIDATE_TYPESCRIPT_PRETTIER=false \
-e VALIDATE_JAVASCRIPT_ES=false \
-e VALIDATE_JAVASCRIPT_STANDARD=false \
$(1) \
-v $$VOLUME \
--rm \
$$LINTER_IMAGE
endef
#############################
# Argument fix workaround
#############################
%:
@: