From 07f231c5e4a8d40cdefbb807e32626fc0d7519a1 Mon Sep 17 00:00:00 2001 From: alstr Date: Fri, 20 Mar 2020 15:31:14 +0000 Subject: [PATCH] Improve TODO line number accuracy --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index cd01eca..8dfb55f 100644 --- a/main.py +++ b/main.py @@ -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