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

Augie Fackler raf at durin42.com
Fri Feb 5 16:11:29 EST 2016


On Thu, Feb 04, 2016 at 08:15:59PM +0000, Martijn Pieters wrote:
> # 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

Sure, queued.

>
> 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')
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list