Skip to content

Commit

Permalink
scripts: Completely change lstodos output
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmMoltony committed Feb 3, 2024
1 parent 57f7406 commit 0cdfd82
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/lstodos.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,20 @@ def find_todo_patterns(files, be_bold):
continue
with open(file_name, "r", encoding="utf-8") as file:
lines = file.readlines()
printed_file_name = False
for line_num, line in enumerate(lines, start=1):
matches = re.findall(r"@todo|TODO", line)
if matches:
for _ in matches:
if not printed_file_name:
print(f"{file_name}:")
printed_file_name = True
if be_bold:
print(
f"\033[1m{file_name}:{line_num}\033[0m: {line.strip()}"
f"\033[1m {line_num}\033[0m: {line.strip()}"
)
else:
print(f"{file_name}:{line_num}: {line.strip()}")

print(f" {line_num}: {line.strip()}")

def main():
"""
Expand Down

0 comments on commit 0cdfd82

Please sign in to comment.