From d08cd1b35eba0c44e15cfa37eb89ef6a45dc99c4 Mon Sep 17 00:00:00 2001 From: JP-Ellis Date: Wed, 18 Dec 2024 17:10:19 +1100 Subject: [PATCH] chore: Expand default hooks installed When developers run `pre-commit install`, pre-commit by default only installed the `pre-commit` hook. The configuration also makes use of the `commit-msg` hook which would remain unused. The developer is required to run `pre-commit install -t commit-msg` (in addition to the default install), which they would only know from inspecting the pre-commit configuration file. By specifying both hooks in `default_install_hook_types`, a simple `pre-commit install` will ensure that _both_ hooks are installed. This should hopefully provide a better developer experience and catch a few lints _before_ they are pushed to a branch and cause CI to fail. Signed-off-by: JP-Ellis --- .pre-commit-config.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4acd178..f06c0f7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,7 @@ +default_install_hook_types: + - pre-commit + - commit-msg + repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0