Improve TODO line number accuracy

This commit is contained in:
alstr 2020-03-20 15:31:14 +00:00
parent 308e66824c
commit 07f231c5e4

View File

@ -54,6 +54,7 @@ def main():
if header_search:
files = header_search.group(0).split(' ')
curr_file = files[1][2:]
line_counter = None
else:
# Look for hunks so we can get the line numbers for the changes.
hunk_search = hunk_start_pattern.search(line)
@ -96,7 +97,7 @@ def main():
todo_search = todo_pattern.search(deletion)
if todo_search:
closed_issues.append(todo_search.group(0))
else:
elif line_counter is not None:
line_counter += 1
if recording:
recording = False