@@ -58,9 +58,9 @@ def collect(lints, deprecated_lints, restriction_lints, fn):
58
58
# remove \-newline escapes from description string
59
59
desc = nl_escape_re .sub ('' , match .group ('desc' ))
60
60
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 ('\\ "' , '"' )))
64
64
65
65
66
66
def gen_table (lints , link = None ):
@@ -100,6 +100,7 @@ def gen_deprecated(lints):
100
100
for lint in lints :
101
101
yield ' store.register_removed("%s", "%s");\n ' % (lint [1 ], lint [2 ])
102
102
103
+
103
104
def replace_region (fn , region_start , region_end , callback ,
104
105
replace_start = True , write_back = True ):
105
106
"""Replace a region in a file delimited by two lines matching regexes.
@@ -168,8 +169,8 @@ def main(print_only=False, check=False):
168
169
changed |= replace_region (
169
170
'README.md' ,
170
171
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 ))],
173
174
write_back = not check )
174
175
175
176
# update the links in the CHANGELOG
@@ -196,10 +197,10 @@ def main(print_only=False, check=False):
196
197
197
198
# same for "deprecated" lint collection
198
199
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 )
203
204
204
205
# same for "clippy_pedantic" lint collection
205
206
changed |= replace_region (
0 commit comments