[PATCH] check-commit: reject double-blank lines at the top level

Martijn Pieters mj at zopatista.com
Thu Feb 4 20:15:59 UTC 2016


# HG changeset patch
# User Martijn Pieters <mjpieters at fb.com>
# Date 1454616950 0
#      Thu Feb 04 20:15:50 2016 +0000
# Node ID 45449d6428804e2441ecb8ae5727079e62557876
# Parent  b1878a8f4543825e3f4052dc54323c2a0dbc46f1
check-commit: reject double-blank lines at the top level

diff --git a/contrib/check-commit b/contrib/check-commit
--- a/contrib/check-commit
+++ b/contrib/check-commit
@@ -37,6 +37,8 @@
     (r"\n\+\n \n", "adds double empty line"),
     (r"\n \n\+\n", "adds double empty line"),
     (r"\n\+[ \t]+def [a-z]+_[a-z]", "adds a function with foo_bar naming"),
+    (r'\n\n\n(def|class)', 'Use just one blank line between top-level '
+     'functions and class definitions'),
 ]
 
 word = re.compile('\S')


More information about the Mercurial-devel mailing list