Files
kandev/.pre-commit-config.yaml
T
Carlos Florêncio bffbc8e96f ci: add harness file linter (#1549)
* ci: add harness file linter

* ci: address harness linter review feedback

* ci: cover codex harness config linting

* ci: tighten harness lint opt-ins

* ci: expand harness lint coverage

* ci: address harness linter review feedback

* ci: fix harness linter review followups

* ci: lint claude settings harness config

* ci: tighten harness linter coverage

* ci: fail malformed harness toml

---------

Co-authored-by: root <root@kandev.ts.net>
2026-06-30 00:25:34 +01:00

54 lines
1.8 KiB
YAML

repos:
# Commit message validation (Conventional Commits via commitlint)
- repo: local
hooks:
- id: commitlint
name: Validate commit message (Conventional Commits)
entry: bash -c 'cd apps && pnpm exec commitlint --edit "$1"' --
language: system
stages: [commit-msg]
always_run: true
# Harness guidance hooks
- repo: local
hooks:
- id: harness-lint
name: Harness file lint
entry: python3 .github/scripts/lint-harness-files.py
language: system
pass_filenames: true
# Backend (Go) hooks
- repo: local
hooks:
- id: gofmt
name: gofmt (backend)
entry: bash -c 'gofmt -w "$@"' --
language: system
files: ^apps/backend/.*\.go$
pass_filenames: true
- id: go-lint
name: Go lint (changed files only)
entry: bash -c 'unset GIT_DIR GIT_WORK_TREE; cd apps/backend && golangci-lint run --new-from-rev=HEAD'
language: system
files: ^apps/backend/.*\.go$
pass_filenames: false
# Web app (TypeScript/React) hooks
- repo: local
hooks:
- id: prettier-format
name: Prettier format (web/cli/packages)
entry: bash -c 'cd apps || exit 1; args=(); for f in "$@"; do args+=("${f#apps/}"); done; pnpm exec prettier --write --ignore-unknown "${args[@]}"' --
language: system
files: ^apps/(web|cli|packages)/.*\.(ts|tsx|js|jsx|mjs|cjs|json|md|mdx|yml|yaml|css|scss)$
pass_filenames: true
- id: web-lint
name: Web lint (changed files only)
entry: bash -c 'cd apps/web || exit 1; args=(); for f in "$@"; do args+=("${f#apps/web/}"); done; pnpm exec eslint --max-warnings 0 "${args[@]}"' --
language: system
files: ^apps/web/.*\.(ts|tsx|js|jsx)$
pass_filenames: true