break
return errors
+class EbuildUselessDodoc(object):
+ """Check ebuild for useless files in dodoc arguments."""
+ repoman_check_name = 'ebuild.minorsyn'
+ uselessdodoc_re = re.compile(
+ r'^\s*dodoc(\s+|\s+.*\s+)(ABOUT-NLS|COPYING|LICENSE)($|\s)')
+
+ def __init__(self, contents):
+ self.contents = contents
+
+ def Run(self):
+ errors = []
+ uselessdodoc_re = self.uselessdodoc_re
+ for num, line in enumerate(self.contents):
+ match = uselessdodoc_re.match(line)
+ if match:
+ errors.append((num + 1, "Useless dodoc '%s'" % \
+ (match.group(2), ) + " on line: %d"))
+ return errors
+
if mymode == "commit":
retval = ("","")
if isCvs:
finally:
f.close()
del f
- for check in (EbuildQuote, ):
+ for check in (EbuildQuote, EbuildUselessDodoc):
c = check(contents)
errors = c.Run()
for e in errors: