-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Makefile
72 lines (46 loc) · 2.18 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# ------------------------------------------
# Practicalli: Makefile
#
# Consistent set of targets to support local book development
# ------------------------------------------
# .PHONY: ensures target used rather than matching file name
# https://makefiletutorial.com/#phony
.PHONY: all clean docs lint pre-commit-check test
# ------- Makefile Variables --------- #
# run help if no target specified
.DEFAULT_GOAL := help
# Column the target description is printed from
HELP-DESCRIPTION-SPACING := 24
# Makefile file and directory name wildcard
EDN-FILES := $(wildcard *.edn)
# ------------------------------------ #
# ------ Quality Checks ------------ #
pre-commit-check: lint
lint: ## Run MegaLinter with custom configuration (node.js required)
$(info --------- MegaLinter Runner ---------)
npx mega-linter-runner --flavor documentation --env "'MEGALINTER_CONFIG=.github/config/megalinter.yaml'" --remove-container
lint-fix: ## Run MegaLinter with custom configuration (node.js required)
$(info --------- MegaLinter Runner ---------)
npx mega-linter-runner --fix --flavor documentation --release beta --env "'MEGALINTER_CONFIG=.github/config/megalinter.yaml'" --remove-container
lint-clean: ## Clean MegaLinter report information
$(info --------- MegaLinter Clean Reports ---------)
- rm -rf ./megalinter-reports
# ------------------------------------ #
# --- Documentation Generation ------ #
docs: ## Build and run mkdocs in local server
$(info --------- Mkdocs Local Server ---------)
mkdocs serve --dev-addr localhost:7777
docs-changed: ## Build only changed files and run mkdocs in local server
$(info --------- Mkdocs Local Server ---------)
mkdocs serve --dirtyreload --dev-addr localhost:7777
docs-build: ## Build mkdocs
$(info --------- Mkdocs Local Server ---------)
mkdocs build
# ------------------------------------ #
# ------------ Help ------------------ #
# Source: https://nedbatchelder.com/blog/201804/makefile_help_target.html
help: ## Describe available tasks in Makefile
@grep '^[a-zA-Z]' $(MAKEFILE_LIST) | \
sort | \
awk -F ':.*?## ' 'NF==2 {printf "\033[36m %-$(HELP-DESCRIPTION-SPACING)s\033[0m %s\n", $$1, $$2}'
# ------------------------------------ #