1
1
# -------------------------------------- #
2
- # Practicalli: Makefile
2
+ # Practicalli Makefile
3
3
#
4
4
# Consistent set of targets to support local book development
5
5
# -------------------------------------- #
8
8
# .PHONY: ensures target used rather than matching file name
9
9
# https://makefiletutorial.com/#phony
10
10
.PHONY : all clean docs lint pre-commit-check test
11
- # -- Makefile Variables ---------------- #
11
+ # ---------------------- ---------------- #
12
12
13
13
# -- Makefile Variables ---------------- #
14
14
# run help if no target specified
15
15
.DEFAULT_GOAL := help
16
- SHELL := /usr/bin/zsh
17
-
18
16
# Column the target description is printed from
19
17
HELP-DESCRIPTION-SPACING := 24
20
18
21
- # Tool variables
22
- MEGALINTER_RUNNER := npx mega-linter-runner --flavor documentation --env "'MEGALINTER_CONFIG=.github/config/megalinter.yaml'" --remove-container
19
+ SHELL := /usr/bin/zsh
20
+
21
+ # Tool Commands
22
+ MEGALINTER_RUNNER := npx mega-linter-runner --flavor documentation --env "'MEGALINTER_CONFIG=.github/config/megalinter.yaml'" --env "'VALIDATE_ALL_CODEBASE=true'" --remove-container
23
23
MKDOCS_SERVER := mkdocs serve --dev-addr localhost:7777
24
24
OUTDATED_FILE := outdated-$(shell date +% y-% m-% d-% T) .md
25
25
# -------------------------------------- #
26
26
27
- # -- Help ------------------------------ #
28
- # Source: https://nedbatchelder.com/blog/201804/makefile_help_target.html
29
-
30
- help : # # Describe available tasks in Makefile
31
- @grep ' ^[a-zA-Z]' $(MAKEFILE_LIST ) | \
32
- sort | \
33
- awk -F ' :.*?## ' ' NF==2 {printf "\033[36m %-$(HELP-DESCRIPTION-SPACING)s\033[0m %s\n", $$1, $$2}'
34
- # -------------------------------------- #
35
-
36
-
37
- # ------ Quality Checks -------------- #
27
+ # -- Quality Checks ------------------ #
38
28
pre-commit-check : lint
39
29
40
30
lint : # # Run MegaLinter with custom configuration (node.js required)
41
- $(info --------- MegaLinter Runner ---------)
31
+ $(info -- MegaLinter Runner ------------ ---------)
42
32
$(MEGALINTER_RUNNER )
43
33
44
- lint-fix : # # Run MegaLinter with custom configuration (node.js required)
45
- $(info --------- MegaLinter Runner ---------)
34
+ lint-fix : # # Run MegaLinter with applied fixes and custom configuration (node.js required)
35
+ $(info -- MegaLinter Runner fix errors - ---------)
46
36
$(MEGALINTER_RUNNER ) --fix
47
37
48
38
lint-clean : # # Clean MegaLinter report information
49
- $(info --------- MegaLinter Clean Reports ---------)
39
+ $(info -- MegaLinter Clean Reports ----- ---------)
50
40
- rm -rf ./megalinter-reports
51
41
52
42
megalinter-upgrade : # # Upgrade MegaLinter config to latest version
53
- $(info --------- MegaLinter Upgrade Config ---------)
43
+ $(info -- MegaLinter Upgrade Config ---- ---------)
54
44
npx mega-linter-runner@latest --upgrade
55
45
56
46
dependencies-outdated : # # Report new versions of library dependencies and GitHub action
@@ -62,29 +52,18 @@ dependencies-update: ## Update all library dependencies and GitHub action
62
52
- clojure -T:update/dependency-versions > $(OUTDATED_FILE )
63
53
# -------------------------------------- #
64
54
65
- # ------- Version Control -------------- #
66
- git-sr : # # status list of git repos under current directory
67
- $(info -- Multiple Git Repo Status --------------)
68
- mgitstatus -e --flatten
69
-
70
- git-status : # # status details of git repos under current directory
71
- $(info -- Multiple Git Status -------------------)
72
- mgitstatus
73
- # -------------------------------------- #
74
-
75
55
# --- Documentation Generation -------- #
76
-
77
56
python-venv : # # Create Python Virtual Environment
78
57
$(info -- Create Python Virtual Environment -----)
79
58
python3 -m venv ~ /.local/venv
80
59
81
- python-venv- activate : # # Active Python Virtual Environment
60
+ python-activate : # # Activate Python Virtual Environment for MkDocs
82
61
$(info -- Mkdocs Local Server -------------------)
83
62
source ~ /.local/venv/bin/activate
84
63
85
64
mkdocs-install :
86
65
$(info -- Install Material for MkDocs -----------)
87
- source ~ /.local/venv/bin/activate; pip install mkdocs-material mkdocs-callouts mkdocs-glightbox mkdocs-git-revision-date-localized-plugin mkdocs-redirects mkdocs-rss-plugin pillow cairosvg --upgrade
66
+ source ~ /.local/venv/bin/activate && pip install mkdocs-material mkdocs-callouts mkdocs-glightbox mkdocs-git-revision-date-localized-plugin mkdocs-redirects mkdocs-rss-plugin pillow cairosvg --upgrade
88
67
89
68
docs : # # Build and run mkdocs in local server (python venv)
90
69
$(info -- MkDocs Local Server -------------------)
@@ -95,7 +74,35 @@ docs-changed: ## Build only changed files and run mkdocs in local server (pytho
95
74
source ~ /.local/venv/bin/activate && $(MKDOCS_SERVER ) --dirtyreload
96
75
97
76
docs-build : # # Build mkdocs (python venv)
98
- $(info -- Mkdocs Local Server - ------------------)
77
+ $(info -- Mkdocs Build Website ------------------)
99
78
source ~ /.local/venv/bin/activate && mkdocs build
79
+
80
+ docs-debug : # # Run mkdocs local server in debug mode (python venv)
81
+ $(info -- Mkdocs Local Server Debug -------------)
82
+ . ~ /.local/venv/bin/activate; $(MKDOCS_SERVER ) -v
83
+
84
+ docs-staging : # # Deploy to staging repository
85
+ $(info -- Mkdocs Staging Deploy -----------------)
86
+ source ~ /.local/venv/bin/activate && mkdocs gh-deploy --force --no-history --config-file mkdocs-staging.yml
87
+ # -------------------------------------- #
88
+
89
+ # ------- Version Control -------------- #
90
+ git-sr : # # status list of git repos under current directory
91
+ $(info -- Multiple Git Repo Status --------------)
92
+ mgitstatus -e --flatten
93
+
94
+ git-status : # # status details of git repos under current directory
95
+ $(info -- Multiple Git Status -------------------)
96
+ mgitstatus
97
+ # -------------------------------------- #
98
+
99
+ # ------------ Help -------------------- #
100
+ # Source: https://nedbatchelder.com/blog/201804/makefile_help_target.html
101
+
102
+ help : # # Describe available tasks in Makefile
103
+ @grep ' ^[a-zA-Z]' $(MAKEFILE_LIST ) | \
104
+ sort | \
105
+ awk -F ' :.*?## ' ' NF==2 {printf "\033[36m %-$(HELP-DESCRIPTION-SPACING)s\033[0m %s\n", $$1, $$2}'
100
106
# -------------------------------------- #
101
107
108
+ dist : deps-build # # Build mkdocs website
0 commit comments