Skip to content

Commit 0ad6ca4

Browse files
dev: Makefile using Practicalli book task definitions
1 parent 108275b commit 0ad6ca4

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Changelog
22

33
## Unreleased
4-
- dev: spell lychee & repository trufflehog linters warn only (false positives)
4+
- dev: spell lychee & repository trufflehog linters warn only (false positives)
55
- dev: action/checkout v4 with sparse-checkout for megalinter
66
- dev: sparse-checkout for publish-book workflow
77
- dev: action/checkout v4 with sparse-checkout for changelog checker workflow
88
- mkdocs: update emoji extension name for material 9.4 and update readme
99

1010
### Added
1111
- building-api: add reitit overview and quick intro
12+
- dev: Makefile using Practicalli task definitions for books
1213

1314
### Changed
1415
- nav: refactor server-side-api to building-api

Makefile

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,65 +8,65 @@
88
# https://makefiletutorial.com/#phony
99
.PHONY: all clean docs lint pre-commit-check test
1010

11-
1211
# ------- Makefile Variables --------- #
13-
1412
# run help if no target specified
1513
.DEFAULT_GOAL := help
14+
SHELL := /usr/bin/zsh
1615

1716
# Column the target description is printed from
1817
HELP-DESCRIPTION-SPACING := 24
1918

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+
2023
# Makefile file and directory name wildcard
2124
EDN-FILES := $(wildcard *.edn)
22-
2325
# ------------------------------------ #
2426

25-
2627
# ------ Quality Checks ------------ #
27-
2828
pre-commit-check: lint
2929

3030
lint: ## Run MegaLinter with custom configuration (node.js required)
3131
$(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)
3433

3534
lint-fix: ## Run MegaLinter with custom configuration (node.js required)
3635
$(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
3837

3938
lint-clean: ## Clean MegaLinter report information
4039
$(info --------- MegaLinter Clean Reports ---------)
4140
- rm -rf ./megalinter-reports
4241

42+
megalinter-upgrade: ## Upgrade MegaLinter config to latest version
43+
$(info --------- MegaLinter Upgrade Config ---------)
44+
npx mega-linter-runner@latest --upgrade
4345
# ------------------------------------ #
4446

45-
4647
# --- Documentation Generation ------ #
47-
48-
docs: ## Build and run mkdocs in local server
48+
python-venv: ## Enable Python Virtual Environment for MkDocs
4949
$(info --------- Mkdocs Local Server ---------)
50-
mkdocs serve --dev-addr localhost:7777
50+
source ~/.local/venv/bin/activate
5151

52-
docs-changed: ## Build only changed files and run mkdocs in local server
52+
docs: ## Build and run mkdocs in local server (python venv)
5353
$(info --------- Mkdocs Local Server ---------)
54-
mkdocs serve --dirtyreload --dev-addr localhost:7777
54+
source ~/.local/venv/bin/activate && $(MKDOCS_SERVER)
5555

56-
docs-build: ## Build mkdocs
56+
docs-changed: ## Build only changed files and run mkdocs in local server (python venv)
5757
$(info --------- Mkdocs Local Server ---------)
58-
mkdocs build
58+
source ~/.local/venv/bin/activate && $(MKDOCS_SERVER) --dirtyreload
5959

60+
docs-build: ## Build mkdocs (python venv)
61+
$(info --------- Mkdocs Local Server ---------)
62+
source ~/.local/venv/bin/activate && mkdocs build
6063
# ------------------------------------ #
6164

62-
6365
# ------------ Help ------------------ #
64-
6566
# Source: https://nedbatchelder.com/blog/201804/makefile_help_target.html
6667

6768
help: ## Describe available tasks in Makefile
6869
@grep '^[a-zA-Z]' $(MAKEFILE_LIST) | \
6970
sort | \
7071
awk -F ':.*?## ' 'NF==2 {printf "\033[36m %-$(HELP-DESCRIPTION-SPACING)s\033[0m %s\n", $$1, $$2}'
71-
7272
# ------------------------------------ #

0 commit comments

Comments
 (0)