checkcode: enforce lowercase for extension docstring title
This will ensure new extensions are consistent and `hg help -e` has a
consistent output.
I have to add a new group since the normal "pypats" will be filtered by
"pyfilters", which will remove comments and docstrings.
--- a/contrib/check-code.py Thu Mar 23 21:16:55 2017 -0700
+++ b/contrib/check-code.py Thu Mar 23 21:23:21 2017 -0700
@@ -371,6 +371,13 @@
(?P=quote))""", reppython),
]
+# extension non-filter patterns
+pyextnfpats = [
+ [(r'^"""\n?[A-Z]', "don't capitalize docstring title")],
+ # warnings
+ [],
+]
+
txtfilters = []
txtpats = [
@@ -480,6 +487,7 @@
checks = [
('python', r'.*\.(py|cgi)$', r'^#!.*python', pyfilters, pypats),
+ ('python', r'.*hgext.*\.py$', '', [], pyextnfpats),
('python 3', r'.*(hgext|mercurial).*(?<!pycompat)\.py', '',
pyfilters, py3pats),
('test script', r'(.*/)?test-[^.~]*$', '', testfilters, testpats),