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

886 Commits

Author SHA1 Message Date
Jo 66b1a7c97c Merge branch 'master' into copilot/replace-path-with-utf8path 2025-10-29 17:13:22 +08:00
Jo 59b82c7539 Warmup cache before run hotpath profiling 2025-10-29 17:12:33 +08:00
Jo 2d0f35f9c9 Merge branch 'master' into copilot/replace-path-with-utf8path 2025-10-29 17:01:05 +08:00
Jo a1b6d2821e Refactor bloat-check and hotpath workflow (#990)
* Refactor `bloat-check` and `hotpath` workflow

* Use faster profiling  profile

* Fix template injection issue

* Tweak
2025-10-29 17:00:38 +08:00
Jo 0f0519e9c6 Fix windows 2025-10-28 21:21:35 +08:00
Jo 4b0f45d24f Merge branch 'master' into copilot/replace-path-with-utf8path 2025-10-28 21:19:16 +08:00
Jo e366cc2679 Fix hotpath profile comparison results path 2025-10-28 21:16:54 +08:00
Jo f49f1dc533 cargo shear 2025-10-28 21:06:26 +08:00
Jo 47159114e8 Merge branch 'master' into copilot/replace-path-with-utf8path
# Conflicts:
#	src/cli/run/filter.rs
2025-10-28 21:04:27 +08:00
Jo d135fc11b5 Fixes all reamining 2025-10-28 21:00:25 +08:00
Jo 83fa8234e1 Fix pr-commit reading result path (#986) 2025-10-28 18:08:06 +08:00
Jo 2fa29a7473 Fix pr-commit action (#985) 2025-10-28 17:50:23 +08:00
Louis Maddox 65a2fe22a6 Profile latency and allocations with hotpath (#956)
* perf(hotpath): profile prek run on its own repo

* Combine pr comments

* Fix path

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-10-28 17:41:47 +08:00
copilot-swe-agent[bot] 8ee492cc00 Fix which::which conversions and remaining path issues - Part 4
- Convert which::which and which::which_all results from PathBuf to Utf8PathBuf
- Fix git.rs GIT static initialization
- Fix resolve_command in languages/mod.rs
- Handle which::which_all iterator conversion in uv.rs
- Fix installer.rs entry.path() conversions in golang, node, and lua
- Remove remaining .to_string_lossy() calls (process.rs, run.rs)
- Convert DirEntry paths to Utf8PathBuf in multiple installers

Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
2025-10-28 09:40:33 +00:00
copilot-swe-agent[bot] 6143159c0d Fix remaining .display(), .to_string_lossy(), and .to_str() calls - Part 3
- Remove .display() calls from main.rs, clean.rs, completion.rs, install.rs, selector.rs, config.rs
- Fix .to_string_lossy() calls to use .to_string() for Utf8Path
- Fix .to_str() calls to use .as_str() for Utf8Path
- Update identify.rs to use Utf8Path methods directly (extension(), file_name())
- Fix meta_hooks.rs path conversions
- Convert std::env::current_exe() results to Utf8PathBuf

Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
2025-10-28 09:36:24 +00:00
copilot-swe-agent[bot] ea9ef22a06 Fix type mismatches and conversions - Part 2
- Remove remaining .display() calls on Utf8Path/Utf8PathBuf
- Add conversions from std::path::PathBuf to Utf8PathBuf where needed
- Handle which::which_all results (PathBuf to Utf8PathBuf conversion)
- Fix tempfile::TempDir path conversions throughout codebase
- Convert paths for fs-err and archive functions
- Update store.rs to handle UTF-8 path conversions

Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
2025-10-28 09:31:29 +00:00
copilot-swe-agent[bot] 2e0c95faaa Migrate from std::path to camino::Utf8Path - Part 1
- Add camino dependency to Cargo.toml
- Replace std::path imports with camino imports in 56+ files
- Update type annotations from Path/PathBuf to Utf8Path/Utf8PathBuf
- Replace Path::new() calls with Utf8Path::new()
- Convert CWD to Utf8PathBuf
- Remove unnecessary .to_string_lossy() and .display() calls
- Add conversions between std::path and camino where needed for compatibility

Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
2025-10-28 09:22:43 +00:00
copilot-swe-agent[bot] fd1bc6afb2 Initial plan 2025-10-28 08:52:19 +00:00
Copilot b524f38675 Document that .gitignore is respected by default during workspace discovery (#983)
* Initial plan

* Document that .gitignore is respected by default and add test

Co-authored-by: j178 <10510431+j178@users.noreply.github.com>

* Lint

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
2025-10-28 16:31:00 +08:00
Jo a18d363b7e Refactor identify using smallvec (#982)
```console
❯ hyperfine --warmup 3 'prek run -a trailing-whitespace' './target/release/prek run -a trailing-whitespace'
Benchmark 1: prek run -a trailing-whitespace
  Time (mean ± σ):      56.6 ms ±   7.8 ms    [User: 28.1 ms, System: 35.7 ms]
  Range (min … max):    48.0 ms …  73.0 ms    37 runs

Benchmark 2: ./target/release/prek run -a trailing-whitespace
  Time (mean ± σ):      51.0 ms ±   2.6 ms    [User: 28.1 ms, System: 35.3 ms]
  Range (min … max):    48.1 ms …  61.5 ms    46 runs

Summary
  ./target/release/prek run -a trailing-whitespace ran
    1.11 ± 0.16 times faster than prek run -a trailing-whitespace
```
2025-10-28 16:16:31 +08:00
my1e5 a9f9166b74 Add attrs to "who is using prek" (#981) 2025-10-28 11:27:04 +08:00
Jo 8dee1b5b8c Treat every file as executable to keep compatibility with pre-commit (#980) 2025-10-28 06:30:17 +08:00
Jo 15ef28aee9 Bump version to 0.2.12 (#978) v0.2.12 2025-10-27 20:11:46 +08:00
yihong b533e785c8 Fix local relative path in try-repo (#975)
* fix: try-repo can use relative path

Signed-off-by: yihong0618 <zouzou0208@gmail.com>

* fix: clippy warnings

Signed-off-by: yihong0618 <zouzou0208@gmail.com>

* Tweak

* Absolute path in init_repo

* Simplify fix

---------

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-10-27 19:55:56 +08:00
Jo ab6bb6aa64 Add a warning for unimplemented hooks (#976) 2025-10-27 17:43:12 +08:00
Jo 476d84cf00 Fix PREK_UV_SOURCE list indentation (#977) 2025-10-27 17:34:12 +08:00
Jo b6c6ba8461 Fail windows CI when an error occured (#971)
* Fail windows CI when an error occured

* Fix tests
2025-10-26 19:04:02 +08:00
Jo 473ca4a188 Update language support status (#970)
* Update language support status

* Tweak
2025-10-26 18:25:43 +08:00
Jo 76093daa26 Fix compatibility with older luarocks (#967) 2025-10-26 15:39:05 +08:00
Steven Taylor 7161581362 Allow using system trusted store by PREK_NATIVE_TLS (#959) 2025-10-26 03:56:02 +08:00
Jo a25ecfd6d6 Update README 2025-10-25 21:06:16 +08:00
Jo f36d12df44 Do not check for script subprocess status (#964) 2025-10-25 01:24:32 +08:00
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