From 3c3aea1777cfbfef5df26ed658d18fbf3b39e670 Mon Sep 17 00:00:00 2001 From: Mike Snoeren <52166423+mikesnoeren@users.noreply.github.com> Date: Mon, 14 Feb 2022 16:29:33 +0100 Subject: [PATCH 1/3] Add Twig to syntax.json --- syntax.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/syntax.json b/syntax.json index 0c4f0bd..cbc11c8 100644 --- a/syntax.json +++ b/syntax.json @@ -579,5 +579,17 @@ } } ] + }, + { + "language": "Twig", + "markers" : [ + { + "type": "block", + "pattern": { + "start": "{#", + "end": "#}" + } + } + ] } ] From 85822093baa41fc2ca086c552709b9ac7507c426 Mon Sep 17 00:00:00 2001 From: Mike Snoeren <52166423+mikesnoeren@users.noreply.github.com> Date: Mon, 14 Feb 2022 16:30:25 +0100 Subject: [PATCH 2/3] Add mock code to test_new.diff --- tests/test_new.diff | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_new.diff b/tests/test_new.diff index 4d09d6d..5e112fc 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -208,3 +208,15 @@ index 0000000..7cccc5b + text-align: center; + } +} +diff --git a/tests/example_file.twig b/src/tests/example_file.twig +new file mode 100644 +index 0000000..7cccc5b +--- /dev/null ++++ b/src/tests/example_file.scss +@@ -0,0 +1,11 @@ ++ {# 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 ++ #} From a6e0ba71bf72ae16f0cb7e37ce5e26db04dd3fe9 Mon Sep 17 00:00:00 2001 From: alstr Date: Wed, 16 Feb 2022 14:40:38 +0000 Subject: [PATCH 3/3] Add Twig tests --- README.md | 3 ++- tests/test_closed.diff | 11 +++++++++++ tests/test_new.diff | 4 ++-- tests/test_todo_parser.py | 6 ++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ac8c3c3..26c21da 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Create a `workflow.yml` file in your `.github/workflows` directory like: steps: - uses: "actions/checkout@master" - name: "TODO to Issue" - uses: "alstr/todo-to-issue-action@v4.6" + uses: "alstr/todo-to-issue-action@v4.6.1" id: "todo" ``` @@ -100,6 +100,7 @@ There are additional inputs if you want to be able to assign issues to projects. * Swift * TeX * TSX +* Twig * TypeScript * Vue * YAML diff --git a/tests/test_closed.diff b/tests/test_closed.diff index da5cab4..f42c460 100644 --- a/tests/test_closed.diff +++ b/tests/test_closed.diff @@ -200,3 +200,14 @@ index 525e25d..ba4e68d 100644 - text-align: center; - } -} +diff --git a/tests/example_file.twig b/src/tests/example_file.twig +index 525e25d..ba4e68d 100644 +--- a/src/tests/example_file.twig ++++ b/src/tests/example_file.twig +@@ -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 +- #} \ No newline at end of file diff --git a/tests/test_new.diff b/tests/test_new.diff index 5e112fc..805b2a2 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -212,8 +212,8 @@ diff --git a/tests/example_file.twig b/src/tests/example_file.twig new file mode 100644 index 0000000..7cccc5b --- /dev/null -+++ b/src/tests/example_file.scss -@@ -0,0 +1,11 @@ ++++ b/src/tests/example_file.twig +@@ -0,0 +1,6 @@ + {# TODO: Hopefully this comment turns into a todo issue #} + {# + TODO:Multiline comments diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index 8f05637..aaf40af 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -60,6 +60,9 @@ class NewIssueTests(unittest.TestCase): def test_scss_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'scss'), 2) + def test_twig_issues(self): + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'twig'), 2) + class ClosedIssueTests(unittest.TestCase): # Check for removed TODOs across the files specified. @@ -109,6 +112,9 @@ class ClosedIssueTests(unittest.TestCase): def test_scss_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'scss'), 2) + def test_twig_issues(self): + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'twig'), 2) + class IgnorePatternTests(unittest.TestCase):