Skip to content

Commit 7e86175

Browse files
authored
Add help target in Makefile + rename typecheck to type-check (#6)
Adds a help target to `Makefile` similar to what I did for Ruby which uses comments on targets to produce a list of targets along with some minimal documentation: $ make help help Print this message fmt Autoformat code with Rye/Ruff lint Run linter with Rye/Ruff test Run test suite with Rye/pytest type-check Run type check with MyPy It also runs as the default target, so `help` can be omitted: $ make help Print this message fmt Autoformat code with Rye/Ruff lint Run linter with Rye/Ruff test Run test suite with Rye/pytest type-check Run type check with MyPy Rename `typecheck` to `type-check` to match the same target in the Ruby project so that we're consistent across all projects. [1] riverqueue/riverqueue-ruby#19
1 parent 7791bbf commit 7e86175

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
- name: Lint
2727
run: rye lint
2828

29-
- name: Typecheck
30-
run: make typecheck
29+
- name: Type check
30+
run: make type-check
3131

3232
- name: Build
3333
run: rye build

Makefile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1+
.DEFAULT_GOAL := help
2+
3+
# Looks at comments using ## on targets and uses them to produce a help output.
4+
.PHONY: help
5+
help: ALIGN=14
6+
help: ## Print this message
7+
@awk -F ': .*## ' -- "/^[^':]+: .*## /"' { printf "'$$(tput bold)'%-$(ALIGN)s'$$(tput sgr0)' %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
8+
19
.PHONY: fmt
2-
fmt:
10+
fmt: ## Autoformat code with Rye/Ruff
311
rye fmt
412

513
.PHONY: lint
6-
lint:
14+
lint: ## Run linter with Rye/Ruff
715
rye lint
816

917
.PHONY: test
10-
test:
18+
test: ## Run test suite with Rye/pytest
1119
rye test
1220

13-
.PHONY: typecheck
14-
typecheck:
21+
.PHONY: type-check
22+
type-check: ## Run type check with MyPy
1523
rye run mypy -p riverqueue -p tests

0 commit comments

Comments
 (0)