Clean up fixme target

Correct regular expression
Use single quotes consistently
Use format strings
Correct grammar
This commit is contained in:
Tom Payne
2013-03-11 10:48:28 +01:00
parent e8b4a29254
commit 3934dbbcaf

View File

@@ -476,7 +476,7 @@ else:
@target('fixme', phony=True) @target('fixme', phony=True)
def find_fixme(t): def find_fixme(t):
regex = re.compile(".(FIXME|TODO).") regex = re.compile('FIXME|TODO')
matches = dict() matches = dict()
totalcount = 0 totalcount = 0
for filename in SRC: for filename in SRC:
@@ -485,16 +485,16 @@ def find_fixme(t):
if regex.search(line): if regex.search(line):
if (filename not in matches): if (filename not in matches):
matches[filename] = list() matches[filename] = list()
matches[filename].append("#" + str(lineno + 1).ljust(10) + line.strip()) matches[filename].append('#%-10d %s' % (lineno + 1, line.strip()))
totalcount += 1 totalcount += 1
f.close() f.close()
for filename in matches: for filename in matches:
print " ", filename, "has", len(matches[filename]), "matches:" print ' %s has %d matches:' % (filename, len(matches[filename]))
for match in matches[filename]: for match in matches[filename]:
print " ", match print ' %s' % (match,)
print print
print "A total number of", totalcount, "TODO/FIXME was found" print 'A total of %d TODO/FIXME(s) were found' % (totalcount,)
@target('reallyclean') @target('reallyclean')