changeset 29716:37b6f0ec6241

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.
author Augie Fackler <augie@google.com>
date Fri, 05 Aug 2016 17:27:51 -0400
parents 55d341877316
children 2dd8c225e94c
files contrib/check-commit
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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')