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

88 Commits

Author SHA1 Message Date
Jo 0253181df8 Reimplement find matching env logic (#327)
* Reimplement find matching env logic

* Fix test

* Fix
2025-08-03 20:35:03 +08:00
Jo 7bc0a164ed Support python311 as a valid language version (#321) 2025-08-03 12:29:19 +08:00
Jo 5ac91b9be3 Fix issue that entry of pygrep is not shell commands (#316)
* Fix issue that `entry` of `pygrep` is not shell commands

* Fix snap
2025-08-03 10:40:09 +08:00
Jo c70122f23b Add sample-config --file to write sample config to file (#313) 2025-08-02 23:06:28 +08:00
Jo 5cd12dc8c4 Fix end-of-file-fixer replaces \r\n with \n (#311)
* Fix `end-of-file-fixer` replaces `\r\n` with `\n`

Closes 309

* Improve

* Fix
2025-08-02 21:02:41 +08:00
Jo 172abf4d59 Improve error message for hook installation and run (#310) 2025-08-02 19:35:21 +08:00
Jo c7641c41e5 Improve error message for hook (#308)
* .

* Improve error message for hook

* Improve

* Add test

* Fix

* Fix
2025-08-02 18:44:59 +08:00
Jo 157d5ee7ac Improve hook invalid error message (#307) 2025-08-02 16:46:28 +08:00
Jo e663be632e Parse entry when constructing hook (#306)
* Parse `entry` when constructing hook

* Add test
2025-08-02 16:31:22 +08:00
Jo ca12c55c1b Support nodejs language hook (#298)
* .

* Support `nodejs` language

* add run

* .

* Fix

* Improve

* Test

* add test

* Debug

* Fix npm name

* oh my, windows

* Fix

* Fix
2025-08-02 06:33:16 +08:00
Jo 7b8576e4df Move local_need_install test to python (#297) 2025-08-02 01:53:01 +08:00
Jo c28ca26c47 Try default uv managed python first, fallback to download (#291)
* .

* Try default uv managed python first, fallback to download

* Fix
2025-08-01 12:07:33 +08:00
Jo 6c205b2270 Add asserts to tests (#283)
* Add asserts to tests

* Fix

* Debug

* Use a old python 3.12 that github action does not installed
2025-08-01 02:09:52 +08:00
Jo b9acf150d1 Support downloading requested Python version automatically (#281)
* Support auto download requested Python version

* Add test

* Fix

* Fix windows test
2025-08-01 00:27:02 +08:00
Jo a7fb956ec4 Remove LanguagePreference and improve language check (#277) 2025-07-31 20:16:27 +08:00
Jo 152c8d51d1 Fix python version matching (#275)
* Minor improvements to tests

* fix python version match

* Improve
2025-07-30 14:27:51 +08:00
Jo 73493aa6ff Implement language specific version parsing (#273)
* Implement language specific version parsing

* Fix test

* Add tests
2025-07-29 22:36:31 +08:00
Jo 1c034a1afb Ignore config not staged error for config outside the repo (#270)
* Use `sync_all` over `flush`

* Ignore config not staged for config outside the repo

* improve test
2025-07-29 09:56:09 +08:00
Jo ff707a4784 Add test fixture files (#266) 2025-07-28 18:09:28 +08:00
Jo f47058fee5 Improve builtin hook tests (#262) 2025-07-28 15:57:52 +08:00
Jo ec28f449cc Implement install-hooks (#258)
* Implement `install-hooks`

* Add tests
2025-07-28 13:33:24 +08:00
Luiz Otavio Vilas Boas Oliveira fac3516167 Implement pre-commit-hooks:end-of-file-fixer (#255) 2025-07-20 21:19:33 +08:00
Jo be2840c83b Support reading .pre-commit-config.yml as well (#213)
* Support reading `.pre-commit-config.yml` as well

* warn if both found
2025-03-06 13:28:04 +08:00
Jo 0f8704d6f8 Upgrade to Rust 2024 edition (#196) 2025-02-21 17:56:12 +08:00
Jo 137fcd11b5 Do not install if no additional dependencies for local python hook (#195) 2025-02-19 11:34:47 +08:00
Jo b6bb23f74c Implement node.js installer (#152)
* Implement node.js installer

* Fix NodeVersion deserialize

* minor

* tweaw

* fixes

* Fix dist
2025-02-18 17:58:15 +08:00
Jo f3c23fec1c Save patches to $PREFLIGIT_HOME/patches (#182)
* Save patches to `$PREFLIGIT_HOME/patches`

* Fix test
2025-02-17 20:46:51 +08:00
Jo 0aae916843 Disallow std::env::var (#177) 2025-02-13 20:28:07 +08:00
Jo 2f500edb8c Format sample config output (#172) 2025-02-11 12:00:03 +08:00
Jo 58c4d621bd Make env vars a shareable crate (#171) 2025-02-11 11:53:37 +08:00
Jo 586186b2ee Upgrade Rust to 1.84 and upgrade dependencies (#161)
* Cargo update

* Upgrade rust to 1.84 and upgrade dependencies

* Fix snapshot

* Sort filenames in test

* fmt

* Debug

* Use ordered buffer concurrent

* Rollback debug
2025-02-06 18:09:42 +08:00
Jo 6f2e9a96aa Move home dir to ~/.cache/prefligit (#154) 2024-12-19 21:07:13 +08:00
Jo 5b89765f93 Implement meta hooks (#135)
* temp

* temp

* Split run module

* Finish

* Fix clippy
2024-12-09 17:21:11 +08:00
Jo 13e28502a1 Make pass_env_vars runs on Windows (#133) 2024-12-08 15:54:30 +08:00
Jo 28a9130d25 Fix same repo clone multiple times (#125) 2024-12-07 14:25:27 +08:00
Jo 6d5f6eff0a Add progress bar for hook init and install (#122)
* Add progress bar for hook init and install

* Fix tests
2024-12-06 20:28:09 +08:00
Jo 8dfb3101ff Rename project name to prefligit (#118)
* Rename project to `prefligit`

* Bump to 0.0.6

* Fix tests

* Add a rename note
2024-12-03 13:20:00 +08:00
Lemon b3619bada8 feat: support docker_image (#113)
* feat: support docker_image

* test: add docker_image test case

* test: fix test failed when git default branch set `main`

* Minor tweaks

---------

Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
2024-11-25 15:32:15 +08:00
Jo 3113e8400a Improve tests (#106)
* Improve tests

* Fix
2024-11-23 21:34:48 +08:00
xmchx 81455fbf5c feat: support pre-commit init-templatedir (#101)
* feat: support init-templatedir

* chore: update

* Fix and add test

---------

Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
2024-11-23 01:18:30 +08:00
Jo cd70f74f48 Implement get filenames from merge conflicts (#103)
* t

* Implement get filenames from merge conflicts

* Add a test
2024-11-23 00:16:11 +08:00
Jo 478ab2c5eb Fix pre-commit intall --hook-type name (#102)
* Fix `pre-commit intall --hook-type` name

* Fix test

* Add a test
2024-11-22 17:38:15 +08:00
Jo 5384ab187f Stash working tree before running hooks (#96)
* Add test

* Fix test

* add signal test

* Fix test

* Fix tests

* Fix tests
2024-11-21 21:57:30 +08:00
Jo 7c78d1b62f Split languages tests (#91) 2024-11-21 13:10:03 +08:00
Jo 51448afc3b Use local hook in tests (#86) 2024-11-21 11:45:41 +08:00
Lemon f4b0ec9088 feat: support docker language (#67)
* feat: support docker language

* CI: instead using libc crate for unix

* refactor: remove regex-lite

* Tweak some style

* Avoid usage of `unwrap`

* test: docker in docker test and behavior test

* merge master

* refactor: return `path` if it can't get container_id

* ci: disable windows and macOS docker test

* fix: linux docker in windows docker, path separator don't replace

* ci: default disable docker test

* ci: update snapshot

* Style tweak

* Simplify test

* Minor

* Enable only for linux

---------

Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
2024-11-20 22:07:31 +08:00
Jo 5038bc0c85 Add test cases for local repo hook (#85)
* add local test

* fix

* simplify
2024-11-20 20:45:18 +08:00
Jo 08dc3893aa Add two helper functions to TestContext (#84)
* Add two helper functions to TestContext

* fix
2024-11-20 18:19:30 +08:00
Jo f46c52c3a9 Improve hook output display (#79)
* Improve hook output display

and reduce axoupdater features

* Fix test
2024-11-18 17:50:29 +08:00
Jo 2aec6f0c90 Fix stage operate_on_files (#65) 2024-11-14 18:26:23 +08:00