Skip to content

Commit 3646b30

Browse files
committed
Include restriction lints in the wiki
1 parent d921dfa commit 3646b30

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

util/update_wiki.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ def parse_file(d, f):
5252
elif line.startswith("declare_lint!"):
5353
comment = False
5454
deprecated = False
55+
restriction = False
56+
elif line.startswith("declare_restriction_lint!"):
57+
comment = False
58+
deprecated = False
59+
restriction = True
5560
elif line.startswith("declare_deprecated_lint!"):
5661
comment = False
5762
deprecated = True
@@ -65,7 +70,7 @@ def parse_file(d, f):
6570
name = m.group(1).lower()
6671

6772
# Intentionally either a never looping or infinite loop
68-
while not deprecated:
73+
while not deprecated and not restriction:
6974
m = re.search(level_re, line)
7075
if m:
7176
level = m.group(0)
@@ -75,6 +80,8 @@ def parse_file(d, f):
7580

7681
if deprecated:
7782
level = "Deprecated"
83+
elif restriction:
84+
level = "Allow"
7885

7986
print("found %s with level %s in %s" % (name, level, f))
8087
d[name] = (level, last_comment)
@@ -162,6 +169,7 @@ def check_wiki_page(d, c, f):
162169

163170
def main():
164171
(d, c) = parse_path()
172+
print('Found %s lints' % len(d))
165173
if "-c" in sys.argv:
166174
check_wiki_page(d, c, "../rust-clippy.wiki/Home.md")
167175
else:

0 commit comments

Comments
 (0)