|
1 | 1 | lib := oldas |
2 | 2 | src := src/ |
| 3 | +tests := tests/ |
3 | 4 | docs := docs/ |
4 | 5 | run := uv run --env-file .env |
5 | 6 | sync := uv sync |
6 | 7 | build := uv build |
7 | 8 | publish := uv publish --username=__token__ --keyring-provider=subprocess |
| 9 | +test := $(run) pytest |
8 | 10 | python := $(run) python |
9 | 11 | ruff := $(run) ruff |
10 | 12 | lint := $(ruff) check --select I |
@@ -38,26 +40,30 @@ resetup: realclean # Recreate the virtual environment from scratch |
38 | 40 | # Checking/testing/linting/etc. |
39 | 41 | .PHONY: lint |
40 | 42 | lint: # Check the code for linting issues |
41 | | - $(lint) $(src) |
| 43 | + $(lint) $(src) $(tests) |
42 | 44 |
|
43 | 45 | .PHONY: codestyle |
44 | 46 | codestyle: # Is the code formatted correctly? |
45 | | - $(fmt) --check $(src) |
| 47 | + $(fmt) --check $(src) $(tests) |
46 | 48 |
|
47 | 49 | .PHONY: typecheck |
48 | 50 | typecheck: # Perform static type checks with mypy |
49 | | - $(mypy) --scripts-are-modules $(src) |
| 51 | + $(mypy) --scripts-are-modules $(src) $(tests) |
50 | 52 |
|
51 | 53 | .PHONY: stricttypecheck |
52 | 54 | stricttypecheck: # Perform a strict static type checks with mypy |
53 | | - $(mypy) --scripts-are-modules --strict $(src) |
| 55 | + $(mypy) --scripts-are-modules --strict $(src) $(tests) |
| 56 | + |
| 57 | +.PHONY: test |
| 58 | +test: # Run the unit tests |
| 59 | + $(test) -v |
54 | 60 |
|
55 | 61 | .PHONY: spellcheck |
56 | 62 | spellcheck: # Spell check the code |
57 | | - $(spell) *.md $(src) $(docs) |
| 63 | + $(spell) *.md $(src) $(docs) $(tests) |
58 | 64 |
|
59 | 65 | .PHONY: checkall |
60 | | -checkall: spellcheck codestyle lint stricttypecheck # Check all the things |
| 66 | +checkall: spellcheck codestyle lint stricttypecheck test # Check all the things |
61 | 67 |
|
62 | 68 | ############################################################################## |
63 | 69 | # Documentation. |
@@ -103,7 +109,7 @@ delint: # Fix linting issues. |
103 | 109 |
|
104 | 110 | .PHONY: pep8ify |
105 | 111 | pep8ify: # Reformat the code to be as PEP8 as possible. |
106 | | - $(fmt) $(src) |
| 112 | + $(fmt) $(src) $(tests) |
107 | 113 |
|
108 | 114 | .PHONY: tidy |
109 | 115 | tidy: delint pep8ify # Tidy up the code, fixing lint and format issues. |
|
0 commit comments