check-commit: allow underbars in cffi_-prefix function names
authorAugie Fackler <augie@google.com>
Fri, 05 Aug 2016 17:27:51 -0400
changeset 29716 37b6f0ec6241
parent 29715 55d341877316
child 29718 2dd8c225e94c
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.
contrib/check-commit
--- a/contrib/check-commit	Fri Aug 05 13:08:11 2016 -0400
+++ b/contrib/check-commit	Fri Aug 05 17:27:51 2016 -0400
@@ -41,7 +41,12 @@
     (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"),
+    # Forbid "_" in function name.
+    #
+    # We skip the check for cffi related functions. They use names mapping the
+    # name of the C function. C function names may contain "_".
+    (r"\n\+[ \t]+def (?!cffi)[a-z]+_[a-z]",
+     "adds a function with foo_bar naming"),
 ]
 
 word = re.compile('\S')