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 <guillaume.lambert@orange.com>
Change-Id: I1991d5dbab8c6d4ad83e3466fdd4a7bc3cfc865a
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