fix(pre-commit): install vale-sync from the cmd/vale package - #14753
Conversation
The vale module root carries no Go package (the vale binary lives
under cmd/vale), so the hook's environment install fails:
go: module github.com/errata-ai/vale/v3@v3.14.2 found, but does
not contain package github.com/errata-ai/vale/v3
pre-commit aborts the whole run on the install error before a single
hook fires and exits with code 3, so every hook in the config is
silently skipped wherever this configuration runs, the CI runner
included. Installing the cmd/vale package restores the gate.
Three inline-bash hook entries run past the 200 column line limit yamllint enforces, so the configuration fails its own gate the first time it is linted as a changed file. Folded block scalars carry the same commands: YAML joins the folded lines with single spaces, so the entries shlex to byte-identical argv.
|
See the Build Results workflow run for details. |
|
@TSC21 Yikes, this was nasty. Thanks so much for finding/fixing. |
There was a problem hiding this comment.
Pull request overview
Fixes pre-commit initialization and YAML lint compliance.
Changes:
- Installs Vale from its executable package path.
- Folds long Bash hook commands without changing behavior.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
One request before merge: please align the vale version pins while you're in here. |
@TSC21 Don't worry about this, I'll create a separate pull for that. |
vale-sync installed vale@v3.14.2 while the vale lint hook uses v3.15.1, so styles were synced with a different vale version than the one that lints. Bump the vale-sync dependency to v3.15.1 to keep the two in lockstep. Follow-up to #14753.
vale-sync installed vale@v3.14.2 while the vale lint hook uses v3.15.1, so styles were synced with a different vale version than the one that lints. Bump the vale-sync dependency to v3.15.1 to keep the two in lockstep. Follow-up to mavlink#14753.
vale-sync installed vale@v3.14.2 while the vale lint hook uses v3.15.1, so styles were synced with a different vale version than the one that lints. Bump the vale-sync dependency to v3.15.1 to keep the two in lockstep. Follow-up to #14753.
Contributed on behalf of RIIS, LLC.
CI/Build Changes
Two commits to the pre-commit configuration:
vale-synchook installs its Go dependency fromgithub.com/errata-ai/vale/v3/cmd/valeinstead of the module root. The module root does not contain a Go package (the vale binary lives undercmd/vale), sogo installfails and pre-commit aborts the entire run before a single hook fires.check-categorized-logging,check-no-qtest-ignore-message,check-no-fixed-qwait) are folded into YAML block scalars because they run past the 200 column limit that yamllint enforces, so the config was failing its own gate as soon as the file gets linted. YAML folds the lines with single spaces, so the entries parse to exactly the same command as before.Reason
Right now the whole pre-commit gate is silently dead: the broken
vale-syncenvironment install makes pre-commit exit with code 3 and zero hook verdicts, everywhere this config runs, CI included. The error is:So clang-format, typos, qmllint, actionlint and everything else in the config have not actually been running. I found this while chasing a pre-commit results artifact that reported
exit_code: 3, passed: 0, failed: 0on a fork. There is a companion PR that makes the workflow fail loudly when this class of breakage happens again.Testing
Impact
The pre-commit workflow on every PR, and every local
pre-commit run. No workflow files change in this PR.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).