1
0
mirror of https://github.com/j178/prek.git synced 2026-04-03 17:34:03 +02:00
Files
prek/docs
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
..
2026-01-20 19:44:15 +08:00
2026-01-22 11:05:41 +08:00
2026-01-20 19:44:15 +08:00
2026-01-22 11:49:30 +08:00
2026-01-20 19:44:15 +08:00
2026-01-20 19:44:15 +08:00
2026-01-22 11:05:41 +08:00