-
Notifications
You must be signed in to change notification settings - Fork 270
Open
Labels
feature requestA new lefthook feature descriptionA new lefthook feature description
Description
Description
I've noticed that templated scripts cannot be run when passed to the skip field.
templates:
skip_slow_hooks: '[ "$CLAUDECODE" != "1" ];'
pre-commit:
parallel: true
jobs:
- name: "Typecheck"
skip:
- run: '{skip_slow_hooks}' # doesn't work
run: 'uv run npx pyright --threads 4 {staged_files}'templates:
skip_slow_hooks: '[ "$CLAUDECODE" != "1" ]; then exit 0; fi &&'
pre-commit:
parallel: true
jobs:
- name: "Typecheck"
run: '{skip_slow_hooks} uv run npx pyright --threads 4 {staged_files}' # worksWhat problem it is solving?
As can be seen, I'm trying to implement an easily overridable config where Claude code commit will trigger more extensive hooks, and also any user who wants to opt in can do so via their local config file. While skip is more verbose, I think it is easier to reason about than manually gating commands via early exits. skip also allows you to skip a whole group at once.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestA new lefthook feature descriptionA new lefthook feature description