From: Thanh Ha Date: Thu, 11 Jun 2020 14:17:48 +0000 (-0400) Subject: Print git-diff when pre-commit fails X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;ds=sidebyside;h=66891da217539c65b6017d8ac297494f1d5ea06d;hp=af2382e061803df4f357864f4bd97d18c10f39d7;p=releng%2Fbuilder.git Print git-diff when pre-commit fails When pre-commit fails and automatically fixes issues for us in Jenkins we are not able to see what pre-commit automatically fixed. Adding --show-diff-on-failure makes pre-commit perform a git-diff immediately after failing to ensure more useful output is printed to inform the contributor what changes are needed to pass the check. Change-Id: Ia4dc73f6a6b044fd75705fb6985a49419a3014cb Signed-off-by: Thanh Ha --- diff --git a/tox.ini b/tox.ini index 87e40692f..2be422d1a 100644 --- a/tox.ini +++ b/tox.ini @@ -32,7 +32,7 @@ basepython = python3 deps = pre-commit commands = pre-commit install --hook-type commit-msg - pre-commit run --all-files + pre-commit run --all-files --show-diff-on-failure [testenv:prefix] commands = python {toxinidir}/check_prefix.py