docs: conditional pre-commit

This commit is contained in:
murat 2026-01-15 15:11:43 -06:00
parent 4001b175bd
commit 451b0829f2
3 changed files with 13 additions and 8 deletions

View File

@ -5,5 +5,14 @@ npx --no-install lint-staged
# Validate everything
npm test
npm run docs:validate-links
npm run docs:build
# Validate docs links only when docs change
if command -v rg >/dev/null 2>&1; then
if git diff --cached --name-only | rg -q '^docs/'; then
npm run docs:validate-links
fi
else
if git diff --cached --name-only | grep -Eq '^docs/'; then
npm run docs:validate-links
fi
fi

View File

@ -1,4 +0,0 @@
#!/usr/bin/env sh
npm run docs:validate-links
npm run docs:build

View File

@ -24,8 +24,8 @@ const BUILD_DIR = path.join(PROJECT_ROOT, 'build');
const SITE_URL = process.env.SITE_URL || 'https://bmad-code-org.github.io/BMAD-METHOD';
const REPO_URL = 'https://github.com/bmad-code-org/BMAD-METHOD';
const LLM_MAX_CHARS = 800_000;
const LLM_WARN_CHARS = 700_000;
const LLM_MAX_CHARS = 700_000;
const LLM_WARN_CHARS = 600_000;
const LLM_EXCLUDE_PATTERNS = ['changelog', 'ide-info/', 'v4-to-v6-upgrade', 'downloads/', 'faq'];