mirror of
https://github.com/ditkrg/todo-to-issue-action.git
synced 2026-01-22 22:06:43 +00:00
Strip removed lines from code snippet
This commit is contained in:
parent
c0c6dfb65a
commit
349ae3620b
6
main.py
6
main.py
@ -299,7 +299,11 @@ class TodoParser(object):
|
|||||||
|
|
||||||
# Strip some of the diff symbols so it can be included as a code snippet in the issue body.
|
# Strip some of the diff symbols so it can be included as a code snippet in the issue body.
|
||||||
for i, issue in enumerate(issues):
|
for i, issue in enumerate(issues):
|
||||||
cleaned_hunk = re.sub(r'^.', '', issue.hunk, 0, re.MULTILINE)
|
# Strip removed lines.
|
||||||
|
cleaned_hunk = re.sub(r'\n^-.*$', '', issue.hunk, 0, re.MULTILINE)
|
||||||
|
# Strip leading symbols/whitespace.
|
||||||
|
cleaned_hunk = re.sub(r'^.', '', cleaned_hunk, 0, re.MULTILINE)
|
||||||
|
# Strip newline message.
|
||||||
cleaned_hunk = re.sub(r'\n\sNo newline at end of file', '', cleaned_hunk, 0, re.MULTILINE)
|
cleaned_hunk = re.sub(r'\n\sNo newline at end of file', '', cleaned_hunk, 0, re.MULTILINE)
|
||||||
issue.hunk = cleaned_hunk
|
issue.hunk = cleaned_hunk
|
||||||
return issues
|
return issues
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user