@@ -46,7 +46,12 @@ def collect(deprecated_lints, clippy_lints, fn):
46
46
# remove \-newline escapes from description string
47
47
desc = nl_escape_re .sub ('' , match .group ('desc' ))
48
48
cat = match .group ('cat' )
49
- clippy_lints [cat ].append ((os .path .splitext (os .path .basename (fn ))[0 ],
49
+ if cat in ('internal' , 'internal_warn' ):
50
+ continue
51
+ module_name = os .path .splitext (os .path .basename (fn ))[0 ]
52
+ if module_name == 'mod' :
53
+ module_name = os .path .basename (os .path .dirname (fn ))
54
+ clippy_lints [cat ].append ((module_name ,
50
55
match .group ('name' ).lower (),
51
56
"allow" ,
52
57
desc .replace ('\\ "' , '"' )))
@@ -138,10 +143,11 @@ def main(print_only=False, check=False):
138
143
return
139
144
140
145
# collect all lints from source files
141
- for fn in os .listdir ('clippy_lints/src' ):
142
- if fn .endswith ('.rs' ):
143
- collect (deprecated_lints , clippy_lints ,
144
- os .path .join ('clippy_lints' , 'src' , fn ))
146
+ for root , dirs , files in os .walk ('clippy_lints/src' ):
147
+ for fn in files :
148
+ if fn .endswith ('.rs' ):
149
+ collect (deprecated_lints , clippy_lints ,
150
+ os .path .join (root , fn ))
145
151
146
152
# determine version
147
153
with open ('Cargo.toml' ) as fp :
0 commit comments