A pre-commit / prek hook that runs just --fmt on every just file it finds and auto-fixes them: justfile,
.justfile, Justfile and *.just modules. Files that need no change are left alone; a file just cannot parse
fails the hook with the just error.
just must be on PATH (the hook fails with a message otherwise). Add to .pre-commit-config.yaml:
- repo: https://github.com/Alirex/pre-commit-just
rev: "v0.2.2"
hooks:
- id: format-justfileWorks the same with pre-commit and prek, on Linux and macOS (bash 3.2). In CI, install just first, for example
uv tool install rust-just.
just dev-hooks # install the git hook (needs prek)
just q-check # every prek hook on all files, then tests/test.sh
just # all recipestests/test.sh runs the script directly and through prek try-repo.
This work is licensed under the ISC license, a copy of which can be found at LICENSE.txt.
just itself is licensed under the CC0 license.
Generated from needs.yaml (scripts/needs.py render).
| Need | Contexts | Level | Why |
|---|---|---|---|
bash (tool) |
run, develop, test, ci | required | the hook is a bash 3.2 script (macOS ships 3.2) |
just (tool) |
run, develop, test, ci | required | the hook runs just --fmt and fails without just on PATH |
git (tool) |
develop, test, ci, release | required | the hook runs in git repos; tests build scratch repos; tags make releases |
prek (tool) |
develop, test, ci | required | runs the quality gate hooks; tests/test.sh runs the hook through prek try-repo |
uv (tool) |
develop, ci | required | installs prek and rust-just (uv tool install) |
node (tool) |
develop, ci | required | the markdownlint and prettier hooks need Node.js on PATH |
gh (tool) |
develop, release | optional | watch CI runs and the release workflow |
github.com (network) |
develop, test, ci | required | prek fetches hook repos, tests run prek try-repo, pushes go to GitHub |