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.
--- 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')