Root verify runs check first, then a per-app verify in each Makefile: sensor slots hooked to VERIFY_SENSORS (empty today, so nothing is claimed that is not run) and then that app's suite. Measured: 9.9s wall, app 178 + blogex 156 tests.
53 lines
1.8 KiB
Makefile
53 lines
1.8 KiB
Makefile
# Makefile for Blogex library
|
|
|
|
MISE_BIN ?= mise
|
|
MISE_EXEC = $(MISE_BIN) exec --
|
|
|
|
.PHONY: check precommit deps compile test format verify
|
|
|
|
# Cheap static gate for this library (no database, no coverage). Runs from the
|
|
# root `make check`, which loops app then blogex.
|
|
#
|
|
# Sensor slot: add `credo` once the "credo strict, tuned config (both apps)"
|
|
# yak lands blogex's credo dep + .credo.exs. Do not list it before then — a
|
|
# gate that claims a check it did not run is worse than no gate.
|
|
check: compile format
|
|
|
|
# Per-app precommit loop: same target name and alias shape as app/, so both
|
|
# apps share one habit (compile --warning-as-errors, format, test).
|
|
precommit:
|
|
$(MISE_EXEC) mix precommit
|
|
|
|
# Sync dependencies
|
|
deps:
|
|
$(MISE_EXEC) mix deps.get
|
|
|
|
# Compile the project (warnings are fatal)
|
|
compile:
|
|
$(MISE_EXEC) mix compile --warnings-as-errors
|
|
|
|
# Run the test suite
|
|
test: deps
|
|
$(MISE_EXEC) mix test
|
|
|
|
# Format code
|
|
format:
|
|
$(MISE_EXEC) mix format
|
|
|
|
# =============================================================================
|
|
# Lens pass (heavy checks; root `make verify` runs this before every push)
|
|
# =============================================================================
|
|
#
|
|
# Sensor slots, cheapest first. Add a sensor as its yak lands, both as a target
|
|
# and to VERIFY_SENSORS — that variable is the single source of truth for what
|
|
# this target reports as wired.
|
|
# - coverage (yak: coverage floors + framework-glue exclusions policy)
|
|
# - crap (yak: CRAP scores with ex_crap (both apps))
|
|
# - mutation (yak: mutation testing with muex — a sensor, not a gate)
|
|
VERIFY_SENSORS :=
|
|
|
|
verify:
|
|
@echo "==> verify(blogex): sensors [$(if $(VERIFY_SENSORS),$(VERIFY_SENSORS),none wired yet)]"
|
|
@for sensor in $(VERIFY_SENSORS); do $(MAKE) $$sensor || exit 1; done
|
|
@$(MAKE) test
|