From 18b58a50b9637f10538cacdc55a5991cfe139c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Ferreira?= Date: Mon, 28 Mar 2022 15:23:12 +0100 Subject: [PATCH] ci(pre-commit): add git diff color configurations for better readability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/pre_commit.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/pre_commit.yml b/.github/workflows/pre_commit.yml index cd85c25acb..28ec7bb37a 100644 --- a/.github/workflows/pre_commit.yml +++ b/.github/workflows/pre_commit.yml @@ -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