forked from shopware/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (23 loc) · 1.4 KB
/
Makefile
File metadata and controls
29 lines (23 loc) · 1.4 KB
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
#! /usr/bin/env make
user := "$(shell id -u):$(shell id -g)"
ignored = '/docs/resources/references/adr/* /docs/assets/adr/* /docs/resources/guidelines/code/core/* /docs/snippets/guide/*'
image = ghcr.io/rojopolis/spellcheck-github-actions:0.49.0
.PHONY : help spellcheck fix
.DEFAULT_GOAL : help
# This will output the help for each task. thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: ## Show this help
@printf "\033[33m%s:\033[0m\n" 'Available commands'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[32m%-18s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
spellcheck: ## Runs the spellcheck tool (via Docker)
docker run --rm -u ${user} -v "$(shell pwd):/docs" -w /docs -e INPUT_IGNORE=${ignored} ${image} \
--config /docs/markdown-style-config.yml /docs
spellcheck-local: ## Runs the spellcheck tool locally (requires aspell and pyspelling)
@if [ ! -d ".venv-spellcheck" ]; then \
echo "Creating virtual environment and installing dependencies..."; \
python3 -m venv .venv-spellcheck && \
.venv-spellcheck/bin/pip install -q pyspelling pymdown-extensions markdown; \
fi
@.venv-spellcheck/bin/pyspelling -c .spellcheck.yml
fix: ## Runs the linting tool and fixes simple mistakes
docker run --rm -u ${user} -v "$(shell pwd):/docs" -e INPUT_FIX=true -e INPUT_IGNORE=${ignored} avtodev/markdown-lint:v1.5 \
--config /docs/markdown-style-config.yml /docs