/
githubmirror
/
Front-End-Checklist
Обзор
Документация
Войти
/
githubmirror
/
Front-End-Checklist
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
lefthook.yml
152 строки
5 KB
David Dias
chore: standardize Front-End Checklist branding
30 май 2026, 06:29
30 май 2026, 06:29
786771f
Код
Авторство
О чём код?
# Lefthook Configuration # Using existing validation scripts pre-commit: parallel: false commands: # Code formatting and linting check: glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}" run: pnpm biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files} stage_fixed: true # Fail fast on obviously leaked credentials before they hit the repo check-secrets: glob: "*.{js,ts,cjs,mjs,jsx,tsx,json,jsonc,env}" run: | if grep -El "(sk_live_|sk_test_|ghp_|gho_|github_pat_|xoxb-|xoxp-|AIza[0-9A-Za-z_-]{35}|-----BEGIN (RSA |EC )?PRIVATE KEY-----|AKIA[0-9A-Z]{16})" {staged_files}; then echo "ERROR: Potential secret detected in staged files." exit 1 fi exit 0 # Keep large binaries and oversized assets out of normal source commits check-large-files: glob: "*.{ts,tsx,js,jsx,json,css,svg,png,jpg,jpeg,webp,avif,ico}" run: | for file in {staged_files}; do [ -f "$file" ] || continue size=$(wc -c < "$file") if [ "$size" -gt 512000 ]; then echo "ERROR: $file is $(($size / 1024))KB (max 500KB)" exit 1 fi done exit 0 # Package.json sorting sort-package-json: glob: "**/{package.json}" exclude: "node_modules/**" run: pnpm dlx sort-package-json {staged_files} stage_fixed: true # Regenerate skills when rule MDX files change generate-skills: glob: "packages/content/rules/en/**/*.mdx" run: pnpm tsx scripts/generate/generate-skills.ts {staged_files} && git add skills/ # Regenerate README catalog when rule MDX files change generate-readme: glob: "packages/content/rules/en/**/*.mdx" run: pnpm generate:readme && git add README.md docs/generated/rules-catalog.md # Enforce canonical rule section structure on changed rules validate-rule-structure: glob: "packages/content/rules/en/**/*.mdx" run: pnpm validate:rule-structure {staged_files} # Enforce claim-to-source evidence metadata on changed rules validate-evidence: glob: "packages/content/rules/en/**/*.mdx" run: pnpm validate:evidence {staged_files} # Fail commit if changed rules score below minimum quality threshold score-rules: glob: "packages/content/rules/en/**/*.mdx" run: pnpm tsx scripts/rule-structure/score-rules.ts {staged_files} # TypeScript as casts validation check-as-casts: glob: "**/*.{ts,tsx}" exclude: | **/node_modules/** **/*.test.* **/*.spec.* run: node scripts/validation/check-as-casts.js {staged_files} # Barrel files validation check-barrel-files: glob: "**/index.{js,ts,jsx,tsx}" exclude: "**/node_modules/**" run: node scripts/validation/check-barrel-files.js {staged_files} # Console logs validation check-console-logs: glob: "**/*.{js,jsx,ts,tsx}" exclude: | **/node_modules/** **/*.test.* **/*.spec.* **/scripts/** **/packages/validators/** **/packages/generator/** run: node scripts/validation/check-console-logs.js {staged_files} # Directory structure validation check-directory-structure: run: node scripts/validation/check-directory-structure.js # File complexity validation check-file-complexity: glob: "**/*.{js,jsx,ts,tsx}" exclude: | **/node_modules/** **/*.test.* **/*.spec.* run: node scripts/validation/check-file-complexity.js {staged_files} # JSDoc validation check-jsdoc: glob: "**/*.{js,jsx,ts,tsx}" exclude: | **/node_modules/** **/*.test.* **/*.spec.* run: node scripts/validation/check-jsdoc.js {staged_files} # Relative imports validation check-relative-imports: glob: "apps/web/**/*.{ts,tsx,js,jsx}" exclude: "apps/web/**/node_modules/**" run: pnpm tsx scripts/validation/check-relative-imports.ts {staged_files} # Test modified test files test-modified: glob: "apps/web/**/*.{test,spec}.{js,ts,tsx}" run: cd apps/web && pnpm test:related {staged_files} # Check test coverage for web app check-coverage: glob: "apps/web/src/**/*.{ts,tsx,js,jsx}" exclude: | apps/web/src/**/*.test.* apps/web/src/**/*.spec.* run: cd apps/web && pnpm test:coverage --silent # Pre-push validation pre-push: commands: # Run tests with coverage test-coverage: run: cd apps/web && pnpm test:ci # Run build to ensure no type errors build-check: run: turbo build --filter=web # Commit message validation commit-msg: commands: lint-commit-message: run: pnpm commitlint --edit {1}