From 1269f567c1838ea95173618d995854d03712a522 Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.dos.anjos@gmail.com> Date: Thu, 5 Aug 2021 10:59:33 +0200 Subject: [PATCH] [scripts.ci] Show git differences when pre-commit fails --- bob/devtools/scripts/ci.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bob/devtools/scripts/ci.py b/bob/devtools/scripts/ci.py index 2ceadb1b..9792274e 100644 --- a/bob/devtools/scripts/ci.py +++ b/bob/devtools/scripts/ci.py @@ -1024,6 +1024,10 @@ def check(root): # we skip sphinx build and doctests as this is run by the ci later env = os.environ.copy() env["SKIP"] = "sphinx-build,sphinx-doctest" - run_cmdline([which("pre-commit"), "run", "--all-files"], env=env, cwd=root) + run_cmdline( + [which("pre-commit"), "run", "--all-files", "--show-diff-on-failure"], + env=env, + cwd=root, + ) else: logger.info(f"Cannot find file {path}. Skipping pre-commit checks...") -- GitLab