.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 sobelow: MIX_ENV=test mix sobelow --config --quiet 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