From 77e9c2c37f62155554238e1eaf4323eaac85eaf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergej=20Ko=C5=A1=C4=8Dejev?= Date: Fri, 23 Oct 2026 14:15:47 +0200 Subject: [PATCH] Run this repository's own hooks only at the pre-commit stage 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. --- .pre-commit-config.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index faac6aa..13bbf61 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,7 @@ # Hooks run against this repository itself. +# Run hooks only on commit. Otherwise a commit-msg hook installed for prek runs hooks without a `stages` setting, such as +# prettier, on the commit message file. +default_stages: [pre-commit] repos: - repo: https://github.com/rbubley/mirrors-prettier rev: 5c9b20b95f2bc1c4d3d929b83a96d5c96a29e752 # frozen: v3.9.8