diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-02-01 16:46:29 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-02-01 16:46:29 -0500 |
commit | deea08c13f9d6a3dc8eca612ddf09436da1af4f8 (patch) | |
tree | aa8eabda9c7ff5a3504b4d67bf265e599df8a281 /scripts | |
parent | 8ea48a59195b68c95261d2df3cdfacf12a6418d6 (diff) | |
download | tor-deea08c13f9d6a3dc8eca612ddf09436da1af4f8.tar.gz tor-deea08c13f9d6a3dc8eca612ddf09436da1af4f8.zip |
Fix all the warnings from lintChanges.py
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/maint/lintChanges.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/scripts/maint/lintChanges.py b/scripts/maint/lintChanges.py index c2fc01d2bf..a73110dab1 100755 --- a/scripts/maint/lintChanges.py +++ b/scripts/maint/lintChanges.py @@ -7,6 +7,20 @@ import re import os +KNOWN_GROUPS=set([ + "Minor bugfix", + "Minor bugfixes", + "Major bugfix", + "Major bugfixes", + "Minor feature", + "Minor features", + "Major feature", + "Major features", + "Testing", + "Documentation", + "Code simplification and refactoring", + "Removed features"]) + def lintfile(fname): have_warned = [] @@ -31,8 +45,16 @@ def lintfile(fname): lines = contents.split("\n") isBug = ("bug" in lines[0] or "fix" in lines[0]) - if not re.match(r'^[ ]{2}o (.*)', contents): + 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)) + contents = " ".join(contents.split()) |