fix: use Makefile for precommit — each step runs in isolated shell with MIX_ENV=test

This commit is contained in:
Graham McInitre 2026-07-21 11:08:45 -05:00
parent e186c4c4ef
commit 343c8ea339
2 changed files with 16 additions and 6 deletions

15
Makefile Normal file
View file

@ -0,0 +1,15 @@
.PHONY: precommit format test deps credo
precommit: format test deps credo
format:
MIX_ENV=test mix format --check-formatted
test:
MIX_ENV=test mix test
deps:
MIX_ENV=test mix deps.unlock --check-unused
credo:
MIX_ENV=test mix credo --strict

View file

@ -165,12 +165,7 @@ defmodule Microwaveprop.MixProject do
&copy_leaflet_images/1,
"phx.digest"
],
precommit: [
"format --check-formatted",
"cmd sh -c 'MIX_ENV=test mix test'",
"deps.unlock --check-unused",
"cmd sh -c 'MIX_ENV=test mix credo --strict'"
]
precommit: ["cmd make precommit"]
]
end