Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (75 loc) · 2.35 KB
/
Copy pathMakefile
File metadata and controls
95 lines (75 loc) · 2.35 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
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# -- General
SHELL := /bin/bash
# ==============================================================================
# RULES
default: help
docs/user-guide/commands.md:
uv run python scripts/gen-cli-docs.py
# -- Build
bootstrap: ## bootstrap the project for development
bootstrap: \
build
.PHONY: bootstrap
build: ## install project
uv sync --locked --all-extras --dev
.PHONY: build
cmd-docs: ## Make command docs
$(MAKE) -B docs/user-guide/commands.md
docs-serve: ## run documentation server
docs-serve: docs/user-guide/commands.md
uv run mkdocs serve -w docs
.PHONY: docs-serve
docs-publish: ## publish documentation
uv run mkdocs gh-deploy --force
.PHONY: docs-publish
# -- Quality
lint: ## lint all sources
lint: \
lint-format \
lint-ruff \
lint-codespell \
lint-markdown
.PHONY: lint
lint-format: ## format python sources with ruff format
@echo 'lint:format started…'
uv run ruff format watson tests scripts
.PHONY: lint-format
lint-format-check: ## check python sources formatting with ruff format
@echo 'lint:format check started…'
uv run ruff format --check watson tests scripts
.PHONY: lint-format-check
lint-ruff: ## lint python sources with ruff
@echo 'lint:ruff started…'
uv run ruff check watson tests scripts
.PHONY: lint-ruff
lint-ruff-fix: ## lint and fix python sources with ruff
@echo 'lint:ruff-fix started…'
uv run ruff check --fix watson tests scripts
.PHONY: lint-ruff-fix
lint-codespell: ## check spelling with codespell
@echo 'lint:codespell started…'
uv run codespell
.PHONY: lint-codespell
lint-codespell-fix: ## check and fix spelling with codespell
@echo 'lint:codespell-fix started…'
uv run codespell --write-changes
.PHONY: lint-codespell-fix
lint-markdown: ## lint markdown sources with rumdl
@echo 'lint:markdown started…'
uv run rumdl check .
.PHONY: lint-markdown
lint-markdown-fix: ## lint and fix markdown sources with rumdl
@echo 'lint:markdown-fix started…'
uv run rumdl check --fix .
.PHONY: lint-markdown-fix
test: ## run tests
uv run pytest --cov --cov-report=term-missing --cov-report=html
.PHONY: test
completion-scripts:
scripts/create-completion-script.sh bash
scripts/create-completion-script.sh zsh
.PHONY: completion-scripts
# -- Misc
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help