mirror of
https://github.com/ditkrg/todo-to-issue-action.git
synced 2026-01-25 07:16:42 +00:00
Merge pull request #147 from ralimi/support-jsonc
Add support for JSON with Comments.
This commit is contained in:
commit
f474c9525b
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": [
|
||||||
|
|||||||
@ -284,6 +284,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
|
||||||
|
|||||||
@ -306,6 +306,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
|
||||||
|
|||||||
@ -35,8 +35,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.
|
||||||
@ -131,8 +134,11 @@ class ClosedIssueTests(unittest.TestCase):
|
|||||||
def test_starlark_issues(self):
|
def test_starlark_issues(self):
|
||||||
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'python'), 5)
|
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'python'), 5)
|
||||||
|
|
||||||
|
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