Fix util/export.py to include lints from methods

This commit is contained in:
Michael Wright 2018-10-05 08:02:44 +02:00
parent c47b9489ab
commit e5b388d865
1 changed files with 9 additions and 4 deletions

View File

@ -72,10 +72,13 @@ def parse_lints(lints, filepath):
g = group_re.search(line)
if g:
group = g.group(1).lower()
level = lint_levels[group]
level = lint_levels.get(group, None)
break
line = next(fp)
if level is None:
continue
log.info("found %s with level %s in %s",
name, level, filepath)
lints.append(Lint(name, level, last_comment, filepath, group))
@ -103,9 +106,11 @@ def parse_configs(path):
def parse_all(path="clippy_lints/src"):
lints = []
for filename in os.listdir(path):
if filename.endswith(".rs"):
parse_lints(lints, os.path.join(path, filename))
for root, dirs, files in os.walk(path):
for fn in files:
if fn.endswith('.rs'):
parse_lints(lints, os.path.join(root, fn))
log.info("got %s lints", len(lints))
configs = parse_configs(path)