Files
copilotkit__copilotkit/lefthook.yml
T

49 lines
1.4 KiB
YAML
Raw Normal View History

2026-03-02 14:59:16 +01:00
output:
- meta
- summary
- success
- failure
- execution
- execution_out
- execution_info
- skips
pre-commit:
2026-03-02 16:41:23 +01:00
parallel: true
commands:
check-binaries:
tags: binaries
run: bash scripts/hooks/check-binaries.sh
sync-lockfile:
tags: lockfile
glob: "**/package.json"
run: pnpm i --lockfile-only
stage_fixed: true
lint-fix:
2026-03-02 15:56:37 +01:00
tags: lint
# Scope oxlint and oxfmt to just the files staged for commit — running
# `--fix .` / `--write .` across the whole monorepo on every commit is
# both slow and blurs the hook's purpose (touch files that aren't part
# of this change). Guard against empty `{staged_files}` expansion: when
# a commit touches only non-matching files (markdown, YAML), lefthook
# still invokes this hook with an empty expansion, and oxlint/oxfmt
# would default to operating on the current directory, defeating the
# scoping entirely. stage_fixed re-stages whatever the hooks modify.
glob: "*.{js,jsx,ts,tsx,mjs,cjs}"
run: |
if [ -n "{staged_files}" ]; then
pnpm exec oxlint --fix {staged_files} && pnpm exec oxfmt --write {staged_files}
fi
stage_fixed: true
2026-03-02 16:09:55 +01:00
test-and-check-packages:
tags: test-packages
env:
NX_TUI: "false"
2026-03-02 16:09:55 +01:00
run: pnpm run test && pnpm run check:packages
commit-msg:
commands:
commitlint:
2026-03-02 15:56:37 +01:00
tags: commitlint
run: pnpm commitlint --edit {1}