1
0
mirror of https://github.com/j178/prek.git synced 2026-04-25 02:11:36 +02:00

13 Commits

Author SHA1 Message Date
Copilot a46ae58c29 Document hook_types flag and default_install_hook_types behavior (#1225) 2025-12-14 17:35:17 +08:00
Jo 72f4c5a59a Prefer tag creation timestamp in --cooldown-days (#1221)
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.
2025-12-13 19:19:55 +08:00
Louis Maddox 2ad3a70f07 Support--cooldown-days in prek auto-update (#1172)
* 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>
2025-12-12 13:30:30 +08:00
drainpixie adf78165d8 Fallback to manual stage for hooks specified directly in command line (#1185)
* feat(run): assume stage based on selected hooks

* fix(run): don't clone eagerly

* Remove fallback to `--all-files`, add tests

* Generate cli docs

* Improve wording

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-12-05 14:58:24 +08:00
Matthew Mckee bd4da34a51 Add cache size command (#1183) 2025-12-03 12:42:45 +08:00
Aditya Yadav 67d956e8a0 Add --fail-fast CLI flag to stop after first hook failure (#908)
* 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
2025-10-17 11:07:27 +08:00
Luiz Otavio Vilas Boas Oliveira 74cb495dea Implement prek try-repo (#797)
* Add try_repo logic and tests (WIP)

* Remove unnecessary mut

* Fix clippy issues

* Add unit test

* Update snapshots

* Update docs

* Update unit test

* WIP

* Update snapshots

* Lint

* Add extra filters to try_repo tests

* Lint

* Update unit tests

* Apply Josh's suggestions

* Fix arg name

* .

* Fix

* Fix

* Generate

* Fix snapshot

* Improve coverage

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-10-10 21:11:31 +08:00
Jo 6c0cd3b7c8 Make prek auto-update --jobs default to 0 (which uses max available parallelism) (#833) 2025-10-01 23:03:56 +08:00
Jo 0adb26401d Add a global --log-file flag to specify the log file path (#817) 2025-09-29 16:30:48 +08:00
Jo d7c39b5733 Show error message in quiet mode (#807)
* 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
2025-09-28 13:50:16 +08:00
Jo d0f7c4d6b0 Add --dry-run to prek auto-update (#806) 2025-09-28 12:06:44 +08:00
Jo 04bb76fcb4 Add prek cache dir, move prek gc and prek clean under prek cache (#795)
`prek gc` and `prek clean` are still available but hidden.
2025-09-25 13:36:41 +08:00
Jo 6f0a7da41b Generate cli reference (#707)
* Generate cli reference

* Fix lint
2025-09-10 22:05:05 +08:00