Skip to content

Run this repository's own hooks only at the pre-commit stage - #11

Merged
sergej-koscejev merged 1 commit into
mainfrom
prek-default-stages
Oct 23, 2026
Merged

sergej-koscejev merged 1 commit into
mainfrom
prek-default-stages

Conversation

@sergej-koscejev

Copy link
Copy Markdown
Member

When prek is installed for the commit-msg hook type (for example through a global hook.* entry in ~/.gitconfig), it also runs hooks that have no stages setting. prettier then gets the commit message file and fails with "No matching files", which blocks the commit.

This sets default_stages: [pre-commit] in .pre-commit-config.yaml, so the repository's own hooks run only on commit.

Hooks without a stages setting, such as prettier, otherwise also run when
prek is installed for the commit-msg hook type, and prettier then fails on
the commit message file.
@sergej-koscejev
sergej-koscejev merged commit 7553559 into main Oct 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant