ci(pre-commit): add git diff color configurations for better readability

This patch introduces some sensible configurations to highlight extra
whitespaces and highlight differences from two very identical lines. That makes
pre-commit `--show-diff-on-failure` option more readable and therefore faster
to discover the issue.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
This commit is contained in:
Luís Ferreira 2022-03-28 15:23:12 +01:00 committed by Nicholas Wilson
parent cc9650ff3a
commit 18b58a50b9

View file

@ -18,5 +18,16 @@ jobs:
SKIP: no-commit-to-branch
steps:
- uses: actions/checkout@v3
- name: Configure Git
run: |
git config --global color.diff.meta "11"
git config --global color.diff.frag "magenta bold"
git config --global color.diff.func "146 bold"
git config --global color.diff.commit "yellow bold"
git config --global color.diff.old "red bold"
git config --global color.diff.new "green bold"
git config --global color.diff.whitespace "red reverse"
git config --global diff.wsErrorHighlight "all"
- uses: actions/setup-python@v3.0.0
- uses: pre-commit/action@v2.0.3