[PATCH] check-commit: allow underbars in cffi_-prefix function names
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Fri Aug 5 23:40:37 UTC 2016
On 08/05/2016 11:28 PM, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie at google.com>
> # Date 1470432471 14400
> # Fri Aug 05 17:27:51 2016 -0400
> # Node ID 91bc284fa60d068f88b988b149a05c0d14aee0b5
> # Parent 834b8ac4a7587562dccb527b28606ecf5532e883
> check-commit: allow underbars in cffi_-prefix function names
>
> It seems reasonable to give cffi functions slightly more verbose names
> in some circumstances, given the way they interface with C.
That seems reasonable because, cffi maps C function with "_" in their name
>
> diff --git a/contrib/check-commit b/contrib/check-commit
> --- a/contrib/check-commit
> +++ b/contrib/check-commit
> @@ -41,7 +41,8 @@ errors = [
> (afterheader + r".{79,}", "summary line too long (limit is 78)"),
> (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\+[ \t]+def (?!cffi)[a-z]+_[a-z]",
> + "adds a function with foo_bar naming"),
> ]
Can we have an inline comment about this cffi thing, this code is
already quite scary to new comer.
Cheers,
--
Pierre-Yves David
More information about the Mercurial-devel
mailing list