5.8 One recipe for every check
Build it yourself. Read the tutorial 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
If you start at this part, make your clone as Get the project says, and then run this command. It puts in your clone the files that this part starts from. A file that the project deleted before this part stays, so delete it if git check lists it:
git rm -rq --cached --ignore-unmatch -- :/ && git restore --source 693a713a458d --staged --worktree -- :/just 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.
Apply the patch to justfile, from the top of the project:
curl -fsSL https://github.com/rahuldave/cheesecracker/commit/e89e0cfa991257757c887f687087a9c77c093e20.diff | git apply --include=justfileRead the recipe check at the end of the justfile.
just checkjust prints each command, and the last line is 21 passed.
Check your files against this move. The command prints nothing when they match, and otherwise shows what differs:
git check e89e0cfa9912If you are stuck, this command puts the files of this move in place of yours. A file that you made yourself stays:
git fetch --quiet --tags --force origin; git restore --source 693a713a458d --staged -- :/ && git restore --source step-05 --staged --worktree -- :/What changed
justfile: the recipecheck. 6 lines added. The file- look at
just fmt --check
- look at
The patch to 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