From: Thanh Ha Date: Sat, 6 Jun 2020 14:07:50 +0000 (-0400) Subject: Print git-diff when pre-commit fails X-Git-Tag: v0.5.0~5 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=6770638b583155459cb43fff5305e5b4b02d98b7;p=releng%2Fdocs-conf.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: I5553c09d6079a71d64eebf3058e0cdec5fdf6b4f Signed-off-by: Thanh Ha --- diff --git a/tox.ini b/tox.ini index aacc8d4..8147f78 100644 --- a/tox.ini +++ b/tox.ini @@ -46,7 +46,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:reno] basepython = python3