From: Thanh Ha Date: Sat, 6 Jun 2020 14:01:53 +0000 (-0400) Subject: Print git-diff when pre-commit fails X-Git-Tag: v0.5.2~3^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=f14e1f6a4bef92cb92ffd9ed9dabbbf30d30724a;p=releng%2Fcommon-packer.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: Ic2ad49fd6222bee0341c4826e6ccc463d05fda5f --- diff --git a/tox.ini b/tox.ini index 5f647f2..4c45861 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,7 @@ commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinid 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 [testenv:reno]