mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-20 10:12:15 +01:00
have lintchanges check header format.
This commit is contained in:
parent
441a481bb8
commit
845d92295f
@ -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
|
||||
|
@ -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
|
||||
|
@ -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):
|
||||
|
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user