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

184 Commits

Author SHA1 Message Date
Shaan Majid 2b811fb6a2 Add language: deno support (#1516)
---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
Co-authored-by: Janosh Riebesell <janosh.riebesell@gmail.com>
2026-03-20 09:24:24 +08:00
Daisuke Sato 47c017a6e8 Add --all flag to prek uninstall (#1817)
## Summary

  Closes #1779

- Add `--all` flag to `prek uninstall` that scans the hooks directory
and removes every prek-managed hook (detected via `is_our_script()`),
regardless of hook type
- Without `--all`, behavior is unchanged: uses `-t` or
`default_install_hook_types`, falls back to `pre-commit`
  - `--all` and `-t` are mutually exclusive (`conflicts_with`)
- Suppress "not managed" / "does not exist" skip messages when `--all`
is used, since iterating all hook types will naturally hit many
non-existent ones

  ## Tests

- `uninstall_all_managed_hooks`: `--all` removes all prek-managed hooks
- `uninstall_all_no_hooks`: `--all` exits cleanly when no hooks are
installed
  - Ran `mise run lint` and confirmed no errors

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2026-03-18 13:09:46 +08:00
Jo dd53c3d715 Bump version to 0.3.6 (#1811) 2026-03-16 16:18:06 +08:00
Jo c29d89a65d Allow selectors for hook ids containing colons (#1782)
Closes #1781
2026-03-13 22:20:27 +08:00
Jo 4ed4e8660a Disambiguate “hook” terminology by renaming "Git hooks" to "Git shims" (#1776)
Closes #1775
2026-03-11 11:46:52 +08:00
Jo ec2c03f7c2 Document compatibility with pre-commit (#1767) 2026-03-10 13:06:27 +08:00
Jo 9009dc0fd8 Rename prek install-hooks to prek prepare-hooks, prek install --install-hooks to prek install --prepare-hooks (#1766)
This renames the hook environment setup surface from `install-hooks` to
`prepare-hooks` to make the distinction between two different actions
clearer:

- `prek install` installs Git hook shims under .git/hooks
- `prek prepare-hooks` prepares the managed hook environments and caches

The old naming used "install" for both concepts, which was easy to
misread, especially in forms like `prek install --install-hooks`. The
new names make the behavior more explicit:

- prek install --prepare-hooks
- prek prepare-hooks

Compatibility is preserved, so existing workflows continue to work.

Closes #1762
2026-03-10 13:06:01 +08:00
Pablo Castellazzi 9028e0d312 Update configuration.md with TOML 1.1 notes (#1764)
TOML 1.1 is not yet universally available. This hit me on Visual Studio
Code using [Even Better
TOML](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml).
While this issue does not affect `prek` directly, users may encounter
errors on their IDE/editor and wonder what is going on.
2026-03-10 11:07:24 +08:00
Jo 6d07a0e112 Retry auth-failed repo clones with terminal prompts enabled (#1761)
When a repo clone fails because authentication is required, retry that
clone with `GIT_TERMINAL_PROMPT=1` so Git can prompt the user for
credentials.

The retry flow keeps the initial clone pass non-interactive, detects
auth-related failures, and then retries only those failed clones with
terminal prompts enabled. Retries run sequentially so users only see one
credential prompt at a time and know which repository is requesting
authentication.

Closes #1634
Closes #1173
Related #1193
Related #1472
2026-03-09 23:03:53 +08:00
Jo 46cb7bad13 Bump version to 0.3.5 (#1760) 2026-03-09 18:17:03 +08:00
Jo 1bead452d8 Improve docs for Rust cli: dependencies (#1748) 2026-03-06 21:25:54 +08:00
Jo 03d1f87e9f rust: support cli: git dependency 4th segment package disambiguation (#1747)
Fixes #1682
Extends #1256

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-03-06 20:44:06 +08:00
Dev-iL 176879a471 Bump zensical to 0.0.24 (#1734)
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2026-03-02 15:37:39 +08:00
Dev-iL 2df575becf Update documentation for --stage option (#1727)
Replaced a duplicated "pre-commit" in instructions by "pre-push"

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2026-03-02 15:37:23 +08:00
is-alnilam e993b04305 Add automatic Ruby download support using rv binaries (#1668)
Current Ruby support can only use Ruby interpreters which are already
installed on the system, although it goes to great lengths to find
interpreters installed by a variety of Ruby managers. This change adds
support for installing new interpreters using the binaries delivered by
the `rv` team. `rv` only provide installers for versions of Ruby still
actively supported (so they don't offer version 3.1, for example), and
only build for a subset of all Ruby-supported platforms. If users need
an unsupported version of Ruby or wish to use an unsupported platform,
they will be prompted to download and install a version of Ruby
manually.

`rv` bundles are named according to the platform, currently including
these components in the filename:
- x86_64_linux
- arm64_linux
- x86_64_linux_musl
- arm64_linux_musl
- ventura (used for macOS on x86_64)
- arm64_sonoma (used for macOS on 64-bit ARM)

If and when upstream `rv` changes these names, the detection code will
need to be updated to match. In particular, this includes the use of
macOS codenames, as if `rv` stop releasing a 'sonoma' package, this will
block installing the macOS versions of Ruby. Currently `rv` seem to be
attempting to keep these codenames, as they already rename their x86_64
builds from 'sequoia' (macOS 15) to 'ventura' (macOS 13). Adding a new
CPU architecture (such as RISC-V) would also need changes, but wouldn't
break existing platform support.

Ruby versions are found by querying the GitHub Releases API, searching
the options returned for an installer that matches the platform and
version requirements, then, if found, downloading and unpacking into the
`prek` tools folder. The `PREK_RUBY_MIRROR` environment variable can be
used to point to a different source for installers, for example to
support mirrors or air-gapped CI environments. Mirrors need to follow
the GitHub URL patterns, but note that although the GitHub hostname
changes between `api.github.com` and `github.com` as needed, any
non-GitHub mirror server will not be remapped in this manner. Where Ruby
is being downloaded from GitHub (either from the upstream `rv` or a
mirror), this remapping does occur, and any `GITHUB_TOKEN` will be sent
with the requests. This both limits impact of rate limiting, and also
allows a private GitHub repository to be used (e.g. for a vetted subset
of `rv` rubies to be mirrored). Note that GitHub tokens will only be
sent to mirrors which are hosted on GitHub.

To allow for passing the `GITHUB_TOKEN` in download requests, the
generic `download_and_extract` function is now a wrapper over a version
which takes an extension function, with the default function not
extending the request. The Ruby code will add the GitHub token if the
request is to GitHub.

Closes #43
Closes #765

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2026-03-01 23:03:29 +08:00
Jo 7df258770a Expose --git-dir to force hook installation target (#1723) 2026-03-01 22:27:05 +08:00
Jo 04b1308c98 Bump version to 0.3.4 (#1703) 2026-02-28 11:34:08 +08:00
JP-Ellis ce3ecf3d01 Allow pass_filenames to accept a positive integer (#1698)
Setting `pass_filenames: n` limits each hook invocation to at most `n`
filenames, with multiple parallel invocations for larger file sets. This
mirrors the `-n` flag of `xargs` and is useful for tools that can only
process a limited number of files per invocation (typically, if a limit
applies, it is 1).

The existing boolean behaviour is preserved: `true` passes all filenames
(default) and `false` passes none. So this is a backwards compatible
change.

Resolves: #1471

---------

Signed-off-by: JP-Ellis <josh@jpellis.me>
2026-02-28 10:43:45 +08:00
Doug Richardson 91a1faedcc Add PREK_MAX_CONCURRENCY environment variable (#1697)
## Summary

- Add `PREK_MAX_CONCURRENCY` environment variable to cap the maximum
number of concurrent hooks
- Value is floored at 1; values above CPU count are allowed (useful for
I/O-bound hooks)
- Invalid values show a user-visible warning and fall back to CPU count
- `PREK_NO_CONCURRENCY` takes precedence when both are set

## Motivation

When `ulimit -n` is low, concurrent hook execution can exhaust file
descriptors. This provides an environment variable to limit concurrency.

For #1696

## Test plan

- [x] `mise run lint` — no warnings
- [x] `mise run test` — all tests pass
- [x] Unit tests for `resolve_concurrency`: valid value, above CPU
count, zero floors to 1, invalid string, empty string, unset,
no_concurrency, no_concurrency overrides max

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-27 12:01:53 +08:00
Copilot 8c926992c6 Make trace command logging truncation configurable via PREK_LOG_TRUNCATE_LIMIT (#1679)
Trace-level `Executing ...` lines currently truncate command arguments
at a hardcoded 120 characters, which hides critical details when
debugging hooks (notably `docker_image` entrypoint/args). This change
introduces a configurable truncate limit while preserving existing
default behavior.

- **Config surface: new env var**
  - Added `PREK_LOG_TRUNCATE_LIMIT` to `prek-consts` (`EnvVars`).

- **Runtime behavior in command logging**
- Updated `Cmd` display formatting in `crates/prek/src/process.rs` to
read truncation limit from `PREK_LOG_TRUNCATE_LIMIT`.
- Cached the resolved truncate limit with `LazyLock` so env parsing
happens once.
  - Kept default at `120` when unset/invalid.
- Treated `0` as invalid and fallback to default to avoid degenerate
output.

- **Documentation**
- Added `PREK_LOG_TRUNCATE_LIMIT` to `docs/configuration.md` under
environment variables, including default and intent.

- **Focused unit coverage**
  - Added tests for:
    - env var value parsing (valid/invalid/zero),
    - env-based resolution behavior,
    - cached-limit behavior via `LazyLock`,
    - env restoration guard to avoid cross-test env leakage.

```rust
const DEFAULT_COMMAND_LOG_TRUNCATE_LIMIT: usize = 120;
static COMMAND_LOG_TRUNCATE_LIMIT: LazyLock<usize> =
    LazyLock::new(command_log_truncate_limit_from_env);

fn command_log_truncate_limit() -> usize {
    *COMMAND_LOG_TRUNCATE_LIMIT
}
```

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Do not truncate trace run executions</issue_title>
> <issue_description>### Summary
> 
> I was trying to debug a docker_image hook execution and was delighted
to note the --log-file option.
> 
> However, turns out that the "Executing" TRACE run lines are truncated
with `[...]` before showing the part I'm actually interested in (a case
of tweaking entrypoints and arguments).
> 
> I'd suggest not truncating these lines in the trace log at all, or
providing an option not to truncate.
> 
> ### Willing to submit a PR?
> 
> - [ ] Yes — I’m willing to open a PR to fix this.
> 
> ### Platform
> 
> Ubuntu 25.10 amd64
> 
> ### Version
> 
> 0.3.2
> 
> ### .pre-commit-config.yaml
> 
> N/A
> 
> ### Log file
> 
> ```
> 2026-02-20T10:17:47.223740Z TRACE run{hook_id=...
language=docker_image}: Executing `cd ... && docker run --rm --tty
--user 1000:1000 --init --volume ...:/src:rw,Z --workdir /src
--entrypoint ... --network [...]`
> ```</issue_description>
> 
> <agent_instructions>Add a new env var to prek-consts, controlling the
command line log truncate limit in process.rs, current it is hardcoded
to 120. Document it in docs/configuration.md env vars
section.</agent_instructions>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes j178/prek#1678

<!-- START COPILOT CODING AGENT TIPS -->
---

🔒 GitHub Advanced Security automatically protects Copilot coding agent
pull requests. You can protect all pull requests by enabling Advanced
Security for your repositories. [Learn more about Advanced
Security.](https://gh.io/cca-advanced-security)

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
2026-02-20 20:51:49 +08:00
Jo 8420c6ea23 Document winget install j178.Prek (#1670) 2026-02-19 22:24:18 +08:00
Copilot bfade9f6a5 Use --locked for Rust cargo install commands (#1661)
Rust hooks can break when dependency versions change between
installations. `cargo install` without `--locked` will resolve
dependencies freshly, potentially pulling incompatible versions even
when `Cargo.lock` exists.

## Changes

- Add `--locked` flag to both `cargo install` invocations in
`crates/prek/src/languages/rust/rust.rs`:
  - Local package installation: `cargo install --path . --locked`
  - CLI dependencies: `cargo install <package> --locked`
- Document the behavior in `docs/languages.md`

## Example

```yaml
repos:
  - repo: https://github.com/example/rust-hook
    rev: v1.0.0
    hooks:
      - id: my-rust-hook
        # Now installs with exact Cargo.lock versions
```

Note: Packages without a `Cargo.lock` will have `--locked` ignored by
cargo (not an error).

> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `mirrors.aliyun.com`
> - Triggering command: `/home/REDACTED/work/prek/prek/target/debug/prek
/home/REDACTED/work/prek/prek/target/debug/prek install-hooks -incompat
bmemchr-1fe43bea993d3235.rlib breg bsyn-2136fc17f010f281.rlib
3pURqBq1pk3divZeIfIb/target/release/deps/prek_rust_echo_lib_deps-59bce7d6001d3263.prek_rust_echo-c
3pURqBq1pk3divZeIfIb/target/release/deps/prek_rust_echo_lib_deps-59bce7d6001d3263.e4dqohtw0l0ytrcore.useBuiltinFSMonitor=false
lib 6ed2694.rlib 3pURqBq1pk3divZecommit.gpgsign=false b/rustlib/x86_64-c
b/ru b/rustlib/x86_64-c b/rustlib/x86_64core.autocrlf=false
b/rustlib/x86_64-c b/rustlib/x86_64/usr/bin/git b/rustlib/x86_64-c
b/rustlib/x86_64core.useBuiltinFSMonitor=false
b/rustlib/x86_64rev-parse` (dns block)
> - Triggering command: `/home/REDACTED/work/prek/prek/target/debug/prek
/home/REDACTED/work/prek/prek/target/debug/prek install --install-hooks
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.1nzs07cgjxiexpa7i3g2b01rt.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.24lsa75b6fov0tk3qt95numqq.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.27k9375t0pciii4hjcyuhgf4w.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.2gbphvwl0vvhd1w9zm3ido74e.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.2i6mzsq4vdcksvs36vquiynd0.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.2mdk2h4p88ofn49ujd91zdlk0.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.30nea9p9x6pr2
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.33cvujd6pv5nrd021hs6r57ur.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.33svn44fanwynb1ljchzak5c5.1elqi5j.rcgu.o
u.1. in.so /lto-wrapper 1.93-x86_64-REDACTED-linux-gnu/bi-c
-f448dbb239ade73cc 0a5a4d1a26cf608--m64
orznfljxz.rcgu.o/tmp/rustcq8iZJY/symbols.o
1.93-x86_64-unkn/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.0b78bzeosorigin`
(dns block)
> - Triggering command: `/home/REDACTED/work/prek/prek/target/debug/prek
/home/REDACTED/work/prek/prek/target/debug/prek install-hooks -I
angecoder aZFf pi -I p/bin/as hemars_derive-8b/usr/bin/git
hemars_derive-8b-c hemars_derive-8bcore.useBuiltinFSMonitor=false
hemars_derive-8bdiff hema hemars_derive-8b--no-textconv
hemars_derive-8b--ignore-submodules hemars_derive-8b--
hemars_derive-8bgit hemars_derive-8bcommit hemars_derive-8b-m
hemars_derive-8bUpdate documentation for --locked flag usage

Co-authored-by: j178 &lt;10510431&#43;j17--eh-frame-hdr` (dns block)
> - `mirrors.cloud.tencent.com`
> - Triggering command: `/home/REDACTED/work/prek/prek/target/debug/prek
/home/REDACTED/work/prek/prek/target/debug/prek install-hooks -incompat
bmemchr-1fe43bea993d3235.rlib breg bsyn-2136fc17f010f281.rlib
3pURqBq1pk3divZeIfIb/target/release/deps/prek_rust_echo_lib_deps-59bce7d6001d3263.prek_rust_echo-c
3pURqBq1pk3divZeIfIb/target/release/deps/prek_rust_echo_lib_deps-59bce7d6001d3263.e4dqohtw0l0ytrcore.useBuiltinFSMonitor=false
lib 6ed2694.rlib 3pURqBq1pk3divZecommit.gpgsign=false b/rustlib/x86_64-c
b/ru b/rustlib/x86_64-c b/rustlib/x86_64core.autocrlf=false
b/rustlib/x86_64-c b/rustlib/x86_64/usr/bin/git b/rustlib/x86_64-c
b/rustlib/x86_64core.useBuiltinFSMonitor=false
b/rustlib/x86_64rev-parse` (dns block)
> - Triggering command: `/home/REDACTED/work/prek/prek/target/debug/prek
/home/REDACTED/work/prek/prek/target/debug/prek install --install-hooks
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.1nzs07cgjxiexpa7i3g2b01rt.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.24lsa75b6fov0tk3qt95numqq.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.27k9375t0pciii4hjcyuhgf4w.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.2gbphvwl0vvhd1w9zm3ido74e.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.2i6mzsq4vdcksvs36vquiynd0.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.2mdk2h4p88ofn49ujd91zdlk0.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.30nea9p9x6pr2
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.33cvujd6pv5nrd021hs6r57ur.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.33svn44fanwynb1ljchzak5c5.1elqi5j.rcgu.o
u.1. in.so /lto-wrapper 1.93-x86_64-REDACTED-linux-gnu/bi-c
-f448dbb239ade73cc 0a5a4d1a26cf608--m64
orznfljxz.rcgu.o/tmp/rustcq8iZJY/symbols.o
1.93-x86_64-unkn/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.0b78bzeosorigin`
(dns block)
> - Triggering command: `/home/REDACTED/work/prek/prek/target/debug/prek
/home/REDACTED/work/prek/prek/target/debug/prek install-hooks -I
angecoder aZFf pi -I p/bin/as hemars_derive-8b/usr/bin/git
hemars_derive-8b-c hemars_derive-8bcore.useBuiltinFSMonitor=false
hemars_derive-8bdiff hema hemars_derive-8b--no-textconv
hemars_derive-8b--ignore-submodules hemars_derive-8b--
hemars_derive-8bgit hemars_derive-8bcommit hemars_derive-8b-m
hemars_derive-8bUpdate documentation for --locked flag usage

Co-authored-by: j178 &lt;10510431&#43;j17--eh-frame-hdr` (dns block)
> - `notexistentatallnevergonnahappen.com`
> - Triggering command: `/usr/lib/git-core/git-remote-https
/usr/lib/git-core/git-remote-https origin REDACTED est 2onf
70f92045177692.r-c unwind-35a18a198core.autocrlf=false
-6d361988d845791-c ags)&#39; ine-9a4df3979b2crev-parse
6a0d9f8e67558a02--show-toplevel -f448dbb239ade73-c dema
tect-9b165106d41init own-0c83c3b51a9f5653.rlib
cal/share/prek/tests/.tmp1lfoNL/-c oxide-ec844042f1/usr/bin/git
-fa28e789c10e1e7rev-parse -REDACTED-linux-g--show-toplevel
cal/share/prek/tests/.tmp1lfoNL/-c` (dns block)
> - Triggering command: `/usr/lib/git-core/git-remote-https
/usr/lib/git-core/git-remote-https origin REDACTED est 2onf prek.dev
2onfp.rcgu.o k/_temp/ghcca-no-c ags)&#39; 2onfp.rcgu.o .lld 2onfp.rcgu.o
2onf alse .lld e 2onfp.rcgu.o lse
ip-0.0.17/src/licore.useBuiltinFSMonitor=false est` (dns block)
> - `pypi.tuna.tsinghua.edu.cn`
> - Triggering command: `/home/REDACTED/work/prek/prek/target/debug/prek
/home/REDACTED/work/prek/prek/target/debug/prek install-hooks -incompat
bmemchr-1fe43bea993d3235.rlib breg bsyn-2136fc17f010f281.rlib
3pURqBq1pk3divZeIfIb/target/release/deps/prek_rust_echo_lib_deps-59bce7d6001d3263.prek_rust_echo-c
3pURqBq1pk3divZeIfIb/target/release/deps/prek_rust_echo_lib_deps-59bce7d6001d3263.e4dqohtw0l0ytrcore.useBuiltinFSMonitor=false
lib 6ed2694.rlib 3pURqBq1pk3divZecommit.gpgsign=false b/rustlib/x86_64-c
b/ru b/rustlib/x86_64-c b/rustlib/x86_64core.autocrlf=false
b/rustlib/x86_64-c b/rustlib/x86_64/usr/bin/git b/rustlib/x86_64-c
b/rustlib/x86_64core.useBuiltinFSMonitor=false
b/rustlib/x86_64rev-parse` (dns block)
> - Triggering command: `/home/REDACTED/work/prek/prek/target/debug/prek
/home/REDACTED/work/prek/prek/target/debug/prek install --install-hooks
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.1nzs07cgjxiexpa7i3g2b01rt.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.24lsa75b6fov0tk3qt95numqq.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.27k9375t0pciii4hjcyuhgf4w.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.2gbphvwl0vvhd1w9zm3ido74e.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.2i6mzsq4vdcksvs36vquiynd0.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.2mdk2h4p88ofn49ujd91zdlk0.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.30nea9p9x6pr2
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.33cvujd6pv5nrd021hs6r57ur.1elqi5j.rcgu.o
/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.33svn44fanwynb1ljchzak5c5.1elqi5j.rcgu.o
u.1. in.so /lto-wrapper 1.93-x86_64-REDACTED-linux-gnu/bi-c
-f448dbb239ade73cc 0a5a4d1a26cf608--m64
orznfljxz.rcgu.o/tmp/rustcq8iZJY/symbols.o
1.93-x86_64-unkn/home/REDACTED/work/prek/prek/target/debug/deps/install-cf41a32d524c5058.0b78bzeosorigin`
(dns block)
> - Triggering command: `/home/REDACTED/work/prek/prek/target/debug/prek
/home/REDACTED/work/prek/prek/target/debug/prek install-hooks -I
angecoder aZFf pi -I p/bin/as hemars_derive-8b/usr/bin/git
hemars_derive-8b-c hemars_derive-8bcore.useBuiltinFSMonitor=false
hemars_derive-8bdiff hema hemars_derive-8b--no-textconv
hemars_derive-8b--ignore-submodules hemars_derive-8b--
hemars_derive-8bgit hemars_derive-8bcommit hemars_derive-8b-m
hemars_derive-8bUpdate documentation for --locked flag usage

Co-authored-by: j178 &lt;10510431&#43;j17--eh-frame-hdr` (dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/j178/prek/settings/copilot/coding_agent)
(admins only)
>
> </details>

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Add an option to allow installing Rust tools with
`--locked`</issue_title>
> <issue_description>Without the `--locked` option and without
dependencies properly specified in the hook, a new version release of a
dependency can cause the hook that previously worked to suddenly stop
working. Therefore, I propose adding an option to use `--locked`, as
propsed in https://github.com/pre-commit/pre-commit/issues/3162 .
> 
> Alternatively, as proposed in https://github.com/j178/prek/issues/681,
supporting `cargo-binstall` would also resolve this issue for users with
limited security concerns.</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> <comment_new><author>@j178</author><body>
> I think we should probably always use `--locked`, would that be a
breaking change?</body></comment_new>
> <comment_new><author>@j178</author><body>
> > would that be a breaking change?
> 
> Yeah. For crates that don’t ship a `Cargo.lock`, `cargo install
--locked` will fail.</body></comment_new>
> </comments>
> 


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes j178/prek#1567

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/j178/prek/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
2026-02-18 21:32:40 +08:00
Jo c741c8c277 Bump version to 0.3.3 (#1655) 2026-02-15 21:20:37 +08:00
Tin Lai eb80de7b6c Match files/exclude filter against relative path of nested project (#1624)
Previously, in a setup that looks like
```
.
├── .pre-commit-config.yaml        # setting A (root)
└── mynestedrepo
    ├── .pre-commit-config.yaml    # setting B (nested repo)
    └── tobeexcluded
        └── nodonttrackthis.md
```
`mynestedrepo` is a nested folder using the **workspace** feature with a
nested `.pre-commit-config.yaml`. Ideally (especially in a monorepo
setup), it shouldn't need to care about any folder level above it.

Previously, if `mynestedrepo/.pre-commit-config.yaml` B contains
```yaml
exclude: (^tobeexcluded/)
repos:
  ...
```
one would expect `mynestedrepo/tobeexcluded` to be excluded. However,
the path passed from the filename filter previously uses the full path,
so it will still modify the `nodonttrackthis.md` file even though it
should be excluded.

Currently, the inner settings exclude pattern needs to specify either
`(^mynestedrepo/tobeexcluded/)` (which is not ideal if we want the inner
repo to be agnoistic to any folder above it) or `(tobeexcluded/)` (which
risk excluding some wanted folder if the exclude pattern is generic).

This PR makes it so that only the inner relative path is passed to the
filename filter.

----
i.e., instead of passing
`mynestedrepo/tobeexcluded/nodonttrackthis.md`
we pass
`tobeexcluded/nodonttrackthis.md`
to the inner project instead

---------

Signed-off-by: Tin Lai <tin@tinyiu.com>
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2026-02-12 15:42:41 +08:00
Jo 8fdc71ddf5 Add "Willing to submit PR" checkbox to bug report form (#1611) 2026-02-09 16:33:26 +08:00
Jo 4406340db0 Add install source detection for mise (#1605) 2026-02-08 17:06:42 +08:00
Ismar 74a35b6e70 Add prek util list-builtins command (#1600) 2026-02-08 14:02:44 +08:00
Jo b4ed3ee940 Clarify prek list description (#1604)
Closes #1599
Extracted from #1600
2026-02-08 13:45:01 +08:00
Shaan Majid c99a61efd2 Make yaml-to-toml CONFIG argument optional (#1593)
Now attempts to default to `.pre-commit-config.yaml` and
`.pre-commit-config.yml` in PWD before erroring.

Feel free to close if you disagree, just ran into this when spinning up
#1592, and figured it's worth fixing :)

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2026-02-07 23:19:04 +08:00
Jo 71790f3b08 Bump version to 0.3.2 (#1587) 2026-02-06 21:33:16 +08:00
Jo 3fa9187f64 Add prek util yaml-to-toml to convert .pre-commit-config.yaml to prek.toml (#1584) 2026-02-06 16:11:01 +08:00
Jo b516d66ab3 Update quick start to use prek.toml (#1576) 2026-02-05 22:58:05 +08:00
Jo 60eb3f47e7 Document that use --refresh to pick up .prekignore changes (#1575)
For https://github.com/j178/prek/issues/1522#issuecomment-3853425122
2026-02-05 21:24:31 +08:00
Jo 16f514bafd Move identify and init-template-dir under the prek util top-level command (#1574)
The old `prek init-template-dir` is hide but still works.
2026-02-05 19:39:52 +08:00
Jo 44ea4c9cab Update schema store url for prek 2026-02-05 17:43:55 +08:00
Jo d784a470f1 Add documentation about prek.toml (#1560)
update schema url
2026-02-05 17:10:30 +08:00
Jo e0b8bb1305 Support prek sample-config --format toml (#1546)
Support `prek sample-config --format toml`
2026-02-05 17:10:30 +08:00
Jo 1539b5a210 Add document about authoring remote hooks (#1571) 2026-02-05 17:09:42 +08:00
Copilot 752959ea20 Fix PowerShell completion instruction syntax (#1568)
The PowerShell completion instruction used bash-style environment
variable syntax (`COMPLETE=powershell prek`), which fails in PowerShell
with `CommandNotFoundException`.

## Changes

- Updated `docs/installation.md` to use PowerShell-native syntax for
setting environment variables

**Before:**
```powershell
Add-Content -Path $PROFILE -Value '(COMPLETE=powershell prek) | Out-String | Invoke-Expression'
```

**After:**
```powershell
Add-Content -Path $PROFILE -Value '$env:COMPLETE = "powershell"; prek | Out-String | Invoke-Expression; Remove-Item Env:\COMPLETE'
```

The fix sets `$env:COMPLETE` using PowerShell syntax, invokes `prek` to
generate the completion script, and cleans up the temporary environment
variable.

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Powershell completion script results in
CommandNotFoundException</issue_title>
> <issue_description>### Summary
> 
> Following the instructions for enabling Powershell shell completions,
I ran `Add-Content -Path $PROFILE -Value '(COMPLETE=powershell prek) |
Out-String | Invoke-Expression'`. This did what I expected it to: it
added a line to my $PROFILE, `(COMPLETE=powershell prek) | Out-String |
Invoke-Expression`.
> 
> However, also as expected, that line results in this error when the
profile loads (and, indeed, if one types that string at the prompt:
> ```
> COMPLETE=powershell : The term 'COMPLETE=powershell' is not recognized
as the name of a cmdlet, function, script file, or operable
> program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
> At
C:\Users\Patrick\OneDrive\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:357
char:2
> + (COMPLETE=powershell prek) | Out-String | Invoke-Expression
> +  ~~~~~~~~~~~~~~~~~~~
> + CategoryInfo : ObjectNotFound: (COMPLETE=powershell:String) [],
CommandNotFoundException
>     + FullyQualifiedErrorId : CommandNotFoundException
> ```
> 
> If the problem isn't apparent, perhaps someone can tell me what it's
designed to do so I can help? As a user of both Powershell & unix
shells, I wasn't able to figure out what the command is that we want
Powershell to run after glancing at some of the other completion
scripts.
> 
> ### Platform
> 
> Windows 10 x86_64
> 
> ### Version
> 
> prek 0.3.1 (bc142a25f 2026-01-31)
> 
> ### .pre-commit-config.yaml
> 
> not relevant
> 
> ### Log file
> 
> 2026-02-05T03:33:51.720707Z DEBUG prek: 0.3.1 (bc142a25f 2026-01-31)
> 2026-02-05T03:33:51.720806Z DEBUG Args: ["c:\\users\\username
\\.local\\bin\\prek.exe"]
> 2026-02-05T03:33:51.803464Z TRACE get_root: close time.busy=82.6ms
time.idle=5.10µs</issue_description>
> 
> <agent_instructions>Fix the powershell completion instruction in
installation.md: the style of running command with specified env var
`COMPLETE=powershell prek` is bash-style, it does not work in
powershell. Use something like `$env:COMPLETE = "powershell"; prek |
Out-String | Invoke-Expression; Remove-Item Env:\COMPLETE`
> </agent_instructions>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> <comment_new><author>@j178</author><body>
> Thanks for the report! That instruction isn’t correct. Could you try
adding this to your $PROFILE?
> 
> ```pwsh
> $env:COMPLETE = "powershell"
> prek | Out-String | Invoke-Expression
> Remove-Item Env:COMPLETE'
> ```</body></comment_new>
> </comments>
> 


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes j178/prek#1566

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
2026-02-05 12:11:38 +08:00
Shaan Majid d548c08361 Add llms.txt generation for LLM-friendly documentation (#1553)
Closes #1498 

Generates `llms.txt` and `llms-full.txt` for the documentation site.
Also generates markdown files at each path (e.g.,
`/configuration/index.md`), enabling LLMs to fetch raw markdown instead
of HTML.

As mentioned in the issue, this wasn't natively possible, since Zensical
doesn't yet support MkDocs's plugin ecosystem. I built
[llmstxt-standalone](https://github.com/shaanmajid/llmstxt-standalone)
to work as a standalone `llms.txt` generator, respecting the config for
[mkdocs-llmstxt](https://github.com/pawamoy/mkdocs-llmstxt).

- Configure llmstxt plugin in mkdocs.yml with section structure
- Add `docs-build` and `docs-compile` mise tasks
- Update CI to run llmstxt-standalone after zensical build

Note: the generated files are not served or visible when using `zensical
serve`, but will be generated and published to docs site as part of the
`publish-docs` workflow.

Preview: 
-
[llms.txt](https://gist.github.com/shaanmajid/767af572028a23ec4d0bfac2015011a5#file-llms-txt)
-
[llms-full.txt](https://gist.github.com/shaanmajid/767af572028a23ec4d0bfac2015011a5#file-llms-full-txt)

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2026-02-04 13:58:36 +08:00
wangxiaolei df0adba920 Add prek identify subcommand (#1554)
fix #1550

cargo run -- identify .gitignore Cargo.lock README.md .github/

output

```
.gitignore                                                                        
   Tags: file, non-executable, text, gitignore

Cargo.lock
   Tags: file, non-executable, text, toml, cargo-lock

README.md
  Tags: file, non-executable, text, plain-text, markdown

.github/
  Tags: directory
```

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2026-02-04 13:53:31 +08:00
Shaan Majid 73e14e65d3 Revert "Allow optional upgrade hints after semicolon in minimum_prek_version" (#1538) 2026-02-03 08:34:38 +08:00
Jo 1c1af94121 Allow optional upgrade hints after semicolon in minimum_prek_version (#1536)
Closes #1490
2026-02-02 22:35:12 +08:00
Les Freire 0a4be22599 Support Julia language (#1519)
resolve #1446

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2026-02-01 16:13:55 +08:00
Aleksey f10ae08be6 Add PREK_QUIET environment variable support (#1513)
This PR addresses issue #1512 by adding `PREK_QUIET` environment
variable support for controlling quiet output mode (analogous to
`-q`/`-qq` flags).

Key changes include:
- `PREK_QUIET=1` -> quiet mode (like `-q`)
- `PREK_QUIET=2` -> silent mode (like `-qq`)
- Added integration tests and documentation
2026-02-01 09:40:21 +08:00
Shaan Majid 4525825ea8 docs: remove todo.md (#1501)
- Remove `todo.md` as remaining items have been addressed or documented
elsewhere.
- Move note to `diff.md` that `pre-commit hazmat` subcommand (v4.5.0) is
not implemented.
2026-01-31 22:34:14 +08:00
Jo 41a26c1c0f Bump version to 0.3.1 (#1510) 2026-01-31 20:56:29 +08:00
Les Freire d12e0be035 Support haskell language (#1484)
resolve #1445

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2026-01-31 20:28:42 +08:00
Jo 1000d9bfb5 Add a note about the .pre-commit-config.yaml file name for new users (#1505)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-31 15:24:31 +08:00
Shaan Majid 09f1a99947 docs(installation): miscellaneous cleanup (#1502)
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2026-01-31 15:20:04 +08:00