Skip to content

Commit

Permalink
chore: Expand default hooks installed
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
JP-Ellis committed Dec 18, 2024
1 parent 2bd88eb commit d08cd1b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit d08cd1b

Please sign in to comment.