|
8 | 8 | # https://makefiletutorial.com/#phony |
9 | 9 | .PHONY: all clean docs lint pre-commit-check test |
10 | 10 |
|
11 | | - |
12 | 11 | # ------- Makefile Variables --------- # |
13 | | - |
14 | 12 | # run help if no target specified |
15 | 13 | .DEFAULT_GOAL := help |
| 14 | +SHELL := /usr/bin/zsh |
16 | 15 |
|
17 | 16 | # Column the target description is printed from |
18 | 17 | HELP-DESCRIPTION-SPACING := 24 |
19 | 18 |
|
| 19 | +# Tool Commands |
| 20 | +MEGALINTER_RUNNER := npx mega-linter-runner --flavor documentation --env "'MEGALINTER_CONFIG=.github/config/megalinter.yaml'" --env "'VALIDATE_ALL_CODEBASE=true'" --remove-container |
| 21 | +MKDOCS_SERVER := mkdocs serve --dev-addr localhost:7777 |
| 22 | + |
20 | 23 | # Makefile file and directory name wildcard |
21 | 24 | EDN-FILES := $(wildcard *.edn) |
22 | | - |
23 | 25 | # ------------------------------------ # |
24 | 26 |
|
25 | | - |
26 | 27 | # ------ Quality Checks ------------ # |
27 | | - |
28 | 28 | pre-commit-check: lint |
29 | 29 |
|
30 | 30 | lint: ## Run MegaLinter with custom configuration (node.js required) |
31 | 31 | $(info --------- MegaLinter Runner ---------) |
32 | | - npx mega-linter-runner --flavor documentation --release beta --env "'MEGALINTER_CONFIG=.github/config/megalinter.yaml'" --remove-container |
33 | | - |
| 32 | + $(MEGALINTER_RUNNER) |
34 | 33 |
|
35 | 34 | lint-fix: ## Run MegaLinter with custom configuration (node.js required) |
36 | 35 | $(info --------- MegaLinter Runner ---------) |
37 | | - npx mega-linter-runner --fix --flavor documentation --release beta --env "'MEGALINTER_CONFIG=.github/config/megalinter.yaml'" --remove-container |
| 36 | + $(MEGALINTER_RUNNER) --fix |
38 | 37 |
|
39 | 38 | lint-clean: ## Clean MegaLinter report information |
40 | 39 | $(info --------- MegaLinter Clean Reports ---------) |
41 | 40 | - rm -rf ./megalinter-reports |
42 | 41 |
|
| 42 | +megalinter-upgrade: ## Upgrade MegaLinter config to latest version |
| 43 | + $(info --------- MegaLinter Upgrade Config ---------) |
| 44 | + npx mega-linter-runner@latest --upgrade |
43 | 45 | # ------------------------------------ # |
44 | 46 |
|
45 | | - |
46 | 47 | # --- Documentation Generation ------ # |
47 | | - |
48 | | -docs: ## Build and run mkdocs in local server |
| 48 | +python-venv: ## Enable Python Virtual Environment for MkDocs |
49 | 49 | $(info --------- Mkdocs Local Server ---------) |
50 | | - mkdocs serve --dev-addr localhost:7777 |
| 50 | + source ~/.local/venv/bin/activate |
51 | 51 |
|
52 | | -docs-changed: ## Build only changed files and run mkdocs in local server |
| 52 | +docs: ## Build and run mkdocs in local server (python venv) |
53 | 53 | $(info --------- Mkdocs Local Server ---------) |
54 | | - mkdocs serve --dirtyreload --dev-addr localhost:7777 |
| 54 | + source ~/.local/venv/bin/activate && $(MKDOCS_SERVER) |
55 | 55 |
|
56 | | -docs-build: ## Build mkdocs |
| 56 | +docs-changed: ## Build only changed files and run mkdocs in local server (python venv) |
57 | 57 | $(info --------- Mkdocs Local Server ---------) |
58 | | - mkdocs build |
| 58 | + source ~/.local/venv/bin/activate && $(MKDOCS_SERVER) --dirtyreload |
59 | 59 |
|
| 60 | +docs-build: ## Build mkdocs (python venv) |
| 61 | + $(info --------- Mkdocs Local Server ---------) |
| 62 | + source ~/.local/venv/bin/activate && mkdocs build |
60 | 63 | # ------------------------------------ # |
61 | 64 |
|
62 | | - |
63 | 65 | # ------------ Help ------------------ # |
64 | | - |
65 | 66 | # Source: https://nedbatchelder.com/blog/201804/makefile_help_target.html |
66 | 67 |
|
67 | 68 | help: ## Describe available tasks in Makefile |
68 | 69 | @grep '^[a-zA-Z]' $(MAKEFILE_LIST) | \ |
69 | 70 | sort | \ |
70 | 71 | awk -F ':.*?## ' 'NF==2 {printf "\033[36m %-$(HELP-DESCRIPTION-SPACING)s\033[0m %s\n", $$1, $$2}' |
71 | | - |
72 | 72 | # ------------------------------------ # |
0 commit comments