Fix documentation generation for configurable lints

This commit is contained in:
flip1995 2020-03-22 18:15:06 +01:00
parent 0e5e2c4365
commit a1dc609f21
No known key found for this signature in database
GPG key ID: 2CEFCDB27ED0BE79

View file

@ -14,7 +14,7 @@ lintname_re = re.compile(r'''pub\s+([A-Z_][A-Z_0-9]*)''')
group_re = re.compile(r'''\s*([a-z_][a-z_0-9]+)''')
conf_re = re.compile(r'''define_Conf! {\n([^}]*)\n}''', re.MULTILINE)
confvar_re = re.compile(
r'''/// Lint: (\w+). (.*).*\n\s*\([^,]+,\s+"([^"]+)",\s+([^=\)]+)=>\s+(.*)\),''', re.MULTILINE)
r'''/// Lint: (\w+)\. (.*)\n\s*\([^,]+,\s+"([^"]+)":\s+([^,]+),\s+([^\.\)]+).*\),''', re.MULTILINE)
comment_re = re.compile(r'''\s*/// ?(.*)''')
lint_levels = {
@ -93,7 +93,7 @@ def parse_configs(path):
match = re.search(conf_re, contents)
confvars = re.findall(confvar_re, match.group(1))
for (lint, doc, name, default, ty) in confvars:
for (lint, doc, name, ty, default) in confvars:
configs[lint.lower()] = Config(name.replace("_", "-"), ty, doc, default)
return configs