-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
32 lines (22 loc) · 729 Bytes
/
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
.PHONY: ci fmt fmt-check help lint precommit test type-check
.DEFAULT_GOAL := help
SRCS := ./src ./test
ALLOW := --allow-env --allow-read --allow-run --allow-write
FLAG := --unstable-byonm
TEST_FLAG := ${FLAG}
ci: fmt-check lint type-check test
fmt: ## Format code
deno fmt ${FLAG} -- ${SRCS}
fmt-check: ## Format check
deno fmt --check ${FLAG} -- ${SRCS}
help:
@cat $(MAKEFILE_LIST) | \
perl -ne 'if(/^\w+.*##/){s/(.*):.*##\s*/sprintf("%-20s",$$1)/eg;print}'
lint: ## Lint code
deno lint ${FLAG} -- ${SRCS}
precommit: fmt
test: ## Test
deno test --no-check ${TEST_FLAG} ${ALLOW} --parallel
type-check: ## Type check
deno test --no-run ${TEST_FLAG} \
-- $$(find ${SRCS} -name '*.ts' -not -name '.deno')