]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
have lintchanges check header format.
authorNick Mathewson <nickm@torproject.org>
Mon, 22 Dec 2014 15:00:34 +0000 (10:00 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 22 Dec 2014 15:00:34 +0000 (10:00 -0500)
changes/bug13678
changes/feature13192
scripts/maint/lintChanges.py
scripts/maint/sortChanges.py

index d71b88a003cf5b39ab026f63cfe7992ccce4b39a..74f6a9816cdb5319c2a480a92f29c5f3ae7fda2c 100644 (file)
@@ -1,4 +1,3 @@
-
   o Testing:
     - In the unit tests, use 'chgrp' to change the group of the unit test
       temporary directory to the current user, so that the sticky bit doesn't
index 8a9741cb47a033628dd8cc7b82123f8aec5e0e1a..503979e869d01b3762a883659cc2b611dfa916c0 100644 (file)
@@ -1,4 +1,4 @@
-m  o Major features (hidden services):
+  o Major features (hidden services):
     - Add a HiddenServiceStatistics option that allows Tor relays to
       gather and publish statistics about hidden service usage, to
       better understand the size and volume of the hidden service
index 2e5729586038fbb89eff48dd8d1dabce61868a5e..fcadc5e5058a10914592f429fc82df1e92203ef7 100755 (executable)
@@ -28,6 +28,9 @@ def lintfile(fname):
     lines = contents.split("\n")
     isBug = ("bug" in lines[0] or "fix" in lines[0])
 
+    if not re.match(r'^ +o (.*)', contents):
+        warn("header not in format expected")
+
     contents = " ".join(contents.split())
 
     if isBug and not re.search(r'(\d+)', contents):
index 726a723f93ae3d851ded037bb9db2ada7a04062c..e8153e28486084ecceffdca97b7f41fe2214e0c8 100755 (executable)
@@ -18,10 +18,10 @@ def fetch(fn):
         s = "%s\n" % s.rstrip()
         return s
 
-def score(s):
+def score(s,fname=None):
     m = re.match(r'^ +o (.*)', s)
     if not m:
-        print >>sys.stderr, "Can't score %r"%s
+        print >>sys.stderr, "Can't score %r from %s"%(s,fname)
     lw = m.group(1).lower()
     if lw.startswith("major feature"):
         score = 0
@@ -41,7 +41,7 @@ def score(s):
     return (score,  lw, s)
 
 
-changes = [ score(fetch(fn)) for fn in sys.argv[1:] if not fn.endswith('~') ]
+changes = [ score(fetch(fn),fn) for fn in sys.argv[1:] if not fn.endswith('~') ]
 
 changes.sort()