1
0
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:
Emil Ernerfeldt
2024-03-26 11:48:24 +01:00
committed by GitHub
parent 8a10f81ca0
commit f8d7d0ebaa
19 changed files with 31 additions and 25 deletions

View File

@@ -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/")