mirror of
https://github.com/ditkrg/todo-to-issue-action.git
synced 2026-01-22 22:06:43 +00:00
feat: add mdx style comments
This commit is contained in:
parent
355d677107
commit
679302c25a
2
main.py
2
main.py
@ -308,7 +308,7 @@ class TodoParser(object):
|
||||
raise Exception('Cannot retrieve languages data. Operation will abort.')
|
||||
|
||||
# Load the comment syntax data for identifying comments.
|
||||
syntax_url = 'https://raw.githubusercontent.com/alstr/todo-to-issue-action/master/syntax.json'
|
||||
syntax_url = 'https://raw.githubusercontent.com/thomasfkjorna/todo-to-issue-action/master/syntax.json'
|
||||
syntax_request = requests.get(url=syntax_url)
|
||||
if syntax_request.status_code == 200:
|
||||
self.syntax_dict = syntax_request.json()
|
||||
|
||||
15
syntax.json
15
syntax.json
@ -365,6 +365,13 @@
|
||||
"start": "<!--",
|
||||
"end": "-->"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "block",
|
||||
"pattern": {
|
||||
"start": "{/\\*",
|
||||
"end": "\\*/}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -546,7 +553,7 @@
|
||||
},
|
||||
{
|
||||
"language": "HCL",
|
||||
"markers" : [
|
||||
"markers": [
|
||||
{
|
||||
"type": "line",
|
||||
"pattern": "#"
|
||||
@ -566,7 +573,7 @@
|
||||
},
|
||||
{
|
||||
"language": "SCSS",
|
||||
"markers" : [
|
||||
"markers": [
|
||||
{
|
||||
"type": "line",
|
||||
"pattern": "//"
|
||||
@ -578,11 +585,11 @@
|
||||
"end": "\\*/"
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"language": "Twig",
|
||||
"markers" : [
|
||||
"markers": [
|
||||
{
|
||||
"type": "block",
|
||||
"pattern": {
|
||||
|
||||
@ -222,3 +222,15 @@ index 525e25d..ba4e68d 100644
|
||||
- also need to be turned into todos, and hopefully
|
||||
- kept together as one todo
|
||||
- #}
|
||||
diff --git a/tests/example_file.md b/src/tests/example_file.md
|
||||
index 525e25d..ba4e68d 100644
|
||||
--- a/src/tests/example_file.md
|
||||
+++ b/src/tests/example_file.md
|
||||
@@ -1,6 +0,0 @@
|
||||
- {/* TODO: Hopefully this comment turns into a todo issue */}
|
||||
- {/*
|
||||
- TODO:Multiline comments
|
||||
- also need to be turned into todos, and hopefully
|
||||
- kept together as one todo
|
||||
- */}
|
||||
|
||||
|
||||
@ -232,3 +232,15 @@ index 0000000..7cccc5b
|
||||
+ also need to be turned into todos, and hopefully
|
||||
+ kept together as one todo
|
||||
+ #}
|
||||
diff --git a/tests/example_file.md b/src/tests/example_file.md
|
||||
new file mode 100644
|
||||
index 0000000..7cccc5b
|
||||
--- /dev/null
|
||||
+++ b/src/tests/example_file.md
|
||||
@@ -0,0 +1,6 @@
|
||||
+ {/* TODO: Hopefully this comment turns into a todo issue */}
|
||||
+ {/*
|
||||
+ TODO:Multiline comments
|
||||
+ also need to be turned into todos, and hopefully
|
||||
+ kept together as one todo
|
||||
+ */}
|
||||
|
||||
@ -64,6 +64,9 @@ class NewIssueTests(unittest.TestCase):
|
||||
def test_twig_issues(self):
|
||||
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'twig'), 2)
|
||||
|
||||
def test_md_issues(self):
|
||||
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'md'), 2)
|
||||
|
||||
|
||||
class ClosedIssueTests(unittest.TestCase):
|
||||
# Check for removed TODOs across the files specified.
|
||||
@ -117,6 +120,9 @@ class ClosedIssueTests(unittest.TestCase):
|
||||
def test_twig_issues(self):
|
||||
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'twig'), 2)
|
||||
|
||||
def test_md_issues(self):
|
||||
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'md'), 2)
|
||||
|
||||
|
||||
class IgnorePatternTests(unittest.TestCase):
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user