1
0
mirror of https://github.com/j178/prek.git synced 2026-04-09 01:52:24 +02:00
Commit Graph

120 Commits

Author SHA1 Message Date
Jo
f83f9a8668 Resolve script shebang before running (#475)
* Resolve script shebang on Windows

* Fix test

* Simplify node

* Improve
2025-08-16 19:52:52 +08:00
Jo
0a4f7cda9a Adjust sample-config file path before writing (#474) 2025-08-16 13:01:52 +08:00
Jo
0844d73be0 Run hooks with pty if color enabled (#471)
* .

* 。

* .

* Vendor pty-process

* Use pty_output

* Fix windows

* No need pty for docker commands

* Fix windows

* Fix windows

* Add test

* Try

* Fix linux hang

* Remove read

* try

* Revert "try"

This reverts commit 8298ea6619.

* Add comment
2025-08-16 11:49:32 +08:00
tmdhhl
b1f929a1b6 Warn unexpected keys in config (#463)
* warn unexpected keys.

* Tweak

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-08-15 21:13:37 +08:00
Jo
a29e32de61 Reduce slow go tests (#457) 2025-08-15 00:23:47 +08:00
Jo
e0426ed6f4 Bump version to 0.0.25 (#456) 2025-08-15 00:15:51 +08:00
Miao
b9790d4762 Implement mixed_line_ending as builtin hook (#444)
* Implement `mixed_line_ending` as built hook

* Fix CI failing test

* Configure Git for consistent line ending handling

* Add fix-mode value format in argument handling

* Improve argument parsing

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-08-14 22:23:06 +08:00
Jo
b0ca7f157e Add warning for non-existent hook id (#450)
* Add warning for non-existent hook id

* Improve
2025-08-13 19:46:42 +08:00
Luiz Otavio Vilas Boas Oliveira
cf3399a660 Support --output-format=json in prek list (#446)
* Add option to list using json

* Reduce clone

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-08-13 16:48:40 +08:00
Jo
b10330456d Add check for minimum_prek_version (#437)
* Add check for `minimum_prek_version`

* Fix

* Fix
2025-08-12 13:54:40 +08:00
Jo
42fc2f6ec7 Implement prek list to list available hooks (#424)
* .

* Implement `prek list` to list available hooks
2025-08-11 19:31:38 +08:00
Jo
cb43e982a7 Support prek run multiple hooks (#423)
* Support `prek run` multiple hooks

* Update diff

* update tests
2025-08-11 17:03:12 +08:00
Miao
9b6d1cbef8 Implement check_json as built hook (#416)
* Implement `check_json` as built hook

* Override serde dedup behavior using serde_with

* Enhance JSON parsing error messages to include duplicate key details
2025-08-11 17:02:55 +08:00
Jo
5c94c21b9f Add a shortcut to run original pre-commit to check output (#419) 2025-08-11 11:48:46 +08:00
Jo
9986cb7e74 Test remote hooks with system go (#417)
* Revert "Do not set `GOROOT` and `GOPATH` for system found go (#415)"

This reverts commit 32d57905e4.

* Test remote hooks with system go

* Reapply "Do not set `GOROOT` and `GOPATH` for system found go (#415)"

This reverts commit e16e7df60d.
2025-08-10 23:17:15 +08:00
Jo
b2ab1fdaea Implement pygrep language support (#383)
* Implement `pygrep` language support

* Add failing tests

* .

* .

* Reimplement in Python
2025-08-10 17:32:21 +08:00
Miao
79fa466406 Make error message handling in tests more robust (#403)
* Make error message handling in tests more robust

* Check node versions more reliably
2025-08-09 00:44:51 +08:00
Jo
23f865819a Rename project to prek from prefligit (#402) 2025-08-08 23:12:20 +08:00
Jo
9de06bc221 Fix meta hook check_useless_excludes (#401)
* Fix meta hook `check_useless_excludes`

* move tests
2025-08-08 21:57:29 +08:00
Jo
b24d9f349e Fix script command path (#398)
* Fix `script` command path

* rename

* Fix windows
2025-08-08 12:03:39 +08:00
Jo
0bfd2cfde4 Fix check_added_large_files parameter name (#389)
* Fix `check_added_large_files` parameter name

* debug

* Revert "debug"

This reverts commit 6b0ea6a61c.
2025-08-08 01:05:29 +08:00
Jo
7bd667e0c1 Improve language tests (#382)
* Exclude `go`/`node` from PATH when running tests

* Improve language tests
2025-08-07 16:17:22 +08:00
Jo
321f384ec7 Fix npm install on Windows (#374)
* Mask system node when running `doctoc` test

* fix

* test

* fix

* fix
2025-08-06 22:06:20 +08:00
Jo
e46e969447 Set GOBIN to <hook-env>/bin, set GOPATH to $PREGLIGIT_HOME/cache/go (#369) 2025-08-06 19:20:36 +08:00
Jo
e7e227a53e Fix bug that default hook stage should be pre-commit (#367)
* Fix bug that default hook stage should be pre-commit

* fix test
2025-08-06 18:33:03 +08:00
Jo
797bdc85ae Remove normalize_output test helper (#363) 2025-08-06 11:38:00 +08:00
Jo
f1baa8a15b Add --directory to prefligit run (#358)
* Add `--directory` to `prefligit run`

* Add tests

* Normalize path
2025-08-05 23:27:00 +08:00
Jo
b46822d236 Support golang hooks and golang toolchain management (#355)
* .

# Conflicts:
#	src/languages/node/installer.rs
#	src/languages/version.rs

* .

# Conflicts:
#	src/languages/node/version.rs
#	src/languages/python/version.rs

# Conflicts:
#	src/cli/run/run.rs

* .

# Conflicts:
#	src/languages/node/node.rs

* .

* .

* .

* fix tests

* Add a remote test

* minor
2025-08-05 19:17:50 +08:00
luo jiyin
91f88f209d Add --last-commit flag to prefligit run (#351)
* feat: last commit flag

* fix: lint error

* fix: clippy error

* test: last commit

* fix(test): more clear test case

* fix: lint error
2025-08-05 16:32:47 +08:00
Jo
2e2b9dea94 Fix bug that directories are ignored (#350)
* Fix bug that directories are ignored

Also add a friendly warning for files that aren't exist.

* Add test

* Add tests

* Fix test
2025-08-05 12:04:29 +08:00
Jo
36ea6e63dc Add --install-links to npm install (#347)
* Add `--install-links` to `npm install`

* Add test
2025-08-05 01:06:46 +08:00
Miao
48a9252163 Fix large file check to use staged_get instead of intent_add (#332) 2025-08-04 21:55:07 +08:00
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