diff options
Diffstat (limited to 'scripts/maint/lintChanges.py')
-rwxr-xr-x | scripts/maint/lintChanges.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/scripts/maint/lintChanges.py b/scripts/maint/lintChanges.py index 48edd06fde..bf06064fa8 100755 --- a/scripts/maint/lintChanges.py +++ b/scripts/maint/lintChanges.py @@ -7,7 +7,7 @@ import re import os -KNOWN_GROUPS=set([ +KNOWN_GROUPS = set([ "Minor bugfix", "Minor bugfixes", "Major bugfix", @@ -22,6 +22,7 @@ KNOWN_GROUPS=set([ "Code simplification and refactoring", "Removed features"]) + def lintfile(fname): have_warned = [] @@ -43,19 +44,20 @@ def lintfile(fname): if bugnum and bugnum not in contents: warn("bug number {} does not appear".format(bugnum)) - lines = contents.split("\n") - isBug = ("bug" in lines[0] or "fix" in lines[0]) - m = re.match(r'^[ ]{2}o ([^\(:]*)([^:]*):', contents) if not m: warn("header not in format expected") elif m.group(1).strip() not in KNOWN_GROUPS: - warn("Weird header: %r"%m.group(1)) - elif ( ("bugfix" in m.group(1) or "feature" in m.group(1)) and - ("Removed" not in m.group(1)) and - '(' not in m.group(2)): - warn("Missing subcategory on %s"%m.group(1)) + warn("Weird header: %r" % m.group(1)) + elif (("bugfix" in m.group(1) or "feature" in m.group(1)) and + ("Removed" not in m.group(1)) and + '(' not in m.group(2)): + warn("Missing subcategory on %s" % m.group(1)) + if m: + isBug = ("bug" in m.group(1).lower() or "fix" in m.group(1).lower()) + else: + isBug = False contents = " ".join(contents.split()) @@ -73,6 +75,8 @@ def lintfile(fname): elif not re.search('[fF]ixes ([a-z ]*)bug (\d+); bugfix on ', contents): warn("bugfix incant is not semicoloned") + elif re.search('tor-([0-9]+)', contents): + warn("do not prefix versions with 'tor-'") if __name__ == '__main__': |