yak(make-checkverify-format-gate-rewrites-files-instead-of-checking-lnje): make check/verify format gate rewrites files instead of checking
This commit is contained in:
+14
-4
@@ -3,10 +3,12 @@
|
||||
MISE_BIN ?= mise
|
||||
MISE_EXEC = $(MISE_BIN) exec --
|
||||
|
||||
.PHONY: check precommit deps assets compile test test.coverage coverage crap format credo verify
|
||||
.PHONY: check precommit deps assets compile test test.coverage coverage crap format format.check credo verify
|
||||
|
||||
# Run all static analysis checks (no database required)
|
||||
check: credo format
|
||||
# Run all static analysis checks (no database required). `format.check` only
|
||||
# reports: a gate that rewrites the files it judges can never fail. Fix
|
||||
# formatting with `make format`.
|
||||
check: credo format.check
|
||||
|
||||
# Precommit target for CI/pre-commit hooks
|
||||
precommit: check compile
|
||||
@@ -62,10 +64,18 @@ crap:
|
||||
@test -f cover/default.coverdata || { echo "crap: no exported coverage - run 'make test.coverage' first" >&2; exit 1; }
|
||||
MIX_ENV=test $(MISE_EXEC) mix crap
|
||||
|
||||
# Format code
|
||||
# Format code. MUTATES the tree; deliberately not part of `check` (nor of the
|
||||
# Lens pass), which must never write: a gate that fixes what it judges can never
|
||||
# fail, and would dirty the tree a push is about to send. `make check` uses
|
||||
# `format.check` below instead.
|
||||
format:
|
||||
$(MISE_EXEC) mix format
|
||||
|
||||
# Verify formatting without writing. Fails with the offending files, so the fix
|
||||
# is explicit: run `make format` (or `make -C app format`).
|
||||
format.check:
|
||||
$(MISE_EXEC) mix format --check-formatted
|
||||
|
||||
# =============================================================================
|
||||
# Playwright e2e browser tests
|
||||
# =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user