From dac1f24f85f7c9b12e87ca495fbcb637f0d6653c Mon Sep 17 00:00:00 2001 From: Guillaume Lambert Date: Wed, 26 May 2021 21:27:51 +0200 Subject: [PATCH] Fix: prettier pre-commit configuration According to https://github.com/prettier/pre-commit the prettier repo to use in the pre-commit configuration file shifted to the new URL https://github.com/pre-commit/mirrors-prettier Also running this hook locally outside of the tox profile resulted in the following error: $ git commit --amend [..] gitlint...........................................................Passed prettier..........................................................Failed - hook id: prettier - exit code: 2 [error] No matching files. Patterns: .git/COMMIT_EDITMSG According to https://github.com/pre-commit/mirrors-prettier/issues/5 the reason behind is that prettier can not perform at the [commit-msg] stage and only at the [commit] stage. Forcing the stage parameter to [commit] in the hook configuration managed to fix the issue. Signed-off-by: Guillaume Lambert Change-Id: I1991d5dbab8c6d4ad83e3466fdd4a7bc3cfc865a --- .pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3bf54d6..318d59c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,10 +13,11 @@ repos: hooks: - id: gitlint - - repo: https://github.com/prettier/pre-commit + - repo: https://github.com/pre-commit/mirrors-prettier rev: v2.1.2 hooks: - id: prettier + stages: [commit] - repo: https://github.com/ambv/black rev: stable -- 2.16.6