-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (44 loc) · 1.82 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
default: help
PYTHON_VERSION=3
VENV_DIR=venv
SHELL := /bin/bash
.PHONY: install
install: ## Creates a development environment and install the required dependencies.
python$(PYTHON_VERSION) -m venv $(VENV_DIR)
$(VENV_DIR)/bin/pip install --upgrade pip
$(VENV_DIR)/bin/pip install --upgrade pip-tools
$(VENV_DIR)/bin/pip-compile --upgrade requirements.in
$(VENV_DIR)/bin/pip-sync requirements.txt
.PHONY: update-venv
update-venv: ## Updates the development environment.
$(VENV_DIR)/bin/pip install --upgrade pip
$(VENV_DIR)/bin/pip-compile --upgrade requirements.in
$(VENV_DIR)/bin/pip-sync requirements.txt
.PHONY: serve
serve: ## Starts a lightweight development Web server on the local machine.
$(VENV_DIR)/bin/mkdocs serve --dev-addr '127.0.0.1:8000'
.PHONY: build
build: ## Builds the documentation.
$(VENV_DIR)/bin/mkdocs build
.PHONY: quickstart
quickstart: install serve ## Quicktart demo app.
.PHONY: install-linter
install-linter: ## install markdown-lint
npm install markdownlint-cli2 --save-dev
.PHONY: install-linkcheck
install-linkcheck: ## install Link checker
npm install --save-dev markdown-link-check
.PHONY: lint
lint: ## Lint all .md files in the src directory
npx markdownlint-cli2 "src/**/*.md" "\#node_modules" --config .markdownlint.json
.PHONY: lint-fix
lint-fix: ## Lint all .md files in the src directory
npx markdownlint-cli2 "src/**/*.md" "\#node_modules" --config .markdownlint.json --fix
.PHONY: linkcheck
linkcheck: ## check all files for broken links
find ./src/ -name \*.md -print0 | xargs -0 -n1 markdown-link-check -c mlc_config.json -q
.PHONY: check
check: lint linkcheck ## Run Github Action validation
.PHONY: help
help: ## Lists all available commands.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'