mirror of
https://github.com/ditkrg/todo-to-issue-action.git
synced 2026-01-22 22:06:43 +00:00
Improve TODO line number accuracy
This commit is contained in:
parent
07f231c5e4
commit
16e7542e41
8
main.py
8
main.py
@ -81,6 +81,8 @@ def main():
|
|||||||
'line_num': line_counter
|
'line_num': line_counter
|
||||||
}
|
}
|
||||||
new_issues.append(new_issue)
|
new_issues.append(new_issue)
|
||||||
|
line_counter += 1
|
||||||
|
continue
|
||||||
elif recording:
|
elif recording:
|
||||||
# If we are recording, check if the current line continues the last.
|
# If we are recording, check if the current line continues the last.
|
||||||
comment_search = comment_pattern.search(addition)
|
comment_search = comment_pattern.search(addition)
|
||||||
@ -88,8 +90,10 @@ def main():
|
|||||||
comment = comment_search.group(0).lstrip()
|
comment = comment_search.group(0).lstrip()
|
||||||
last_issue = new_issues[len(new_issues) - 1]
|
last_issue = new_issues[len(new_issues) - 1]
|
||||||
last_issue['body'] += '\n' + comment
|
last_issue['body'] += '\n' + comment
|
||||||
line_counter += 1
|
line_counter += 1
|
||||||
continue
|
continue
|
||||||
|
if line_counter is not None:
|
||||||
|
line_counter += 1
|
||||||
else:
|
else:
|
||||||
deletion_search = deletion_pattern.search(line)
|
deletion_search = deletion_pattern.search(line)
|
||||||
if deletion_search:
|
if deletion_search:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user