Some Python style nits.

This commit is contained in:
Georg Brandl 2016-05-27 15:57:03 +02:00
parent 9110b6eb60
commit f314fa8d28

View file

@ -100,6 +100,7 @@ def gen_deprecated(lints):
for lint in lints:
yield ' store.register_removed("%s", "%s");\n' % (lint[1], lint[2])
def replace_region(fn, region_start, region_end, callback,
replace_start=True, write_back=True):
"""Replace a region in a file delimited by two lines matching regexes.
@ -168,8 +169,8 @@ def main(print_only=False, check=False):
changed |= replace_region(
'README.md',
r'^There are \d+ lints included in this crate:', "",
lambda: ['There are %d lints included in this crate:\n' % (len(lints)
+ len(restriction_lints))],
lambda: ['There are %d lints included in this crate:\n' %
(len(lints) + len(restriction_lints))],
write_back=not check)
# update the links in the CHANGELOG