From: Thanh Ha Date: Sat, 6 Jun 2020 13:43:00 +0000 (-0400) Subject: Print git-diff when pre-commit fails X-Git-Tag: v0.55.0~2^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F16%2F64216%2F1;p=releng%2Fglobal-jjb.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. Signed-off-by: Thanh Ha Change-Id: I0c9fc6afa8be214d03e342b2913205e946aa901e --- diff --git a/tox.ini b/tox.ini index 06b418a5..3230bab3 100644 --- a/tox.ini +++ b/tox.ini @@ -69,7 +69,7 @@ basepython = python3 deps = pre-commit commands = - pre-commit run --all-files + pre-commit run --all-files --show-diff-on-failure pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG #########