You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(hooks): run every pre-commit hook natively on Windows #229
The lefthook renovate-helper pre-commit check fails on Windows with WinError 193. Its test fixture is a fake gh shell script, which Windows can't run as a Win32 executable. Every Windows commit has to set LEFTHOOK_EXCLUDE=renovate-helper, even when the change doesn't touch the Renovate helper. The SkillSpector PRs (#215/#218) and #228 both ran into it. The check passes on Linux and under WSL.
Proposed solution
Make the fixture work on Windows: invoke it through the interpreter (for example sys.executable with a Python fake, or bash explicitly), or provide a .cmd shim.
Alternatively, skip only that fixture-based test on Windows, with a clear reason, while CI keeps running it on Linux.
Confirm lefthook run pre-commit passes on Windows without exclusions.
Alternatives considered
Keep excluding the hook on Windows by hand: it's easy to forget, and it hides real failures.
changed the title [-]fix(hooks): make the renovate-helper pre-commit check work on Windows[/-][+]fix(hooks): run every pre-commit hook natively on Windows[/+]on Nov 15, 2026
Scope extended (2026-11-15, owner-approved): make every pre-commit hook run natively on Windows, not just renovate-helper.
Six lefthook commands call python3 directly (renovate-helper, release-please-config, apm-manifest, apm-overrides, skillspector-gate, plus any added later). On Windows, python3 usually resolves to the Microsoft Store stub (%LOCALAPPDATA%\Microsoft\WindowsApps\python3.exe), which runs no code, so sessions fall back to WSL or skip hooks. The two Bash hooks run fine under Git for Windows bash.
Plan:
Add one small launcher (for example scripts/py, a POSIX sh script that lefthook runs through Git bash on Windows). It picks the first real interpreter of a minimum version (match CI; check python-version in the workflows) from python3, py -3, python. It skips the WindowsApps Store stub, and fails with a clear message ("install Python ≥ X, or disable the python3 App execution alias") when none qualifies.
Switch every Python lefthook command to the launcher.
Fix the renovate-helper fixture (WinError 193): run the fake gh through the interpreter, or use a .cmd shim, so the test passes on Windows.
CI: run the lefthook pre-commit suite on a windows-latest job as well (lefthook run pre-commit --all-files, or the same unittest commands through the launcher), so a Windows regression fails the PR. Keep it cheap: path-filtered to hooks, tests and scripts.
Activity
[-]fix(hooks): make the renovate-helper pre-commit check work on Windows[/-][+]fix(hooks): run every pre-commit hook natively on Windows[/+]DevSecNinja commentedon Nov 15, 2026
Scope extended (2026-11-15, owner-approved): make every pre-commit hook run natively on Windows, not just renovate-helper.
Six lefthook commands call
python3directly (renovate-helper, release-please-config, apm-manifest, apm-overrides, skillspector-gate, plus any added later). On Windows,python3usually resolves to the Microsoft Store stub (%LOCALAPPDATA%\Microsoft\WindowsApps\python3.exe), which runs no code, so sessions fall back to WSL or skip hooks. The two Bash hooks run fine under Git for Windows bash.Plan:
scripts/py, a POSIXshscript that lefthook runs through Git bash on Windows). It picks the first real interpreter of a minimum version (match CI; checkpython-versionin the workflows) frompython3,py -3,python. It skips the WindowsApps Store stub, and fails with a clear message ("install Python ≥ X, or disable the python3 App execution alias") when none qualifies.WinError 193): run the fakeghthrough the interpreter, or use a.cmdshim, so the test passes on Windows.windows-latestjob as well (lefthook run pre-commit --all-files, or the same unittest commands through the launcher), so a Windows regression fails the PR. Keep it cheap: path-filtered to hooks, tests and scripts.