Show diff on pre-commit failure 41/91941/1
authorThanh Ha <zxiiro@gmail.com>
Thu, 6 Aug 2020 14:35:32 +0000 (10:35 -0400)
committerThanh Ha <zxiiro@gmail.com>
Thu, 6 Aug 2020 15:12:18 +0000 (11:12 -0400)
Make pre-commit print the diff of files on failure so that it's easier
to see what needs to be changed. Also update all the hook versions
since we haven't done so in awhile.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: I3fcb85d791b0e1f1ec9340b15a4ad1c2bd3ade61

.pre-commit-config.yaml
tox.ini

index 650ccd72fdb68f4c1774c5a3f37e9c73c7865ec7..bdde670a595f0b96a6eb302d4bdd5e3adf67507e 100644 (file)
@@ -1,17 +1,17 @@
 ---
 repos:
   - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v1.3.0
+    rev: v3.2.0
     hooks:
       - id: trailing-whitespace
 
   - repo: https://github.com/jorisroovers/gitlint
-    rev: v0.11.0
+    rev: v0.13.1
     hooks:
       - id: gitlint
 
   - repo: https://github.com/Lucas-C/pre-commit-hooks
-    sha: v1.1.6
+    sha: v1.1.9
     hooks:
       - id: remove-tabs
         exclude: >
diff --git a/tox.ini b/tox.ini
index 01a779e433519aa212f7990ef9121189f46e9437..3e7bb13f42b3896a4e875a997063b87fb0dd6cef 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -18,5 +18,5 @@ commands = sphinx-build -j auto -b linkcheck -d {envtmpdir}/doctrees ./docs/ {to
 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