From 830fd45809426abe000fc91bd2833799e3a138a6 Mon Sep 17 00:00:00 2001 From: alstr Date: Fri, 4 Feb 2022 11:29:54 +0000 Subject: [PATCH] Check for space after line comment marker --- main.py | 2 +- tests/test_todo_parser.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/main.py b/main.py index 7e83639..e2a73c3 100644 --- a/main.py +++ b/main.py @@ -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].*' + marker['pattern'] + '.+$)' + comment_pattern = r'(^[+\-\s].*' + marker['pattern'] + r'\s.+$)' comments = re.finditer(comment_pattern, block['hunk'], re.MULTILINE) extracted_comments = [] prev_comment = None diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index 3556280..8f05637 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -46,10 +46,6 @@ class NewIssueTests(unittest.TestCase): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'tex'), 2) def test_julia_issues(self): - # TODO: Fix Julia markers - # The Julia tests are currently failing as @qwinters noticed in #96. - # It looks to be counting block comments twice as the line marker appears within the block marker. - # labels: bug self.assertEqual(count_issues_for_file_type(self.raw_issues, 'julia'), 2) def test_autohotkey_issues(self):