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

202 Commits

Author SHA1 Message Date
Jo
2ad6d1b2da Bump version to 0.2.0-alpha.1 (#640)
* Bump version to 0.2.0a1

* Fix version regex

* Update doc
2025-09-07 15:24:27 +08:00
Jo
1bc65c8283 Implement selector completion in workspace mode (#639)
* .

* Implement selector completion
2025-09-07 15:05:19 +08:00
Jo
d1f364278c Fix docker mount in workspace mode (#638)
* Fix docker mount in workspace mode

* Add test
2025-09-07 03:00:07 +08:00
Jo
ef7d73b9ac Show project line when project is not root (#637)
* Show project line when project is not root

* Update snap
2025-09-07 02:27:02 +08:00
Jo
3dfab69c1d Cache workspace discovery result (#636)
* Cache workspace discovery result

* Add `--refresh` to refresh cached data

* Add docs about workspace cache
2025-09-07 00:26:38 +08:00
Luiz Otavio Vilas Boas Oliveira
7b58c02700 Add a --dry-run flag to prek run (#622)
* Add dry-run argument

* Add unit tests

* Clippy

* Fix unit test

* Lint

* Tweak

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-09-06 19:24:43 +08:00
Jo
e9fc08bc6b Implement project and hook selector (#623)
* selection

* .

* complete

* rewrite

* Fix

* Fix docs

* Update doc

* Fix single config mode

* Improve

* Fix doc

* Fixes and tweaks

* Fix tests

* Fixes and tests

* Use path clean instead of canonicalized
2025-09-06 16:44:22 +08:00
Jo
6f8ee64df6 Simplify auto-update implementation (#608) 2025-09-06 16:44:22 +08:00
Jo
1b1eddf7e7 Implement auto-update in workspace mode (#605)
* Implement `auto-update` in workspace mode

* Deduplicate remote hooks

* Minor
2025-09-06 16:44:22 +08:00
Jo
2cd8f0fcb8 Fix local script hook entry path in workspace mode (#603) 2025-09-06 16:44:22 +08:00
Jo
f6034483a5 Fix hook-impl allow missing config (#600) 2025-09-06 16:44:22 +08:00
Jo
055e493fac Support prek install|install-hooks|hook-impl|init-template-dir in workspace mode (#595)
* Support `prek install|install-hooks|hook-impl|init-template-dir` in workspace mode

* Fix

* Fix windows
# Conflicts:
#	src/cli/hook_impl.rs
#	tests/hook_impl.rs

# Conflicts:
#	src/cli/install.rs
2025-09-06 16:44:22 +08:00
Jo
7f10e34e23 Support prek list in workspace mode (#586)
* Support `prek list` in workspace mode

* Update snapshot
2025-09-06 16:44:22 +08:00
Jo
8d644ef337 Fix config not staged relative filename display (#585)
* .

* Fix config not staged relative filename display
2025-09-06 16:44:22 +08:00
Jo
f089db0699 Add prek run --cd <dir> to change directory before running (#581) 2025-09-06 16:44:22 +08:00
Jo
a5a1b3b2b0 Support multiple .pre-commit-config.yaml in a workspace (monorepo mode) (#481)
* Remove color from trace log

Since `tracing-subscriber 0.3.20`, ANSI codes will be escaped so that color can not be shown in log. 4c52ca5266

* Refactor project constructure

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

* .

# Conflicts:
#	src/workspace.rs

# Conflicts:
#	src/workspace.rs

# Conflicts:
#	src/workspace.rs

.

# Conflicts:
#	src/git.rs

# Conflicts:
#	src/git.rs

# Conflicts:
#	src/git.rs
#	src/languages/script.rs

Support multiple `.pre-commit-connfig.yaml` in a workspace (monorepo mode)

.

.

Make it compile

Fix

.

.

.

Fix

Fix

Fix

.

.

.

# Conflicts:
#	src/builtin/pre_commit_hooks/fix_trailing_whitespace.rs
#	src/builtin/pre_commit_hooks/mod.rs
#	src/hook.rs
#	src/languages/docker.rs
#	src/languages/docker_image.rs
#	src/languages/golang/golang.rs
#	src/languages/node/node.rs
#	src/languages/python/python.rs
#	src/languages/system.rs
#	src/run.rs

* Refactor

* Fix

* .

* Fix `--config FILE`

* Add docs

* Misc

* Fix
# Conflicts:
#	README.md
2025-09-06 16:44:22 +08:00
Jo
e1efb81842 Reuse environment only for hooks with exactly same dependencies (#609)
* Reuse hook env only for exactly same dependencies

* Add test
2025-09-02 18:32:48 +08:00
Jo
70261e9bf6 Implement pre-push hook type (#598)
* Implement `pre-push` hook type

* Skip if nothing to push

* Improve test
2025-09-02 02:40:07 +08:00
Miao
fec96272a7 Implement check_yaml as builtin hook (#557)
* Implement `check_yaml` as built hook

* Add `args` check for `check-yaml`

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-08-27 14:31:24 +08:00
Jo
e4f642c912 Use mise for tools and tasks (#558)
* .

* Migrate more
2025-08-26 23:36:47 +08:00
Jo
c5fb6ec7f6 Support PEP 723 scripts for Python hooks (#529)
* Support PEP723 scripts for local Python hooks

Fix

Debug windows

debug

Fix

# Conflicts:
#	tests/languages/python.rs

* Fix
2025-08-25 17:07:48 +08:00
Jo
c1930b2b13 Add test for hook id completion (#532)
* Add test for hook id completion

* ignore windows
2025-08-24 18:33:58 +08:00
Jo
a0019ca9ee Fix Python hook stderr are not captured (#530)
* Fix that Python hook stderr are not captured

* Fix windows
2025-08-22 15:35:13 +08:00
Jo
d19ad4fbce Fix language: script entry join issue (#525) 2025-08-21 11:40:00 +08:00
Jo
7e080ddaeb Add check for missing hooks in new revision (#521) 2025-08-20 20:42:50 +08:00
Jo
8e230b1141 Implement prek auto-update (#511)
* .

* Implement `pre auto-update`

* .

* Add tests

* Windows

* Update tests
2025-08-20 18:17:40 +08:00
Luiz Otavio Vilas Boas Oliveira
e5b2375fe7 Add moving rev warning (#488)
* Warn user when revs are found

* Lint

* Update test snapshots

* Fix snapshot

* Tweak message

* Update tests

* fix tests

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-08-20 18:14:55 +08:00
Jo
e9232f1a30 Drop support .yml config file (#493)
* Drop support `.yml` config file

* Fix test
2025-08-19 11:53:55 +08:00
Jo
bcb2218d8a Fix git commit -a does not pick up staged files correctly (#487) 2025-08-18 16:16:39 +08:00
Jo
3f1f9e1056 Various fixes to init-templdate-dir and directory related bug (#484)
* various fixes

* Fix tests

* Fix
2025-08-18 14:30:18 +08:00
Jo
3ac5e2beb0 Fix inde.lock file exists error when running git commit -p or git commit -a (#482)
* Fix `inde.lock file exists` error when running `git commit -p` or `git commit -a`

* Add test

* Add tests

* Windows
2025-08-18 11:00:51 +08:00
Jo
6f6278f54b Refactor project constructure (#476)
* Refactor project constructure

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

* Clean

* Fix tests
2025-08-16 22:45:31 +08:00
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