From 10c00c31445c05dfec2f96d5acda59f25afa5ff6 Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Mon, 7 Oct 2024 16:36:37 +0100 Subject: [PATCH 1/4] Adds support for lua --- syntax.json | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/syntax.json b/syntax.json index 0de8d02..de8a68c 100644 --- a/syntax.json +++ b/syntax.json @@ -837,5 +837,21 @@ } } ] - } + }, + { + "language": "Lua", + "markers": [ + { + "type": "line", + "pattern": "--" + }, + { + "type": "block", + "pattern": { + "start": "--[[", + "end": "--]]" + } + } + ] + }, ] From 50aa970dc48c6de013a56e20e94895f8d6479800 Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Mon, 7 Oct 2024 16:38:02 +0100 Subject: [PATCH 2/4] code review --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2fdbd0d..115bf3f 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ Only a single milestone can be specified. If the milestone does not exist, it wi - Kotlin - Less - Liquid +- Lua - Makefile - Markdown - Nix From 7b5d19e941fb3d5450193fe53555868f6514153f Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Tue, 8 Oct 2024 12:02:02 +0100 Subject: [PATCH 3/4] code review --- syntax.json | 2 +- tests/custom_languages.json | 2 +- tests/test_new.diff | 14 ++++++++++++++ tests/test_todo_parser.py | 3 +++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/syntax.json b/syntax.json index de8a68c..2ead721 100644 --- a/syntax.json +++ b/syntax.json @@ -853,5 +853,5 @@ } } ] - }, + } ] diff --git a/tests/custom_languages.json b/tests/custom_languages.json index 2ac5c19..04bd26d 100644 --- a/tests/custom_languages.json +++ b/tests/custom_languages.json @@ -37,4 +37,4 @@ } ] } -] \ No newline at end of file +] diff --git a/tests/test_new.diff b/tests/test_new.diff index 8df409d..3ef80c7 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -539,3 +539,17 @@ index 0000000..0ce9b1a +TODO: Create an issue for TODO +-} +sum a b = a + b +diff --git a/src/init.lua b/src/init.lua +new file mode 100644 +index 0000000..0ce9b1a +--- /dev/null ++++ b/src/init.lua +@@ -0,0 +1,8 @@ ++-- TODO: Fix this ++-- In the future, make a way to build these and just start the base ++-- out with a large supply of each ++-- labels: redesign ++--[[ ++ TODO: Fix this todo ++ labels: urgent ++--]] diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index 62c8622..7250cf2 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -100,6 +100,9 @@ def test_c_cpp_like_issues(self): def test_liquid_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'liquid'), 3) + def test_liquid_issues(self): + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'lua'), 3) + class ClosedIssueTests(unittest.TestCase): # Check for removed TODOs across the files specified. def setUp(self): From 94022cee5162d4064c83e241881f7b40dc234f54 Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Tue, 8 Oct 2024 12:16:19 +0100 Subject: [PATCH 4/4] code review --- syntax.json | 4 ++-- tests/custom_languages.json | 2 +- tests/test_closed.diff | 17 +++++++++++++++++ tests/test_new.diff | 9 ++++++--- tests/test_todo_parser.py | 7 +++++-- 5 files changed, 31 insertions(+), 8 deletions(-) diff --git a/syntax.json b/syntax.json index 2ead721..d179da4 100644 --- a/syntax.json +++ b/syntax.json @@ -848,8 +848,8 @@ { "type": "block", "pattern": { - "start": "--[[", - "end": "--]]" + "start": "--\\[\\[", + "end": "--\\]\\]" } } ] diff --git a/tests/custom_languages.json b/tests/custom_languages.json index 04bd26d..2ac5c19 100644 --- a/tests/custom_languages.json +++ b/tests/custom_languages.json @@ -37,4 +37,4 @@ } ] } -] +] \ No newline at end of file diff --git a/tests/test_closed.diff b/tests/test_closed.diff index bd2a940..1b1a6cb 100644 --- a/tests/test_closed.diff +++ b/tests/test_closed.diff @@ -483,3 +483,20 @@ index 525e25d..ba4e68d 100644 -TODO: Create an issue for TODO --} -sum a b = a + b +diff --git a/init.lua b/init.lua +new file mode 100644 +index 0000000..0ce9b1a +--- a/init.lua ++++ b/init.lua +@@ -0,0 +1,11 @@ +--- TODO: Fix this +--- In the future, make a way to build these and just start the base +--- out with a large supply of each +--- labels: redesign +-local a = 1 +- +---[[ +- TODO: Fix this todo +- labels: urgent +---]] +-local b = 2 diff --git a/tests/test_new.diff b/tests/test_new.diff index 3ef80c7..db2273e 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -539,17 +539,20 @@ index 0000000..0ce9b1a +TODO: Create an issue for TODO +-} +sum a b = a + b -diff --git a/src/init.lua b/src/init.lua +diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..0ce9b1a --- /dev/null -+++ b/src/init.lua -@@ -0,0 +1,8 @@ ++++ b/init.lua +@@ -0,0 +1,11 @@ +-- TODO: Fix this +-- In the future, make a way to build these and just start the base +-- out with a large supply of each +-- labels: redesign ++local a = 1 ++ +--[[ + TODO: Fix this todo + labels: urgent +--]] ++local b = 2 diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index 7250cf2..705e764 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -100,8 +100,8 @@ def test_c_cpp_like_issues(self): def test_liquid_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'liquid'), 3) - def test_liquid_issues(self): - self.assertEqual(count_issues_for_file_type(self.raw_issues, 'lua'), 3) + def test_lua_issues(self): + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'lua'), 2) class ClosedIssueTests(unittest.TestCase): # Check for removed TODOs across the files specified. @@ -190,6 +190,9 @@ def test_c_cpp_like_issues(self): def test_liquid_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'liquid'), 3) + def test_lua_issues(self): + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'lua'), 2) + class IgnorePatternTests(unittest.TestCase):