mirror of
https://github.com/ditkrg/todo-to-issue-action.git
synced 2026-01-23 06:16:43 +00:00
Improve TODO line number accuracy
This commit is contained in:
parent
308e66824c
commit
07f231c5e4
3
main.py
3
main.py
@ -54,6 +54,7 @@ def main():
|
|||||||
if header_search:
|
if header_search:
|
||||||
files = header_search.group(0).split(' ')
|
files = header_search.group(0).split(' ')
|
||||||
curr_file = files[1][2:]
|
curr_file = files[1][2:]
|
||||||
|
line_counter = None
|
||||||
else:
|
else:
|
||||||
# Look for hunks so we can get the line numbers for the changes.
|
# Look for hunks so we can get the line numbers for the changes.
|
||||||
hunk_search = hunk_start_pattern.search(line)
|
hunk_search = hunk_start_pattern.search(line)
|
||||||
@ -96,7 +97,7 @@ def main():
|
|||||||
todo_search = todo_pattern.search(deletion)
|
todo_search = todo_pattern.search(deletion)
|
||||||
if todo_search:
|
if todo_search:
|
||||||
closed_issues.append(todo_search.group(0))
|
closed_issues.append(todo_search.group(0))
|
||||||
else:
|
elif line_counter is not None:
|
||||||
line_counter += 1
|
line_counter += 1
|
||||||
if recording:
|
if recording:
|
||||||
recording = False
|
recording = False
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user