fix(pre-commit): use stylua prebuilt-binary hook variant#203
Merged
Conversation
The default `stylua` hook (language: rust) installs stylua via `cargo install`, which requires a working C linker (`cc`). On minimal Linux hosts without a system toolchain (notably TrueNAS appliances where apt is disabled), env install fails with "linker `cc` not found" and blocks every commit — even commits that don't touch Lua — because pre-commit installs hook envs eagerly on first use. Switch to `stylua-github`, the upstream-provided variant that downloads a prebuilt release binary instead of building from source. macOS and standard Linux runners are unaffected. Verified on a TrueNAS host without `cc`: `pre-commit clean && pre-commit run --all-files` now passes end-to-end. Fixes #200 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
| Status | Count |
|---|---|
| 🔍 Total | 128 |
| ✅ Successful | 122 |
| ⏳ Timeouts | 0 |
| 🔀 Redirected | 0 |
| 👻 Excluded | 5 |
| ❓ Unknown | 0 |
| 🚫 Errors | 1 |
Errors per input
Errors in exact_dot_claude/docs/prds/daily-catchup.PRD.md
- [509] https://date-fns.org/ | Failed: Network error: Unknown status code
Full Github Actions output
Please fix the broken links before merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
id: stylua(language: rust, builds from source viacargo install) toid: stylua-github(downloads a prebuilt release binary from the upstream repo).Why
The default upstream hook tries to
cargo install styluaon first use. That requirescc, which isn't present on minimal Linux hosts whereaptis disabled (notably TrueNAS appliances). Result: every commit fails on those hosts — even commits that don't touch any Lua files — because pre-commit installs hook envs eagerly. Workaround in use until now wasSKIP=stylua git commit …per commit (see #199).The upstream repo ships three variants at
v2.1.0:cc?styluastylua-system$PATHstylua-githubstylua-githubkeeps the workflow uniform across machines without requiring a per-host stylua install, matching the preference in #200.Test plan
cc):pre-commit clean && pre-commit run --all-files→StyLua (Github) ... PassedFixes #200
🤖 Generated with Claude Code