mirror of
https://github.com/ditkrg/todo-to-issue-action.git
synced 2026-01-22 22:06:43 +00:00
code review
This commit is contained in:
commit
64aac3bc8a
11
README.md
11
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
|
||||
|
||||
3
main.py
3
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
|
||||
|
||||
|
||||
16
syntax.json
16
syntax.json
@ -838,6 +838,22 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"language": "Lua",
|
||||
"markers": [
|
||||
{
|
||||
"type": "line",
|
||||
"pattern": "--"
|
||||
},
|
||||
{
|
||||
"type": "block",
|
||||
"pattern": {
|
||||
"start": "--\\[\\[",
|
||||
"end": "--\\]\\]"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"language": "Solidity",
|
||||
"markers": [
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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):
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user