checkcode: enforce lowercase for extension docstring title
authorJun Wu <quark@fb.com>
Thu, 23 Mar 2017 21:23:21 -0700
changeset 31602 772878ac930e
parent 31601 8e7feaad2d8d
child 31603 fbe8502c4480
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.
contrib/check-code.py
--- 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),