[PATCH] check-commit: allow underbars in cffi_-prefix function names

Augie Fackler raf at durin42.com
Fri Aug 5 19:58:41 EDT 2016


> On Aug 5, 2016, at 7:40 PM, Pierre-Yves David <pierre-yves.david at ens-lyon.org> wrote:
> 
> 
> 
> 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.

Can you just add that in flight?

> 
> Cheers,
> 
> --
> Pierre-Yves David

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160805/1c24a3ae/attachment-0001.sig>


More information about the Mercurial-devel mailing list