Skip to content

Commit e5b388d

Browse files
author
Michael Wright
committed
Fix util/export.py to include lints from methods
1 parent c47b948 commit e5b388d

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
@@ -72,10 +72,13 @@ def parse_lints(lints, filepath):
7272
g = group_re.search(line)
7373
if g:
7474
group = g.group(1).lower()
75-
level = lint_levels[group]
75+
level = lint_levels.get(group, None)
7676
break
7777
line = next(fp)
7878

79+
if level is None:
80+
continue
81+
7982
log.info("found %s with level %s in %s",
8083
name, level, filepath)
8184
lints.append(Lint(name, level, last_comment, filepath, group))
@@ -103,9 +106,11 @@ def parse_configs(path):
103106

104107
def parse_all(path="clippy_lints/src"):
105108
lints = []
106-
for filename in os.listdir(path):
107-
if filename.endswith(".rs"):
108-
parse_lints(lints, os.path.join(path, filename))
109+
for root, dirs, files in os.walk(path):
110+
for fn in files:
111+
if fn.endswith('.rs'):
112+
parse_lints(lints, os.path.join(root, fn))
113+
109114
log.info("got %s lints", len(lints))
110115

111116
configs = parse_configs(path)

0 commit comments

Comments
 (0)