From 7b6d7fb65ed4bf237b85b3b2ab61faef74bb80e0 Mon Sep 17 00:00:00 2001 From: unclebabykern Date: Mon, 1 Jul 2024 17:47:15 -0600 Subject: [PATCH 1/4] add additional block comment syntax for TSX --- syntax.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/syntax.json b/syntax.json index 2567737..2acac03 100644 --- a/syntax.json +++ b/syntax.json @@ -242,6 +242,13 @@ "start": "/\\*", "end": "\\*/" } + }, + { + "type": "block", + "pattern": { + "start": "{/\\*", + "end": "\\*/}" + } } ] }, From e01c95d094310d8729eedc6936a164a7fe65e0e8 Mon Sep 17 00:00:00 2001 From: unclebabykern Date: Mon, 1 Jul 2024 17:47:49 -0600 Subject: [PATCH 2/4] add TSX extension new test --- tests/test_new.diff | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/test_new.diff b/tests/test_new.diff index efba12c..6a58acc 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -451,4 +451,23 @@ index 0000000..7cccc5b +TODO: Render Liquid file +{% assign featured_product = all_products["product_handle"] %} +{% render "product", product: featured_product %} -+{% endcomment %} \ No newline at end of file ++{% endcomment %} +diff --git a/tests/example_file.tsx b/tests/example_file.tsx +new file mode 100644 +index 0000000..7cccc5b +--- /dev/null ++++ b/tests/example_file.tsx +@@ -0,0 +1,13 @@ ++// TODO: rename component ++export default async function Component() { ++ /* TODO: Use state here ++ labels: client */ ++ ++ return ( ++
++ {/* ++ TODO: use styled component library ++ */} ++
++ ); ++} \ No newline at end of file From 2398638d34508b089e9e5cff280c0dd57d63744d Mon Sep 17 00:00:00 2001 From: unclebabykern Date: Mon, 1 Jul 2024 17:48:55 -0600 Subject: [PATCH 3/4] cleanup redundant JS test func and add tsx --- tests/test_todo_parser.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index 7f3254f..a8225f3 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -35,11 +35,9 @@ class NewIssueTests(unittest.TestCase): 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'), 2) + def test_javascript_issues(self): + # Includes 1 test for JSON w/ comments, 1 test for JSON5, & 3 tests for TSX + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'javascript'), 5) def test_ruby_issues(self): # Includes 2 tests for Crystal. From 8ba861435d54a1159a4db2867b82822caa976388 Mon Sep 17 00:00:00 2001 From: unclebabykern Date: Wed, 3 Jul 2024 18:00:20 -0600 Subject: [PATCH 4/4] test: add TSX closed issue tests and merge JSON --- tests/test_closed.diff | 23 ++++++++++++++++++++++- tests/test_todo_parser.py | 10 ++++------ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/tests/test_closed.diff b/tests/test_closed.diff index 8e35037..8ba979b 100644 --- a/tests/test_closed.diff +++ b/tests/test_closed.diff @@ -407,4 +407,25 @@ index 0000000..7cccc5b 100644 -TODO: Render Liquid file {% assign featured_product = all_products["product_handle"] %} {% render "product", product: featured_product %} --{% endcomment %} \ No newline at end of file +-{% endcomment %} +diff --git a/tests/example_file.tsx b/tests/example_file.tsx +index 0000000..7cccc5b 100644 +--- a/tests/example_file.tsx ++++ b/tests/example_file.tsx +@@ -1,7 +1,3 @@ +-// TODO: rename component +-export default async function Component() { ++export default async function MyComponent() { +- /* TODO: Use state here +- labels: client */ ++ const [data, setData] = useState(""); + + return ( +
+- {/* +- TODO: use styled component library +- */} ++ {data} +
+ ); + } \ No newline at end of file diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index a8225f3..627d660 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -36,7 +36,7 @@ class NewIssueTests(unittest.TestCase): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'java'), 2) def test_javascript_issues(self): - # Includes 1 test for JSON w/ comments, 1 test for JSON5, & 3 tests for TSX + # Includes 1 test for JSON with Comments, 1 test for JSON5, 3 tests for TSX. self.assertEqual(count_issues_for_file_type(self.raw_issues, 'javascript'), 5) def test_ruby_issues(self): @@ -142,11 +142,9 @@ class ClosedIssueTests(unittest.TestCase): def test_starlark_issues(self): 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): - self.assertEqual(count_issues_for_file_type(self.raw_issues, 'javascript'), 2) + def test_javascript_issues(self): + # Includes 1 test for JSON with Comments, 1 test for JSON5, 3 tests for TSX. + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'javascript'), 5) def test_autohotkey_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'autohotkey'), 1)