- lints.append(Lint(name, level, last_comment, filepath))
- last_comment = []
- comment = True
- if "}" in line:
- log.warn("Warning: missing Lint-Name in %s", filepath)
- comment = True
+ lints.append(Lint(name, level, comment, filepath, group))
+ comment = []
+
+ clippy = False
+ deprecated = False
+ name = ""
+ else:
+ m = comment_re.search(line)
+ if m:
+ comment.append(m.group(1))
+ elif line.startswith("declare_clippy_lint!"):
+ clippy = True
+ deprecated = False
+ elif line.startswith("declare_deprecated_lint!"):
+ clippy = False
+ deprecated = True
+ elif line.startswith("declare_lint!"):
+ import sys
+ print(
+ "don't use `declare_lint!` in Clippy, "
+ "use `declare_clippy_lint!` instead"
+ )
+ sys.exit(42)