## Summary
Closes#1779
- Add `--all` flag to `prek uninstall` that scans the hooks directory
and removes every prek-managed hook (detected via `is_our_script()`),
regardless of hook type
- Without `--all`, behavior is unchanged: uses `-t` or
`default_install_hook_types`, falls back to `pre-commit`
- `--all` and `-t` are mutually exclusive (`conflicts_with`)
- Suppress "not managed" / "does not exist" skip messages when `--all`
is used, since iterating all hook types will naturally hit many
non-existent ones
## Tests
- `uninstall_all_managed_hooks`: `--all` removes all prek-managed hooks
- `uninstall_all_no_hooks`: `--all` exits cleanly when no hooks are
installed
- Ran `mise run lint` and confirmed no errors
---------
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
This renames the hook environment setup surface from `install-hooks` to
`prepare-hooks` to make the distinction between two different actions
clearer:
- `prek install` installs Git hook shims under .git/hooks
- `prek prepare-hooks` prepares the managed hook environments and caches
The old naming used "install" for both concepts, which was easy to
misread, especially in forms like `prek install --install-hooks`. The
new names make the behavior more explicit:
- prek install --prepare-hooks
- prek prepare-hooks
Compatibility is preserved, so existing workflows continue to work.
Closes#1762
Now attempts to default to `.pre-commit-config.yaml` and
`.pre-commit-config.yml` in PWD before erroring.
Feel free to close if you disagree, just ran into this when spinning up
#1592, and figured it's worth fixing :)
---------
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
* feat(bun): add Bun language support
* test(bun): add integration tests for Bun language support
Add three integration tests covering the key functionality:
- basic_bun: simple hook execution using bun -e
- additional_dependencies: verify deps installed via bunx cowsay
- language_version: test version specification with language_version: "1"
The additional_dependencies test runs twice to verify health_check and
cache reuse works correctly.
* docs: add Bun to supported languages documentation
- Add Bun to toolchain list in README features section
- Add Bun to managed toolchain downloads list in languages.md
- Add full Bun language section with version format documentation
* ci: add Bun setup to test jobs
* feat(bun): use GITHUB_TOKEN to avoid API rate limits
When listing Bun versions from GitHub releases, use the GITHUB_TOKEN
environment variable if available to authenticate requests. This
increases the rate limit from 60 to 5,000 requests/hour.
GITHUB_TOKEN is automatically set in GitHub Actions workflows.
* fix(bun): use consistent bin_dir path on all platforms
Bun installs global packages to $BUN_INSTALL/bin/ on all platforms,
so bin_dir should always return prefix/bin. The Windows special case
was incorrectly copied from Node (which uses npm's different install
structure).
* Add toolchain download test
* Add tests
---------
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
Use `git for-each-ref --sort=-creatordate --format='%(refname:lstrip=2) %(creatordate:unix)' refs/tags` to get a list of tags along with their timestamps.
`creatordate` uses the tag’s creation time if it’s an annotated tag, and if it’s a lightweight tag, it falls back to the commit’s timestamp.
* feat: implement cooldown (default: 1 day)
* refactor: make update_repo a coordinator function
* fix: fallback to search all tags when candidate fails
* perf: batch the tag commit date iteration into one call
* Simplify logic
* Add tests
* Change `--cooldown-days` default to 0, keep backward compability
* Remove `cooldown_days` from config
---------
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
* Add --fail-fast CLI flag to stop after first hook failure
- Add fail_fast field to RunArgs struct with CLI flag support
- Fix in hook_impl.rs where fail_fast was hardcoded to false
- Update run() and run_hooks() to accept and propagate fail_fast parameter
- CLI flag overrides config file setting (enables fail-fast mode)
- Ensure try-repo and main entry point pass fail_fast correctly
* Update test snapshots for --fail-fast flag
* Add CLI flag test for --fail-fast
* Fix trailing whitespace in test comment
* Show error message in quiet mode
In quiet mode (`-q`), error messages will still be printed.
In silent mode (`-qq`), nothing gets printed.
* Generate cli doc
* Add test