1
0
mirror of https://github.com/j178/prek.git synced 2026-04-03 17:34:03 +02:00
Commit Graph

107 Commits

Author SHA1 Message Date
Shaan Majid
651a7f29fb ci: remove setup-swift action, skip Swift tests on Windows (#1478) 2026-01-27 07:58:02 +08:00
renovate[bot]
b6d44a9453 Update GitHub Actions (#1479) 2026-01-27 07:48:02 +08:00
Jo
ca1d4b51ed Use prek-ci-bot to post comments on PR (#1476)
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.
2026-01-26 20:27:19 +08:00
Shaan Majid
e4d3dfd10a Add language: swift support (#1463)
* 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.
2026-01-23 11:28:18 +08:00
renovate[bot]
b7ee2dfeb8 Update GitHub Actions (#1460) 2026-01-22 23:12:34 +08:00
Jo
2a7d898a9c Bump uv versions 2026-01-22 14:32:20 +08:00
Jo
720c7cb732 Use git ls-remote --tags to list bun versions (#1439) 2026-01-22 11:05:41 +08:00
Jo
c34c41e384 Set GITHUB_TOKEN when running tests (#1426) 2026-01-22 11:05:41 +08:00
Shaan Majid
8d464397e6 Add language: bun support (#1411)
* 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>
2026-01-22 11:05:41 +08:00
Jo
ea9a51161c Set cargo related env vars (#1405) 2026-01-19 13:41:43 +08:00
Jo
8faa42c091 Add nextest partitioning for Windows tests (#1389)
* Add nextest partitioning for Windows tests

* Fix

* Fix

* Fix

* Fix

* Disable optimize for fast-build

* Fix integration bin name

* Fix

* Fix

* Try fix

* Debug

* Fix

* Fix path substitute

* Fix
2026-01-18 20:37:53 +08:00
Jo
e317d70939 Tweak CI (#1369) 2026-01-16 14:53:38 +08:00
Jo
fc54f145d9 Fix some tests isolation when git commit (#1365)
* Fix some tests isolation when `git commit`

* Fix rust cache save
2026-01-16 11:27:52 +08:00
renovate[bot]
7fd2da8a77 Update taiki-e/install-action action to v2.65.11 (#1364) 2026-01-15 22:43:07 +08:00
Jo
34fb8f3ecc Refactor CI workflow and cargo profile (#1361) 2026-01-15 16:54:52 +08:00
renovate[bot]
f1533e1497 Update GitHub Actions (#1357) 2026-01-15 11:18:30 +08:00
renovate[bot]
541df23466 Update actions/upload-artifact action to v6 (#1359) 2026-01-15 11:18:17 +08:00
Jo
fb857e62f5 Build and upload binaries in CI (#1340)
* Debug command line length

* Build binaries

* Revert "Debug command line length"

This reverts commit d17610dc0c.
2026-01-13 17:12:27 +08:00
Jo
c1ec7c8dd4 Add an ecosystem test for CPython (#1336) 2026-01-12 19:15:55 +08:00
Jo
50684fbdcf Drop powerpc64 wheels (#1319) 2026-01-07 22:05:42 +08:00
renovate[bot]
b300081a01 Update GitHub Actions (#1296) 2026-01-03 16:30:03 +08:00
Jo
ad5c0dfb6a Generate JSON schema for prek configuration (#1270)
* Generate JSON schema for prek configuration

* Fix schema for `Repo` enum

* Test in CI
2025-12-23 16:31:05 +08:00
Jo
9dd875d8c2 Bump taiki-e/install-action to v2.63.3 (#1230) 2025-12-15 22:40:05 +08:00
renovate[bot]
616c80531b Update GitHub Actions (#1166)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-01 11:28:31 +08:00
renovate[bot]
373ed413bc Update actions/checkout action to v6 (#1128) 2025-11-21 07:20:46 +08:00
renovate[bot]
2c29a40b3b Update GitHub Actions (#1078) 2025-11-15 13:13:43 +08:00
Jo
2765bdee15 Save rust cache for CI jobs on main only (#1056)
Take inspiration from https://github.com/astral-sh/ruff/pull/21359
2025-11-10 17:39:59 +08:00
renovate[bot]
e14219154d Update taiki-e/install-action action to v2.62.45 (#1007)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-03 19:38:24 +08:00
is-alnilam
d9baf0a5f1 Add Ruby support (no download support yet) (#993)
* Add Ruby support (no download support yet)

Currently only pre-existing Rubies are used, although the code will
search for and consider multiple versions. This allows a hook to require
3.4.7 when the default system Ruby is 3.4.6, but RVM (or a similar tool)
has installed 3.4.7. If a suitable Ruby cannot be found, the user is
prompted to install one manually and re-run.

Hooks get an isolated GEM_HOME, based on the hook repository, any
additional_dependencies, and the interpreter version/path. Any Ruby
upgrade would therefore re-install the gems to ensure that stale
versions aren't used. Repository gem dependencies are installed based on
the included gemspec files, combined with the additional_dependencies
field.

* Add pins for CI 'install Ruby' action

* Update setup-ruby pin

* Tweak version parsing

* Tweak env vars

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-11-03 19:12:25 +08:00
renovate[bot]
a69adc3791 Update GitHub Actions and speed up Windows CI (#1001)
* Update GitHub Actions

* Try to speed up windows CI

* Use `leafo/gh-actions-luarocks`

* Fix luarocks install failure

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-10-31 17:41:46 +08:00
Jo
6e69f990a9 Bump Rust toolchain to 1.91 (#1004)
* Bump Rust toolchain to 1.91

* Fix lint
2025-10-31 16:30:30 +08:00
renovate[bot]
b1d9fc1e62 Update GitHub Actions (#1003)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-31 15:24:12 +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
e366cc2679 Fix hotpath profile comparison results path 2025-10-28 21:16:54 +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
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
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
b86327004f Hardening github actions (#947)
* Hardening github actions

* Add config

* Fix comment
2025-10-21 14:17:22 +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
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
33ad008b7f Minor fix for cargo-bloat summary formatting (#933) 2025-10-19 18:56:51 +08:00
Jo
706960612e Improve cargo-bloat summary formatting (#932) 2025-10-19 18:00:48 +08:00
Louis Maddox
2d6cf9c78d Monitor binary size change in PRs via cargo-bloat workflow (#927)
* perf: monitor binary size change in PRs via cargo-bloat workflow

* perf: use mold linker and Swatinem/rust-cache

* revert: cannot use commit status in PR check

* fix: result was blank

* refactor: move the bloat check into main CI workflow

* refactor: Pythonise the bloat check

* Tweak

* Fix variable substitution

* Fix size extraction

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-10-19 17:45:28 +08:00
renovate[bot]
9af102ae28 Update j178/prek-action action to v1.0.11 (#841) 2025-10-06 09:53:56 +08:00
Jo
0dd84cd620 Improve language version download tests (#832) 2025-10-01 22:31:57 +08:00
renovate[bot]
1b86879736 Update j178/prek-action action to v1.0.10 (#830) 2025-10-01 20:05:32 +08:00
Jo
59960410fa Add support for .prekignore to ignore directories from project discovery (#826) 2025-10-01 18:15:10 +08:00
Jo
5d32b2fe0e Use prek-action in CI lint job (#822) 2025-09-30 17:41:12 +08:00
Jo
8392fcb08a Add a codecov configuration (#816) 2025-09-29 12:02:01 +08:00
renovate[bot]
876f2b912d Update taiki-e/install-action action to v2.62.12 (#815)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-29 10:46:13 +08:00