-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (58 loc) · 1.68 KB
/
Copy pathMakefile
File metadata and controls
73 lines (58 loc) · 1.68 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
.PHONY: all
all: ## Show the available make targets.
@echo "Usage: make <target>"
@echo ""
@echo "Targets:"
@fgrep "##" Makefile | fgrep -v fgrep
.PHONY: clean
clean: ## Clean the temporary files.
rm -rf .pytest_cache
rm -rf .mypy_cache
rm -rf .ruff_cache
rm -rf megalinter-reports
rm -rf site
.PHONY: poetry-check
poetry-check: ## Validate pyproject and lock
poetry check || true
.PHONY: format
format: ## Run formatters
poetry run black src
poetry run ruff check src --fix
.PHONY: lint
lint:
poetry run black --check src
poetry run ruff check src
make mypy
.PHONY: test
test: ## Run pytest
poetry run pytest -n auto --cov=src --cov-report term-missing --cov-fail-under=90
.PHONY: mypy
mypy: ## Run mypy.
poetry run mypy --config-file mypy.ini src
.PHONY: install
install: ## Install the dependencies excluding dev and docs.
poetry lock
poetry install --only main --no-interaction
.PHONY: install-dev
install-dev: ## Install the dependencies including dev.
poetry lock
poetry install --with dev --no-interaction
.PHONY: install-docs
install-docs: ## Install the dependencies including docs.
poetry lock
poetry install --with docs --no-interaction
.PHONY: megalint
megalint: ## Run the mega-linter.
docker run --platform linux/amd64 --rm \
-v /var/run/docker.sock:/var/run/docker.sock:rw \
-v $(shell pwd):/tmp/lint:rw \
oxsecurity/megalinter:v8
.PHONY: docs-serve
docs-serve: ## Serve docs locally at http://localhost:8000
poetry run mkdocs serve
.PHONY: docs-build
docs-build: ## Build static docs site into ./site
poetry run mkdocs build --strict
.PHONY: docs-deploy
docs-deploy: ## Deploy docs to GitHub Pages via gh-deploy
poetry run mkdocs gh-deploy --force