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 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 afc384e3a4 Disable prek self update for package managers (#468)
* Disable `prek self update` for package managers

* Fix https
2025-08-15 16:34:41 +08:00
Jo 648efa7e7b Canonicalize path (#467) 2025-08-15 15:30:39 +08:00
Jo c63410ffe5 Find uv alongside the prek binary (#466)
* Find `uv` alongside the `prek` binary

* Check version
2025-08-15 15:11:39 +08:00
Jo 56a9517a33 Download uv from github releases directly (#464)
* Download uv from github releases directly

* Improve test

* Clippy

* Refactor

* Fix

* Fix

* Fix

* Fix

* Remove temp

* Fix
2025-08-15 14:46:20 +08:00
Jo 0dde2b5a5d Cleanup various code (#462) 2025-08-15 11:25:56 +08:00
Jo 2c353fe08b Add "Who are using prek" to README (#458) 2025-08-15 00:23:59 +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) v0.0.25 2025-08-15 00:15:51 +08:00
Jo 2c7dc3d23a Use brew install prek in doc 2025-08-15 00:15:30 +08:00
Jo 1eaf4bf770 Add context message to install error (#455) 2025-08-14 22:57:23 +08:00
Jo 5240376dca Add a job to test Python and uv setup (#267)
* Add a job to test Python and uv setup

* Rework

* Fix

* Fix
2025-08-14 22:54:36 +08:00
Jo c200f42adc Fix uv install on Windows (#453) 2025-08-14 22:24:41 +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
Jo daf170b725 Support downloading uv from pypi and mirrors (#449)
* Support download uv from pypi and mirrors

* Improve

* Minor
2025-08-13 19:39:59 +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 dd6325f092 Write trace log to $PREK_HOME/prek.log (#447) 2025-08-13 16:46:31 +08:00
Jo 601ef914b8 Static link liblzma (#445)
* Static link `liblzma`

* Fix
2025-08-13 13:52:42 +08:00
Jo f319c3a8a8 Calculate more accurate max cli length (#442)
* Calculate more accurate max cli length

* Fix
2025-08-12 21:13:50 +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
Luiz Otavio Vilas Boas Oliveira b0d0eed974 Parse regex during parsing config (#376)
* Manipulate the config using a serde-like regex struct

* Fix clippy errors

* Fix test issues

* Lint

* Merge master

* Minor tweaks

* Shrink `allow(clippy::mutable_key_type)` scope

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-08-12 12:05:10 +08:00
tmdhhl c3cd21a93e Refactor fix_trailing_whitespace (#411)
* correctly handle trailing whitespace for all files, especially Markdown, without loading entire file into memory.

* update .pre-commit-config.yaml

* update ci.yaml

* update fix_trailing_whitespace.rs set default chars.

* restore ci.yaml

* update fix_trailing_whitespace.rs

* minor message style tweak

* use different buffer strategies for files based on size

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-08-12 11:30:02 +08:00
Jo 6ec3bfa5fa Make --to-ref default to HEAD if --from-ref is specified (#426)
* .

* empty commit

* Implement `prek run --since-base <base>` to files changes between base and HEAD

* Make `--to-ref` default to `HEAD` if `--from-ref` is specified
2025-08-12 11:20:52 +08:00
Jo 77fb92dff2 Bump version to 0.0.24 (#425) v0.0.24 2025-08-11 19:37:28 +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 e64fee9c46 Minor tweaks (#422) 2025-08-11 16:20:41 +08:00
fan-tastic-z 3fabbc2f70 Use brew install j178/tap/prek for now (#420) 2025-08-11 11:53:49 +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 32d57905e4 Do not set GOROOT and GOPATH for system found go (#415) 2025-08-10 17:51:20 +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
Jo 2787b8d5f9 Simplify fix_end_of_file a bit (#410) 2025-08-09 20:48:15 +08:00
tmdhhl af058dbe1d Avoid reading whole file into memory in fix_end_of_file and make it consistent with pre-commit-hooks (#399)
* fix_end_of_file not read all file.

* fix typos

* Be consistent with `pre-commit`

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
Co-authored-by: xomvio <xomvio@proton.me>
2025-08-09 19:36:34 +08:00
friendsa 82ba0db315 Add icon display (#409)
* Add icon display

* Update README.md

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-08-09 17:27:15 +08:00
Jo 301bace46e Update readme 2025-08-09 16:51:50 +08:00
Jo c98575d88c Update DIFF.md 2025-08-09 11:53:59 +08:00
Jo 4d2d27ba66 Add discord server 2025-08-09 11:49:50 +08:00
Wey Gu be2010a4f3 chore: logo rebranded, Update README.md (#408) 2025-08-09 10:36:37 +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
Branch Vincent 4437f86992 Add dynamic completion of hook ids (#380)
* Add dynamic completion of hook ids

* Add hook name to help

* Use `contains` instead of `starts_with`

* Change to project root before find config file

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-08-09 00:14:18 +08:00
Jo 96fed00c55 Bump version to 0.0.23 (#404) v0.0.23 2025-08-08 23:29:15 +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 6158fcee01 Update README.md 2025-08-08 15:09:57 +08:00
Jo 5fc1c05e15 Highlight the git in prefligit 2025-08-08 14:53:23 +08:00
Jo b24d9f349e Fix script command path (#398)
* Fix `script` command path

* rename

* Fix windows
2025-08-08 12:03:39 +08:00