Merge pull request #99 from jonrkarr/patch-2

Add markers for multi-line Python comments
This commit is contained in:
Alastair Mooney 2022-01-20 13:19:41 +00:00 committed by GitHub
commit a7d72a3a65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 52 additions and 5 deletions

View File

@ -5,6 +5,20 @@
{ {
"type": "line", "type": "line",
"pattern": "#" "pattern": "#"
},
{
"type": "block",
"pattern": {
"start": "'''",
"end": "'''"
}
},
{
"type": "block",
"pattern": {
"start": "\"\"\"",
"end": "\"\"\""
}
} }
] ]
}, },

View File

@ -51,7 +51,7 @@ diff --git a/tests/example_file.py b/tests/example_file.py
index 525e25d..ba4e68d 100644 index 525e25d..ba4e68d 100644
--- a/tests/example_file.py --- a/tests/example_file.py
+++ b/tests/example_file.py +++ b/tests/example_file.py
@@ -1,7 +1,2 @@ @@ -1,23 +1,2 @@
def hello_world(): def hello_world():
- # TODO: Come up with a more imaginative greeting - # TODO: Come up with a more imaginative greeting
print('Hello world') print('Hello world')
@ -59,6 +59,22 @@ index 525e25d..ba4e68d 100644
- # TODO: Do more stuff - # TODO: Do more stuff
- # This function should probably do something more interesting - # This function should probably do something more interesting
- # labels: help wanted - # 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 diff --git a/tests/example_file.rb b/tests/example_file.rb
index e6da2ec..67f14dd 100644 index e6da2ec..67f14dd 100644
--- a/tests/example_file.rb --- a/tests/example_file.rb
@ -163,7 +179,7 @@ index 0000000..7cccc5b
- #+begin_src python - #+begin_src python
- print("Hello World") - print("Hello World")
- #+end_src - #+end_src
- + #+begin_comment - #+begin_comment
- TODO: Multiline comments - TODO: Multiline comments
- also need to be turned into todos, and hopefully - also need to be turned into todos, and hopefully
- kept together as one todo - kept together as one todo

View File

@ -53,7 +53,7 @@ new file mode 100644
index 0000000..525e25d index 0000000..525e25d
--- /dev/null --- /dev/null
+++ b/tests/example_file.py +++ b/tests/example_file.py
@@ -0,0 +1,7 @@ @@ -0,0 +1,23 @@
+def hello_world(): +def hello_world():
+ # TODO: Come up with a more imaginative greeting + # TODO: Come up with a more imaginative greeting
+ print('Hello world') + print('Hello world')
@ -61,6 +61,23 @@ index 0000000..525e25d
+ # TODO: Do more stuff + # TODO: Do more stuff
+ # This function should probably do something more interesting + # This function should probably do something more interesting
+ # labels: help wanted + # 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
\ No newline at end of file
diff --git a/tests/example_file.rb b/tests/example_file.rb diff --git a/tests/example_file.rb b/tests/example_file.rb
new file mode 100644 new file mode 100644
index 0000000..e6da2ec index 0000000..e6da2ec

View File

@ -22,7 +22,7 @@ class NewIssueTests(unittest.TestCase):
self.raw_issues = parser.parse(diff_file) self.raw_issues = parser.parse(diff_file)
def test_python_issues(self): 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): def test_yaml_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'yaml'), 2) self.assertEqual(count_issues_for_file_type(self.raw_issues, 'yaml'), 2)
@ -70,7 +70,7 @@ class ClosedIssueTests(unittest.TestCase):
self.raw_issues = parser.parse(diff_file) self.raw_issues = parser.parse(diff_file)
def test_python_issues(self): 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): def test_yaml_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'yaml'), 2) self.assertEqual(count_issues_for_file_type(self.raw_issues, 'yaml'), 2)