From patchwork Thu Feb 4 20:15:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: check-commit: reject double-blank lines at the top level From: Martijn Pieters X-Patchwork-Id: 12986 Message-Id: <45449d6428804e2441ec.1454616959@mjpieters-mbp> To: mercurial-devel@mercurial-scm.org Date: Thu, 04 Feb 2016 20:15:59 +0000 # HG changeset patch # User Martijn Pieters # 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')