I've seen the recent patches to unindent '(Tweaked by me)' and the like
in log messages so that they don't appear in the Contribulyzer, and so I
was going to add a comment to that effect to the crediting section of
HACKING, but then I figured that it might be smarter for the
Contribulyzer to just ignore them anyway.
What do people think of the following patch?
[[[
Make the Contribulyzer treat indented parenthetical asides as asides
rather than names to generate a contribution summary for.
* tools/dev/contribulyze.py
(parenthetical_aside_re): Allow (ignored) leading whitespace.
(graze): In continuation lines for fields, ensure that lines that
contain whitespace followed by an open parenthesis are not consider
a named continuation for the field.
]]]
Note that I also removed the '+' quantifier from the '(\S.*)+' part of
the in_field_re regex, as I couldn't see that it would ever do anything
other than enforce a single match.
Regards,
Malcolm
Index: tools/dev/contribulyze.py
===================================================================
--- tools/dev/contribulyze.py (revision 24575)
+++ tools/dev/contribulyze.py (working copy)
@@ -503,7 +503,7 @@ log_header_re = re.compile\
('^(r[0-9]+) \| ([^|]+) \| ([^|]+) \| ([0-9]+)[^0-9]')
field_re = re.compile('^(Patch|Review(ed)?|Suggested|Found) by:\s*(.*)')
field_aliases = { 'Reviewed' : 'Review' }
-parenthetical_aside_re = re.compile('^\(.*\)\s*$')
+parenthetical_aside_re = re.compile('^\s*\(.*\)\s*$')
def graze(input):
just_saw_separator = False
@@ -553,7 +553,7 @@ def graze(input):
# Each line begins either with "WORD by:", or with whitespace.
in_field_re = re.compile('^('
+ (field.alias or field.name)
- + ' by:\s+|\s+)(\S.*)+')
+ + ' by:\s+|\s+)([^\s(].*)')
m = in_field_re.match(line)
user, real, email = Contributor.parse(m.group(2))
if user == 'me':
- application/pgp-signature attachment: stored
Received on Fri Apr 27 16:11:10 2007