diff --git a/syntax.json b/syntax.json index d1ed939..3cf4648 100644 --- a/syntax.json +++ b/syntax.json @@ -163,6 +163,22 @@ } ] }, + { + "language": "JSON with Comments", + "markers": [ + { + "type": "line", + "pattern": "//" + }, + { + "type": "block", + "pattern": { + "start": "/\\*", + "end": "\\*/" + } + } + ] + }, { "language": "JSON5", "markers": [ diff --git a/tests/test_closed.diff b/tests/test_closed.diff index d3bfd01..46b6617 100644 --- a/tests/test_closed.diff +++ b/tests/test_closed.diff @@ -278,6 +278,12 @@ index 525e25d..ba4e68d 100644 -TODO: Create an issue for TODO --} -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 index 0000000..525e25d 100644 --- a/tests/config.json5 diff --git a/tests/test_new.diff b/tests/test_new.diff index 292ae36..dea6434 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -292,6 +292,23 @@ index 0000000..525e25d + # This function should probably do something more interesting + # 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 new file mode 100644 index 0000000..525e25d diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index b811be2..e76fe3e 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -34,8 +34,11 @@ def test_php_issues(self): def test_java_issues(self): 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): - 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): # Includes 2 tests for Crystal. @@ -123,8 +126,11 @@ def test_tex_issues(self): def test_julia_issues(self): 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): - 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): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'autohotkey'), 1)