Skip to content

Commit f314fa8

Browse files
committed
Some Python style nits.
1 parent 9110b6e commit f314fa8

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

util/update_lints.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def collect(lints, deprecated_lints, restriction_lints, fn):
5858
# remove \-newline escapes from description string
5959
desc = nl_escape_re.sub('', match.group('desc'))
6060
restriction_lints.append((os.path.splitext(os.path.basename(fn))[0],
61-
match.group('name').lower(),
62-
"allow",
63-
desc.replace('\\"', '"')))
61+
match.group('name').lower(),
62+
"allow",
63+
desc.replace('\\"', '"')))
6464

6565

6666
def gen_table(lints, link=None):
@@ -100,6 +100,7 @@ def gen_deprecated(lints):
100100
for lint in lints:
101101
yield ' store.register_removed("%s", "%s");\n' % (lint[1], lint[2])
102102

103+
103104
def replace_region(fn, region_start, region_end, callback,
104105
replace_start=True, write_back=True):
105106
"""Replace a region in a file delimited by two lines matching regexes.
@@ -168,8 +169,8 @@ def main(print_only=False, check=False):
168169
changed |= replace_region(
169170
'README.md',
170171
r'^There are \d+ lints included in this crate:', "",
171-
lambda: ['There are %d lints included in this crate:\n' % (len(lints)
172-
+ len(restriction_lints))],
172+
lambda: ['There are %d lints included in this crate:\n' %
173+
(len(lints) + len(restriction_lints))],
173174
write_back=not check)
174175

175176
# update the links in the CHANGELOG
@@ -196,10 +197,10 @@ def main(print_only=False, check=False):
196197

197198
# same for "deprecated" lint collection
198199
changed |= replace_region(
199-
'clippy_lints/src/lib.rs', r'let mut store', r'end deprecated lints',
200-
lambda: gen_deprecated(deprecated_lints),
201-
replace_start=False,
202-
write_back=not check)
200+
'clippy_lints/src/lib.rs', r'let mut store', r'end deprecated lints',
201+
lambda: gen_deprecated(deprecated_lints),
202+
replace_start=False,
203+
write_back=not check)
203204

204205
# same for "clippy_pedantic" lint collection
205206
changed |= replace_region(

0 commit comments

Comments
 (0)