mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
Enforce writing username in TODO comments (#4235)
This commit is contained in:
@@ -36,7 +36,7 @@ def lint_lines(filepath, lines_in):
|
||||
for line_nr, line in enumerate(lines_in):
|
||||
line_nr = line_nr + 1
|
||||
|
||||
# TODO: only # and /// on lines before a keyword
|
||||
# TODO(emilk): only # and /// on lines before a keyword
|
||||
|
||||
pattern = (
|
||||
r"^\s*((///)|((pub(\(\w*\))? )?((impl|fn|struct|enum|union|trait)\b))).*$"
|
||||
@@ -66,6 +66,12 @@ def lint_lines(filepath, lines_in):
|
||||
)
|
||||
lines_out.append("#[inline]")
|
||||
|
||||
|
||||
if re.search(r"TODO[^(]", line):
|
||||
errors.append(
|
||||
f"{filepath}:{line_nr}: write 'TODO(username):' instead"
|
||||
)
|
||||
|
||||
if (
|
||||
"(target_os" in line
|
||||
and filepath.startswith("./crates/egui/")
|
||||
|
||||
Reference in New Issue
Block a user