Skip to content

Commit a16edf8

Browse files
authored
Merge pull request #3265 from mikerite/fix-export
Fix util/export.py to include lints from methods
2 parents ce2da2c + e5b388d commit a16edf8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

util/lintlib.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,13 @@ def parse_lints(lints, filepath):
8282
g = group_re.search(line)
8383
if g:
8484
group = g.group(1).lower()
85-
level = lint_levels[group]
85+
level = lint_levels.get(group, None)
8686
break
8787
line = next(fp)
8888

89+
if level is None:
90+
continue
91+
8992
log.info("found %s with level %s in %s",
9093
name, level, filepath)
9194
lints.append(Lint(name, level, last_comment, filepath, group))
@@ -113,9 +116,11 @@ def parse_configs(path):
113116

114117
def parse_all(path="clippy_lints/src"):
115118
lints = []
116-
for filename in os.listdir(path):
117-
if filename.endswith(".rs"):
118-
parse_lints(lints, os.path.join(path, filename))
119+
for root, dirs, files in os.walk(path):
120+
for fn in files:
121+
if fn.endswith('.rs'):
122+
parse_lints(lints, os.path.join(root, fn))
123+
119124
log.info("got %s lints", len(lints))
120125

121126
configs = parse_configs(path)

0 commit comments

Comments
 (0)