I made a little GitHub bot (https://github.com/j178/prek-ci-bot) and
deployed it on Vercel. It downloads CI artifacts and posts comments on
PRs. Now that it works, we can get rid of that risky `on: workflow_run`
trigger.
Introduces a centralized `git_cmd()` helper that disables GPG signing
via environment variables, preventing test failures for contributors
with signing enabled globally. Refactors all test files to use the
helper, reducing boilerplate.
@j178 lmk if you disagree with this and want me to close this haha, but
I was getting kind of annoyed at all the prompts from my password
manager asking me to sign commits whenever running the unit test suite
locally lol
---------
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
* feat(swift): add Swift language support
Implement Swift language support for prek:
- Query swift executable and parse version from `swift --version`
- Handle both macOS (Apple Swift) and Linux version formats
- Normalize versions without patch component (e.g., "6.1" -> "6.1.0")
- Handle pre-release versions (e.g., "6.2-dev")
- Build Package.swift repos with `swift build -c release`
- Use `swift build --show-bin-path` to resolve target-specific bin directory
- Add built binaries to PATH when running hooks
- Health check verifies swift executable still exists
Include unit tests for version parsing covering:
- macOS format with swift-driver prefix
- Linux format
- Multiline output handling
- Versions without patch component
- Development/nightly versions
- Invalid input handling
* test(swift): add Swift language tests
* docs(swift): mark Swift as supported in language documentation
* ci: stabilize swift toolchain setup across platforms
- pin Swift version in env to keep CI deterministic\n- use SwiftyLab/setup-swift on Windows where swift-actions fails\n- install Swift on macOS and reset TOOLCHAINS back to Xcode\n- force CC/CXX/SDKROOT from Xcode so Ruby native gems compile\n\nThis keeps Swift hooks available while restoring Xcode's clang/SDK,\nwhich avoids msgpack native extension failures on macOS.
* feat(bun): add Bun language support
* test(bun): add integration tests for Bun language support
Add three integration tests covering the key functionality:
- basic_bun: simple hook execution using bun -e
- additional_dependencies: verify deps installed via bunx cowsay
- language_version: test version specification with language_version: "1"
The additional_dependencies test runs twice to verify health_check and
cache reuse works correctly.
* docs: add Bun to supported languages documentation
- Add Bun to toolchain list in README features section
- Add Bun to managed toolchain downloads list in languages.md
- Add full Bun language section with version format documentation
* ci: add Bun setup to test jobs
* feat(bun): use GITHUB_TOKEN to avoid API rate limits
When listing Bun versions from GitHub releases, use the GITHUB_TOKEN
environment variable if available to authenticate requests. This
increases the rate limit from 60 to 5,000 requests/hour.
GITHUB_TOKEN is automatically set in GitHub Actions workflows.
* fix(bun): use consistent bin_dir path on all platforms
Bun installs global packages to $BUN_INSTALL/bin/ on all platforms,
so bin_dir should always return prefix/bin. The Windows special case
was incorrectly copied from Node (which uses npm's different install
structure).
* Add toolchain download test
* Add tests
---------
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
* fix: resolve relative repo paths from config file directory
Relative paths like `../hook-repo` in `.pre-commit-config.yaml` were
being resolved against the process's current working directory instead
of the directory containing the config file. This broke configs in
subprojects that used relative paths to hook repositories.
The fix resolves relative repo paths in `Project::from_config_file`
right after loading the config, using the config file's parent
directory as the base.
Fixes#1065
* Minor tweaks
---------
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
Add integration tests verifying that prek correctly identifies and
reports skipped hooks in various scenarios.
Tests cover:
- All hooks skipped due to no matching files
- Dry run mode skipping all hooks
- Mixed scenarios with both executed and skipped hooks
- Skipped hooks across multiple priority groups
Includes regression test for #1335: verifies that `git diff` is only
called once (initial baseline) when all hooks skip, not once per
priority group. Uses tracing output to count `get_diff` calls.
Refs: #1327, #1335
* chore: slight formatting adjustments
* feat: use zensical
* chore: add uv to mise.toml
* docs: update snippets and snippet markers for includes
* chore: add prek to mise.toml; run prek
* fix: use snippet for changelog instead of symlink
Seems Zensical doesn't like symlinks, a snippet gets the same result
* chore: remove commented-out code
* chore: remove commented-out code; run prek