about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hansch <dev@phansch.net>2018-10-08 07:22:09 +0100
committerGitHub <noreply@github.com>2018-10-08 07:22:09 +0100
commita16edf84ce17095ebeebccb5662441ef1c824905 (patch)
tree9655dbcabf479d3f54584c2af9f85b301b4a1f46
parentce2da2c04f90b9e267bd62bba6b601a9ffef4b0a (diff)
parente5b388d8650c5b42c9e5ed1dae53ab3211878af0 (diff)
downloadrust-a16edf84ce17095ebeebccb5662441ef1c824905.tar.gz
rust-a16edf84ce17095ebeebccb5662441ef1c824905.zip
Merge pull request #3265 from mikerite/fix-export
Fix util/export.py to include lints from methods
-rw-r--r--util/lintlib.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/util/lintlib.py b/util/lintlib.py
index 61090abc138..098fcf256a6 100644
--- a/util/lintlib.py
+++ b/util/lintlib.py
@@ -82,10 +82,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))
@@ -113,9 +116,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)