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

1204 Commits

Author SHA1 Message Date
Jo c2f0468b62 Bump version to 0.2.11 (#962) v0.2.11 2025-10-24 20:09:59 +08:00
Jo 8ccc7955e3 Update status about lua (#961) 2025-10-24 19:55:50 +08:00
Jo b0d15ac060 Remove ci field from Config struct (#960) 2025-10-24 19:53:50 +08:00
Les Freire ed3f357f85 Support language: lua hooks (#954)
* Add Lua language support

Refactor Lua integration: streamline async functions and improve rockspec file handling

Add Lua and LuaRocks installation steps to CI workflow

Add MSVC development command to CI workflow

Update CI workflow to specify Windows-only dependencies for MSVC and Lua installations

Update CI workflow to use official Lua and LuaRocks GitHub actions

Update CI workflow to specify Windows-only dependencies for Lua and LuaRocks installations

Update CI workflow to use PowerShell for Cargo test execution and improve command formatting

Add platform-specific command snapshots for Lua tests

Enhance the Lua test environment by adding separate command snapshots for Windows and non-Windows platforms. This ensures accurate output handling based on the operating system, improving test reliability and clarity.

Update CI workflow to use specific versions of Lua and LuaRocks actions

Refactor Lua dependency installation and update test cases

Refactor Lua command execution to streamline environment path handling

Fix dependencies installing

Fix remote repo hook

* Add lua remote_hook test

* Tweaks

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-10-24 19:36:38 +08:00
Jo 697b101b6d Improve styling for stashing error message (#953) 2025-10-22 16:34:08 +08:00
renovate[bot] aa8748496b Update Rust crate astral-tokio-tar to v0.5.6 [SECURITY] (#952)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-22 11:05:52 +08:00
Jo a4e8f20c8d Support language_version: system (#949)
* .

* Support `language_version: system`

* Fix python downloads
2025-10-21 20:23:32 +08:00
Jo b86327004f Hardening github actions (#947)
* Hardening github actions

* Add config

* Fix comment
2025-10-21 14:17:22 +08:00
Jo 9c2cf54a6c Fix bloat-comment action (#948) 2025-10-21 12:06:49 +08:00
Jo 1ab776b164 Fix bloat-comment workflow (#944) 2025-10-20 16:45:02 +08:00
Les Freire 93a70da4da Update built-in hook documentation (#943) 2025-10-20 16:23:45 +08:00
Jo 06195bdbb7 Workaround PR from forks can't comment (#942)
* Workaround PR from forks can't comment

* Minor
2025-10-20 16:22:54 +08:00
Jo 3fd6f324dd Add cargo-binstall to mise tools (#940) 2025-10-20 14:01:45 +08:00
Les Freire 4a1e907150 Implement no-commit-to-branch as builtin hook (#930)
* feat: (no-commit-to-branch) implement builtin hook

Enhance error handling

Refactor no_commit_to_branch function to simplify branch protection logic and improve error handling

Simplified current branch parsing and improved error messages for better clarity.

Refactor no_commit_to_branch hook to enhance argument handling and branch protection logic.

Consistent with pre-commit implementation and additional testing

Simplify the logic of check_protected

fix logic error

* Delete redundant comments

* Tweak

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-10-20 13:27:42 +08:00
Jo 5c2a887764 Comment binary size change on PR (#939)
* Comment binary size change on PR

* Fix permission
2025-10-20 12:49:12 +08:00
Jo f8a8181ad1 Update pre-commit-hook version in quick start (#937) 2025-10-19 21:58:57 +08:00
Jo d846e41a22 Add kreuzberg to "who is using prek" (#936) 2025-10-19 21:52:14 +08:00
Jo 5d0f97f7bf Reorganize README structure (#935) 2025-10-19 21:47:50 +08:00
Jo 9c6987fe40 Add a page about "Quick start" (#934) 2025-10-19 21:34:56 +08:00
Jo 33ad008b7f Minor fix for cargo-bloat summary formatting (#933) 2025-10-19 18:56:51 +08:00
Jo 706960612e Improve cargo-bloat summary formatting (#932) 2025-10-19 18:00:48 +08:00
Louis Maddox 2d6cf9c78d Monitor binary size change in PRs via cargo-bloat workflow (#927)
* perf: monitor binary size change in PRs via cargo-bloat workflow

* perf: use mold linker and Swatinem/rust-cache

* revert: cannot use commit status in PR check

* fix: result was blank

* refactor: move the bloat check into main CI workflow

* refactor: Pythonise the bloat check

* Tweak

* Fix variable substitution

* Fix size extraction

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-10-19 17:45:28 +08:00
Jo f4dcd0380f Clarify minimum mise version required to use mise use prek (#931) 2025-10-19 17:09:07 +08:00
Jo c8b69c6892 Support nix-shell style shebang (#929) 2025-10-19 14:06:50 +08:00
Jo 9256926488 Clean up some unecessary create_dir_all (#926) 2025-10-19 00:05:19 +08:00
Jo 9e0e9b3ad8 Bump version to 0.2.10 (#922) v0.2.10 2025-10-18 20:48:01 +08:00
Jo d2a3726668 Fix pygrep hook env health check (#921) 2025-10-18 20:35:00 +08:00
Jo c402d6937e Group pygrep with python when installing pygrep hooks (#920) 2025-10-18 20:16:33 +08:00
Jo f13e392f86 Ignore any . prefixed directories in managed Python directory (#919) 2025-10-18 20:01:17 +08:00
Jo 2d9c5be1d3 Improve README 2025-10-18 14:38:17 +08:00
Jo 528c033652 Update README.md 2025-10-18 00:16:08 +08:00
Jo d174e59439 Improve logo (#916) 2025-10-17 18:26:12 +08:00
kenwoodjw f81d30c9e6 Add collision detection for hook env directories (#914)
* Add collision detection for hook env directories

Signed-off-by: kenwoodjw <blackxin55+@gmail.com>

* Use tempfile to create hook env

Use tempfile to do the collision detection, and avoid [TOCTOU](https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use) issue

---------

Signed-off-by: kenwoodjw <blackxin55+@gmail.com>
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-10-17 17:51:19 +08:00
Louis Maddox bbdac782d6 Implement check-xml as builtin hook (#894)
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-10-17 17:12:15 +08:00
Jo 054e1fbb00 Error out if not projects found (#913) 2025-10-17 16:16:05 +08:00
Jo 996a07b8ef Add contribution guide (#912) 2025-10-17 12:05:46 +08:00
Jo bb9cd2d30a Use line-by-line reading in check-merge-conflict (#910)
Follow up https://github.com/j178/prek/pull/907
2025-10-17 11:27:48 +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
Louis Maddox ede9d4b760 Implement check-merge-conflict as builtin hook (#885)
* feat(check-merge-conflict): implement builtin hook

* fix: reuse core git helper fn
2025-10-17 01:27:17 +08:00
Jo 565c5e26e4 Bump version to 0.2.9 (#903) v0.2.9 2025-10-16 18:45:15 +08:00
Jo 20c24af285 Fix golang hook install local dependencies (#902) 2025-10-16 18:34:52 +08:00
Jo e3c00f7214 Ignore the user-set UV_MANAGED_PYTHON (#900) 2025-10-16 16:44:50 +08:00
Louis Maddox 6df836bcf0 Implement detect-private-key as builtin hook (#893)
* feat(detect-private-key): implement builtin hook

* Reduce unnecessary tests

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-10-16 15:55:26 +08:00
Jo 85c6cde6c9 Check hook env health lazily (#897)
* .

* Check hook env health lazily

Only checks if a hook env is healthy when it’s actually needed, instead of checking all hooks’ health at once.
2025-10-16 14:46:40 +08:00
Jo 234307da50 Update README.md
Remove the misleading "10x faster" claim
2025-10-16 09:06:14 +08:00
Louis Maddox ad6fbf7703 Implement check-symlinks as builtin hook (#895) 2025-10-15 23:37:24 +08:00
Jo a6598cf08a Download files to scratch directory to avoid cross-filesystem rename (#889) 2025-10-15 16:28:58 +08:00
Louis Maddox 6d8579fdf4 feat: make package cargo binstallable (#882) 2025-10-15 06:33:38 +08:00
Jo 1205b6ddb6 Add tracking issue for language support (#879) 2025-10-14 20:42:29 +08:00
Jo e924c4ba50 Try release again (#878) v0.2.8 2025-10-14 15:16:08 +08:00