diff contrib/check-code.py @ 31607:772878ac930e

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.
author Jun Wu <quark@fb.com>
date Thu, 23 Mar 2017 21:23:21 -0700
parents c0c4e14ee597
children 6a2959acae1a
line wrap: on
line diff
--- 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),