-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (55 loc) · 1.72 KB
/
Copy pathMakefile
File metadata and controls
73 lines (55 loc) · 1.72 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
lib := pyinkr
exec := inkr
src := src/
RUFF ?= uvx ruff
BASEDPYRIGHT ?= uvx basedpyright
CODESPELL ?= uvx codespell
PYTHON ?= uv run python
##@ Development
.PHONY: run
run: # Run the code in a testing context
$(PYTHON) -m $(lib)
.PHONY: console
console: # Run the textual console
uv run textual console
.PHONY: dev
dev: # Run in development mode with hot reload
uv run textual run --dev -c "$(exec)"
.PHONY: setup
setup: # Set up the repository for development
uv venv --allow-existing
uv sync
##@ Checking
.PHONY: lint
lint: # Check the code for linting issues
$(RUFF) check $(src)
.PHONY: codestyle
codestyle: # Is the code formatted correctly?
$(RUFF) format --check $(src)
.PHONY: typecheck
typecheck: # Perform static type checks with basedpyright
$(BASEDPYRIGHT) $(src)
.PHONY: spellcheck
spellcheck: # Spell check the code
$(CODESPELL) *.md $(src)
.PHONY: checkall
checkall: spellcheck codestyle lint typecheck # Check all the things
##@ Utility
.PHONY: delint
delint: # Fix linting issues.
$(RUFF) check --fix $(src)
.PHONY: pep8ify
pep8ify: # Reformat the code to be as PEP8 as possible.
$(RUFF) format $(src)
.PHONY: tidy
tidy: delint pep8ify # Tidy up the code, fixing lint and format issues.
.PHONY: clean
clean: # Clean the package building files
rm -rf dist/ build/ $(src)*.egg-info .pytest_cache .ruff_cache
find . -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true
find . -name "*.pyc" -delete
.PHONY: help
help: # Display this help
@awk 'BEGIN {FS = ":.+# "} \
/^[a-zA-Z_-]+:.+# / {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2} \
/^##@/ {printf "\n\033[1m%s\033[0m\n", substr($$0, 5)}' $(MAKEFILE_LIST)