prop/Makefile
Graham McIntire 959f3a3f69
Some checks failed
Build and Push / Build and Push Docker Image (push) Failing after 4m31s
Fix LiveView crashes and stabilize test suite
2026-08-01 09:26:47 -05:00

49 lines
1.5 KiB
Makefile

.PHONY: precommit format test deps credo xref audit hex-audit cargo-audit deps-audit sobelow
# Runs every code-quality check from Mike Zornek's "Guarding Against AI Drift"
# article in one shot. The agent and CI both gate on this alias.
precommit:
@EXIT=0; \
$(MAKE) format || EXIT=1; \
$(MAKE) test || EXIT=1; \
$(MAKE) deps || EXIT=1; \
$(MAKE) credo || EXIT=1; \
$(MAKE) xref || EXIT=1; \
exit $$EXIT
# Security audit targets — run independently (network-dependent, not in precommit).
# Per Zornek: security scanning lives in its own CI job so a red mark there clearly
# means "a dependency needs attention" rather than "your own code has a style problem."
audit: hex-audit cargo-audit deps-audit sobelow
hex-audit:
MIX_ENV=test mix hex.audit
deps-audit:
MIX_ENV=test mix deps.audit
cargo-audit:
cargo audit --file rust/prop_grid_rs/Cargo.lock
format:
MIX_ENV=test mix format --check-formatted
test:
MIX_ENV=test mix test --warnings-as-errors
deps:
MIX_ENV=test mix deps.unlock --check-unused
credo:
MIX_ENV=test mix credo --strict
# Catches compile-time coupling creep. Fails if a change introduces new
# compile-time dependencies between modules (which balloon recompile times).
# Baselines at the current 4 pre-existing LiveView→band_config deps.
xref:
MIX_ENV=test mix xref graph --label compile-connected --fail-above 4
# Security-focused static analysis for Phoenix apps. Catches XSS, CSRF,
# insecure config, and other common web vulnerabilities.
sobelow:
MIX_ENV=test mix sobelow --config --quiet