-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (51 loc) · 1.19 KB
/
Makefile
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
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.RECIPEPREFIX = >
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
# This should be the first rule so that it runs by default when running `$ make`
# without arguments.
help:
> @echo "Targets:"
> grep -P '^([\w-]+)(?=:)' --only-matching Makefile | sort
.PHONY: default
clean:
> rm -rf dist out
.PHONY: clean
install:
> poetry install
.PHONY: install
test:
> pytest
.PHONY: test
test-cov:
> pytest --cov=v8serialize --cov-report=html
.PHONY: test
out/:
> mkdir out
typecheck:
> @if dmypy status; then
> dmypy run src test
> else
> mypy src test
> fi
.PHONY: typecheck
lint: check-code-issues check-code-import-order check-code-format check-misc-file-formatting
.PHONY: lint
check-code-issues:
> ruff check src test
.PHONY: check-code-issues
check-code-format:
> ruff format --check src test
.PHONY: check-code-format
check-misc-file-formatting:
> npx prettier --check .
.PHONY: check-misc-file-formatting
reformat-code:
> @if [[ "$$(git status --porcelain)" != "" ]]; then
> echo "Refusing to reformat code: files have uncommitted changes" >&2 ; exit 1
> fi
> ruff format src test
.PHONY: reformat-code