696049271f
Local quality gate that runs on every git commit: - node --check syntax on staged .js files - block on new emoji in staged .js/.html/.css (md files allowed) - block on new console.log/debug/debugger statements - backend route auth lint (existing npm run lint:routes) - backend tests (baseline 3 fails, block if grew) Install: npm run hooks:install (top-level) Bypass: git commit --no-verify Skips slow checks when irrelevant files changed (tests/lint only run if backend touched). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
18 lines
578 B
Batchfile
18 lines
578 B
Batchfile
@echo off
|
|
rem install-hooks.cmd -- installs the LearnSpace pre-commit hook on Windows
|
|
rem Usage: scripts\install-hooks.cmd
|
|
rem Or via npm: npm run hooks:install
|
|
|
|
for /f "tokens=*" %%i in ('git rev-parse --show-toplevel') do set REPO=%%i
|
|
set HOOK=%REPO%\.git\hooks\pre-commit
|
|
|
|
(
|
|
echo #!/bin/sh
|
|
echo # LearnSpace pre-commit hook ^(auto-generated -- edit scripts/pre-commit.js^)
|
|
echo REPO="$(git rev-parse --show-toplevel)"
|
|
echo node "$REPO/scripts/pre-commit.js" ^|^| exit 1
|
|
) > "%HOOK%"
|
|
|
|
echo Pre-commit hook installed at: %HOOK%
|
|
echo Bypass anytime with: git commit --no-verify
|