# Git hooks — docs/10 §4. # `data` and `i18n` are two jobs on two globs on purpose: folding the parity # check into validate:data means a commit touching only src/i18n/*.json never # runs it (docs/07 §3). pre-commit: parallel: true jobs: - name: format glob: '*.{ts,js,mjs,astro,svelte,css,json,jsonc,yml,yaml,md}' exclude: - 'src/data/apps/*.json' run: pnpm prettier --write {staged_files} stage_fixed: true # App data is formatted by directory rather than by file list. A bulk # data change interpolates one path per app into {staged_files}, and the # 286-app seed overran the Windows 8 KB command-line limit — the commit # aborted with "The command line is too long." - name: format-data glob: 'src/data/apps/*.json' run: pnpm prettier --write src/data/apps stage_fixed: true - name: lint glob: '*.{ts,js,mjs,astro,svelte}' run: pnpm eslint {staged_files} - name: data glob: 'src/data/**' run: pnpm validate:data - name: i18n glob: 'src/i18n/**' run: pnpm i18n:check pre-push: jobs: - name: test run: pnpm test