From db4e85f04c99c1dbd9533433c40d75c571330cf9 Mon Sep 17 00:00:00 2001
From: Peter Cock
Date: Mon, 7 Aug 2017 11:47:34 +0100
Subject: [PATCH] If strict mode and pre-commit fails, suggest no-verify
---
src/flake8/main/git.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/flake8/main/git.py b/src/flake8/main/git.py
index 3cda3c5..ac6a2de 100644
--- a/src/flake8/main/git.py
+++ b/src/flake8/main/git.py
@@ -56,7 +56,9 @@ def hook(lazy=False, strict=False):
update_paths(app.file_checker_manager, tempdir)
app.report_errors()
- if strict:
+ if strict and app.result_count:
+ print("flake8 checks failed. Please fix, or force with "
+ "'git commit --no-verify'")
return app.result_count
return 0