diff --git a/README.md b/README.md index 22a202f..d3bbcdc 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 @@ -235,9 +236,13 @@ jobs: git config --global user.email "github-actions[bot]@users.noreply.github.com" - name: Commit and Push Changes run: | - git add . - git commit -m "Automatically added GitHub issue links to TODOs" - git push origin main + git add -A + if [[ `git status --porcelain` ]]; then + git commit -m "Automatically added GitHub issue links to TODOs" + git push origin main + else + echo "No changes to commit" + fi ``` You will probably also want to use the setting `CLOSE_ISSUES: "true"`, to allow issues to be closed when a TODO is diff --git a/main.py b/main.py index 5e08701..a9155eb 100644 --- a/main.py +++ b/main.py @@ -662,9 +662,6 @@ class TodoParser(object): if value.lower() in attributes: for syntax_details in self.syntax_dict: if syntax_details['language'] == language_name: - # TODO: this is a hotfix to make it temporarily work for solidity. Currently using it in my own project. happy to implement a proper solution if possible - if language_name == "Solidity": - return syntax_details['markers'], "solidity" return syntax_details['markers'], self.languages_dict[language_name]['ace_mode'] return None, None diff --git a/syntax.json b/syntax.json index a870372..a4a7f95 100644 --- a/syntax.json +++ b/syntax.json @@ -838,6 +838,22 @@ } ] }, + { + "language": "Lua", + "markers": [ + { + "type": "line", + "pattern": "--" + }, + { + "type": "block", + "pattern": { + "start": "--\\[\\[", + "end": "--\\]\\]" + } + } + ] + }, { "language": "Solidity", "markers": [ diff --git a/tests/test_closed.diff b/tests/test_closed.diff index cfa5f79..e1104a1 100644 --- a/tests/test_closed.diff +++ b/tests/test_closed.diff @@ -483,6 +483,23 @@ 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/Counter.sol b/tests/Counter.sol new file mode 100644 index 0000000..d340f6a diff --git a/tests/test_new.diff b/tests/test_new.diff index 4a8e1d7..d50bd0a 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -539,6 +539,23 @@ index 0000000..0ce9b1a +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 +--- /dev/null ++++ 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/Counter.sol b/tests/Counter.sol new file mode 100644 index 0000000..d340f6a diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index f6576ff..388e4be 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -65,7 +65,7 @@ class NewIssueTests(unittest.TestCase): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'handlebars'), 2) def test_org_issues(self): - self.assertEqual(count_issues_for_file_type(self.raw_issues, 'text'), 8) + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'text'), 12) def test_scss_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'scss'), 2) @@ -100,10 +100,10 @@ class NewIssueTests(unittest.TestCase): def test_liquid_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'liquid'), 3) - def test_solidity_issues(self): - self.assertEqual(count_issues_for_file_type(self.raw_issues, 'solidity'), 4) + def test_lua_issues(self): + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'lua'), 2) -class ClosedIssueTests(unittest.TestCase): +class ClosedIssueTest(unittest.TestCase): # Check for removed TODOs across the files specified. def setUp(self): diff_file = open('tests/test_closed.diff', 'r') @@ -155,7 +155,7 @@ class ClosedIssueTests(unittest.TestCase): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'handlebars'), 2) def test_org_issues(self): - self.assertEqual(count_issues_for_file_type(self.raw_issues, 'text'), 8) + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'text'), 12) def test_scss_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'scss'), 2) @@ -190,9 +190,8 @@ class ClosedIssueTests(unittest.TestCase): def test_liquid_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'liquid'), 3) - def test_solidity_issues(self): - self.assertEqual(count_issues_for_file_type(self.raw_issues, 'solidity'), 4) - + def test_lua_issues(self): + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'lua'), 2) class IgnorePatternTests(unittest.TestCase):