5.8 One recipe for every check
Read the tutorial. Build it yourself is the other way to read this part.
This walk goes through rahuldave/cheesecracker on GitHub. This part starts from the code at 693a713a458d, partway through step-05. The code before this part
To look at this code on your machine, run these commands. The first one makes a clone, if this folder has none:
[ -d cheesecracker ] || git clone https://github.com/rahuldave/cheesecracker
cd cheesecracker
git fetch --quiet --tags --force origin
git switch --detach 693a713a458djust setupThe layout, the rules and the tests each have a recipe. One recipe, just check, runs them all.
5.8 just check runs every check
The layout, the rules and the tests each have a recipe now. The recipe check runs all three, and stops at the
first that fails.
The recipe check, at the end of the justfile, runs just fmt --check, just lint and just test -q, in that
order.
just checkjust prints each command, and the last line is 21 passed.
What changed
justfile: the recipecheck. 6 lines added. The file- look at
just fmt --check
- look at
The diff of justfile
@@ -52,3 +52,9 @@ fmt *args:
# Check the code against the rules in pyproject.toml. Extra arguments go to ruff: just lint --fix
lint *args:
uv run ruff check "$@"
+
+# Everything a commit must pass: the format, the lint and the tests
+check:
+ just fmt --check
+ just lint
+ just test -qThis part ends at the code at step-05. The code after this part