Add support for end-of-line TODOs

Fixes #87
This commit is contained in:
alstr
2021-11-10 09:44:27 +00:00
parent 3ad11918d0
commit d8373a95ac
4 changed files with 59 additions and 7 deletions

View File

@@ -404,7 +404,7 @@ class TodoParser(object):
for marker in block['markers']:
# Check if there are line or block comments.
if marker['type'] == 'line':
comment_pattern = r'(^[+\-\s]\s*' + marker['pattern'] + '.+$)'
comment_pattern = r'(^[+\-\s].*' + marker['pattern'] + '.+$)'
comments = re.finditer(comment_pattern, block['hunk'], re.MULTILINE)
extracted_comments = []
prev_comment = None