From 3ec876d51a5da63f4014cff0df14a83cb3a66fa5 Mon Sep 17 00:00:00 2001 From: Jonathan Karr Date: Mon, 17 Jan 2022 13:25:16 -0500 Subject: [PATCH 1/3] Add markers for multi-line Python comments --- syntax.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/syntax.json b/syntax.json index e4a65f4..ab62e1e 100644 --- a/syntax.json +++ b/syntax.json @@ -5,6 +5,20 @@ { "type": "line", "pattern": "#" + }, + { + "type": "block", + "pattern": { + "start": "'''", + "end": "'''" + } + }, + { + "type": "block", + "pattern": { + "start": "\"\"\"", + "end": "\"\"\"" + } } ] }, From 7e5a3854eb3e9b7612ceb90bd00337a9506eeba0 Mon Sep 17 00:00:00 2001 From: Jonathan Karr Date: Wed, 19 Jan 2022 09:59:15 -0500 Subject: [PATCH 2/3] test(python): added tests for multiline comments --- tests/test_closed.diff | 18 +++++++++++++++++- tests/test_new.diff | 16 ++++++++++++++++ tests/test_todo_parser.py | 4 ++-- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/tests/test_closed.diff b/tests/test_closed.diff index 1ef86b9..5285a0c 100644 --- a/tests/test_closed.diff +++ b/tests/test_closed.diff @@ -59,6 +59,22 @@ index 525e25d..ba4e68d 100644 - # TODO: Do more stuff - # This function should probably do something more interesting - # labels: help wanted +- +-def my_method(arg): +- """ +- TODO: Second multiline comment +- also need to be turned into task, and hopefully +- kept together as one. +- """ +- pass +- +-def MyClass: +- ''' +- TODO: Third multiline comment +- also need to be turned into task, and hopefully +- kept together as one. +- ''' +- pass diff --git a/tests/example_file.rb b/tests/example_file.rb index e6da2ec..67f14dd 100644 --- a/tests/example_file.rb @@ -163,7 +179,7 @@ index 0000000..7cccc5b - #+begin_src python - print("Hello World") - #+end_src -- + #+begin_comment +- #+begin_comment - TODO: Multiline comments - also need to be turned into todos, and hopefully - kept together as one todo diff --git a/tests/test_new.diff b/tests/test_new.diff index fbd20e1..ac6187b 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -61,6 +61,22 @@ index 0000000..525e25d + # TODO: Do more stuff + # This function should probably do something more interesting + # labels: help wanted ++ ++def my_method(arg): ++ """ ++ TODO: Second multiline comment ++ also need to be turned into task, and hopefully ++ kept together as one. ++ """ ++ pass ++ ++def MyClass: ++ ''' ++ TODO: Third multiline comment ++ also need to be turned into task, and hopefully ++ kept together as one. ++ ''' ++ pass diff --git a/tests/example_file.rb b/tests/example_file.rb new file mode 100644 index 0000000..e6da2ec diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index 8423a11..d8ad06f 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -22,7 +22,7 @@ class NewIssueTests(unittest.TestCase): self.raw_issues = parser.parse(diff_file) def test_python_issues(self): - self.assertEqual(count_issues_for_file_type(self.raw_issues, 'python'), 2) + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'python'), 4) def test_yaml_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'yaml'), 2) @@ -67,7 +67,7 @@ class ClosedIssueTests(unittest.TestCase): self.raw_issues = parser.parse(diff_file) def test_python_issues(self): - self.assertEqual(count_issues_for_file_type(self.raw_issues, 'python'), 2) + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'python'), 4) def test_yaml_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'yaml'), 2) From bd48a8a12cfb91a5974d695e12077f0ab0a4afd3 Mon Sep 17 00:00:00 2001 From: Jonathan Karr Date: Wed, 19 Jan 2022 10:14:10 -0500 Subject: [PATCH 3/3] test(python): corrected diff markup in examples for number of lines --- tests/test_closed.diff | 2 +- tests/test_new.diff | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_closed.diff b/tests/test_closed.diff index 5285a0c..b06542c 100644 --- a/tests/test_closed.diff +++ b/tests/test_closed.diff @@ -51,7 +51,7 @@ diff --git a/tests/example_file.py b/tests/example_file.py index 525e25d..ba4e68d 100644 --- a/tests/example_file.py +++ b/tests/example_file.py -@@ -1,7 +1,2 @@ +@@ -1,23 +1,2 @@ def hello_world(): - # TODO: Come up with a more imaginative greeting print('Hello world') diff --git a/tests/test_new.diff b/tests/test_new.diff index ac6187b..61bb831 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -53,7 +53,7 @@ new file mode 100644 index 0000000..525e25d --- /dev/null +++ b/tests/example_file.py -@@ -0,0 +1,7 @@ +@@ -0,0 +1,23 @@ +def hello_world(): + # TODO: Come up with a more imaginative greeting + print('Hello world') @@ -77,6 +77,7 @@ index 0000000..525e25d + kept together as one. + ''' + pass +\ No newline at end of file diff --git a/tests/example_file.rb b/tests/example_file.rb new file mode 100644 index 0000000..e6da2ec