mirror of
https://github.com/ditkrg/todo-to-issue-action.git
synced 2026-01-22 22:06:43 +00:00
Add support for JSON with Comments.
Support is similar to JSON5, except block comments are also supported.
This commit is contained in:
parent
9430173992
commit
53f6d2f8fe
16
syntax.json
16
syntax.json
@ -163,6 +163,22 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"language": "JSON with Comments",
|
||||||
|
"markers": [
|
||||||
|
{
|
||||||
|
"type": "line",
|
||||||
|
"pattern": "//"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "block",
|
||||||
|
"pattern": {
|
||||||
|
"start": "/\\*",
|
||||||
|
"end": "\\*/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"language": "JSON5",
|
"language": "JSON5",
|
||||||
"markers": [
|
"markers": [
|
||||||
|
|||||||
@ -278,6 +278,12 @@ index 525e25d..ba4e68d 100644
|
|||||||
-TODO: Create an issue for TODO
|
-TODO: Create an issue for TODO
|
||||||
--}
|
--}
|
||||||
-sum a b = a + b
|
-sum a b = a + b
|
||||||
|
diff --git a/tests/config.jsonc b/tests/config.jsonc
|
||||||
|
index 0000000..525e25d 100644
|
||||||
|
--- a/tests/config.jsonc
|
||||||
|
+++ b/tests/config.jsonc
|
||||||
|
@@ -0,0 +0,1 @@
|
||||||
|
- // TODO: Delete this line from the codebase
|
||||||
diff --git a/tests/config.json5 b/tests/config.json5
|
diff --git a/tests/config.json5 b/tests/config.json5
|
||||||
index 0000000..525e25d 100644
|
index 0000000..525e25d 100644
|
||||||
--- a/tests/config.json5
|
--- a/tests/config.json5
|
||||||
|
|||||||
@ -292,6 +292,23 @@ index 0000000..525e25d
|
|||||||
+ # This function should probably do something more interesting
|
+ # This function should probably do something more interesting
|
||||||
+ # labels: help wanted
|
+ # labels: help wanted
|
||||||
+}
|
+}
|
||||||
|
diff --git a/tests/config.jsonc b/tests/config.jsonc
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..525e25d
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/config.jsonc
|
||||||
|
@@ -0,0 +0,11 @@
|
||||||
|
+{
|
||||||
|
+ "myConfig": [
|
||||||
|
+ /*
|
||||||
|
+ GitRepository where 'Git release/tag'
|
||||||
|
+ matches 'Helm' version
|
||||||
|
+ */
|
||||||
|
+ "itIsWonderful",
|
||||||
|
+ // TODO: Delete this line from the codebase
|
||||||
|
+ "butItHasSomePendingActivities"
|
||||||
|
+ ]
|
||||||
|
+}
|
||||||
diff --git a/tests/config.json5 b/tests/config.json5
|
diff --git a/tests/config.json5 b/tests/config.json5
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..525e25d
|
index 0000000..525e25d
|
||||||
|
|||||||
@ -34,8 +34,11 @@ class NewIssueTests(unittest.TestCase):
|
|||||||
def test_java_issues(self):
|
def test_java_issues(self):
|
||||||
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'java'), 2)
|
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'java'), 2)
|
||||||
|
|
||||||
|
def test_json_with_comments_issues(self):
|
||||||
|
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'javascript'), 2)
|
||||||
|
|
||||||
def test_json5_issues(self):
|
def test_json5_issues(self):
|
||||||
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'javascript'), 1)
|
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'javascript'), 2)
|
||||||
|
|
||||||
def test_ruby_issues(self):
|
def test_ruby_issues(self):
|
||||||
# Includes 2 tests for Crystal.
|
# Includes 2 tests for Crystal.
|
||||||
@ -123,8 +126,11 @@ class ClosedIssueTests(unittest.TestCase):
|
|||||||
def test_julia_issues(self):
|
def test_julia_issues(self):
|
||||||
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'julia'), 2)
|
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'julia'), 2)
|
||||||
|
|
||||||
|
def test_json_with_comments_issues(self):
|
||||||
|
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'javascript'), 2)
|
||||||
|
|
||||||
def test_json5_issues(self):
|
def test_json5_issues(self):
|
||||||
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'javascript'), 1)
|
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'javascript'), 2)
|
||||||
|
|
||||||
def test_autohotkey_issues(self):
|
def test_autohotkey_issues(self):
|
||||||
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'autohotkey'), 1)
|
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'autohotkey'), 1)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user