* Support `language: unsupported` and `language: unsupported_script` introduced in pre-commit v4.4
Honestly, I have no idea why `system` and `script` got deprecated or what we're supposed to use instead. I probably won't deprecate them in prek.
* Fix lint
The install command actually moves the existing hook file automatically,
so the message should say 'moved it to' rather than 'move it to' (which
reads like an instruction to the user).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* 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>
* 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>
* Add --fail-fast CLI flag to stop after first hook failure
- Add fail_fast field to RunArgs struct with CLI flag support
- Fix in hook_impl.rs where fail_fast was hardcoded to false
- Update run() and run_hooks() to accept and propagate fail_fast parameter
- CLI flag overrides config file setting (enables fail-fast mode)
- Ensure try-repo and main entry point pass fail_fast correctly
* Update test snapshots for --fail-fast flag
* Add CLI flag test for --fail-fast
* Fix trailing whitespace in test comment
* Use relative path with `--cd` in generated hook script
Use a relative path with `--cd` in the generated hook script to avoid switching to the original worktree.
Also, unset `GIT_DIR` in the hook script so git doesn’t treat the current directory (after the cd) as the git root.
* Fix snapshots
* Add tests
A version number could look like a float, e.g., 0.49 is a valid version
number. Serde YAML serialization already renders such version numbers in
quotes so types match the expectation. When doing an autoupdate we were
explicitly adding more quotes if they were present in the input. This
could have caused incorrect quoting if existing quoting clashed with
serde's quoting style, e.g., if `"` where used but serde defaulted to
quoting with `'`.
This patch removes any extra quoting here and fully defers to serde.
Closes#866.