From 7b6d7fb65ed4bf237b85b3b2ab61faef74bb80e0 Mon Sep 17 00:00:00 2001 From: unclebabykern Date: Mon, 1 Jul 2024 17:47:15 -0600 Subject: [PATCH 01/10] 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 02/10] 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 03/10] 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 04/10] 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) From fe5e34d9adc9effd9939c61d5c0aa8ca592321d1 Mon Sep 17 00:00:00 2001 From: klarkc Date: Thu, 11 Jul 2024 16:16:15 -0300 Subject: [PATCH 05/10] Add support for PureScript --- README.md | 1 + syntax.json | 16 ++++++++++++++++ tests/test_closed.diff | 21 ++++++++++++++++++++- tests/test_new.diff | 22 +++++++++++++++++++++- tests/test_todo_parser.py | 4 ++-- 5 files changed, 60 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 22c0499..75595a0 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,7 @@ These will be applied automatically to every issue, but will be overrode by any - Org Mode - PHP - Python +- PureScript - R - Razor - RMarkdown diff --git a/syntax.json b/syntax.json index 2acac03..0dafe57 100644 --- a/syntax.json +++ b/syntax.json @@ -364,6 +364,22 @@ } ] }, + { + "language": "PureScript", + "markers": [ + { + "type": "line", + "pattern": "--" + }, + { + "type": "block", + "pattern": { + "start": "{-", + "end": "-}" + } + } + ] + }, { "language": "Haskell", "markers": [ diff --git a/tests/test_closed.diff b/tests/test_closed.diff index 8ba979b..f9e9d95 100644 --- a/tests/test_closed.diff +++ b/tests/test_closed.diff @@ -428,4 +428,23 @@ index 0000000..7cccc5b 100644 + {data} ); - } \ No newline at end of file + } +diff --git a/src/Swarm/Game/example.purs b/src/Swarm/Game/example.purs +index 525e25d..ba4e68d 100644 +--- a/src/Swarm/Game/example.purs ++++ b/src/Swarm/Game/example.purs +@@ -1,14 +0,0 @@ +--- | Standard devices that are always installed. +--- +--- TODO: Remove standard devices +--- In the future, make a way to build these and just start the base +--- out with a large supply of each? +--- labels: redesign +-stdDeviceList = +- ["treads", "grabber", "solar panel", "scanner", "plasma cutter"] +- +-{- | Very complicated function. +- +-TODO: Create an issue for TODO +--} +-sum a b = a + b diff --git a/tests/test_new.diff b/tests/test_new.diff index 6a58acc..657f916 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -470,4 +470,24 @@ index 0000000..7cccc5b + */} + + ); -+} \ No newline at end of file ++} +diff --git a/src/Swarm/Game/example.purs b/src/Swarm/Game/example.purs +new file mode 100644 +index 0000000..0ce9b1a +--- /dev/null ++++ b/src/Swarm/Game/example.purs +@@ -0,0 +1,14 @@ ++-- | Standard devices that are always installed. ++-- ++-- TODO: Remove standard devices ++-- In the future, make a way to build these and just start the base ++-- out with a large supply of each? ++-- labels: redesign ++stdDeviceList = ++ ["treads", "grabber", "solar panel", "scanner", "plasma cutter"] ++ ++{- | Very complicated function. ++ ++TODO: Create an issue for TODO ++-} ++sum a b = a + b diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index 627d660..5f542d5 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -83,7 +83,7 @@ class NewIssueTests(unittest.TestCase): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'r'), 2) def test_haskell_issues(self): - self.assertEqual(count_issues_for_file_type(self.raw_issues, 'haskell'), 2) + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'haskell'), 4) def test_clojure_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'clojure'), 2) @@ -171,7 +171,7 @@ class ClosedIssueTests(unittest.TestCase): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'r'), 2) def test_haskell_issues(self): - self.assertEqual(count_issues_for_file_type(self.raw_issues, 'haskell'), 2) + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'haskell'), 4) def test_clojure_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'clojure'), 2) From 1f36e55b3181e0cf71c6cc67c2ab83289864e920 Mon Sep 17 00:00:00 2001 From: pufferffish Date: Tue, 3 Oct 2023 12:43:13 +0100 Subject: [PATCH 06/10] Add support for Agda --- syntax.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/syntax.json b/syntax.json index 0dafe57..8d9a54a 100644 --- a/syntax.json +++ b/syntax.json @@ -812,5 +812,21 @@ } } ] + }, + { + "language": "Agda", + "markers": [ + { + "type": "line", + "pattern": "--" + }, + { + "type": "block", + "pattern": { + "start": "{-", + "end": "-}" + } + } + ] } ] From 7d8b98490006925f6a50bb31261716428bac9649 Mon Sep 17 00:00:00 2001 From: klarkc Date: Thu, 11 Jul 2024 16:29:45 -0300 Subject: [PATCH 07/10] Add Agda doc and tests --- README.md | 1 + tests/test_closed.diff | 19 +++++++++++++++++++ tests/test_new.diff | 20 ++++++++++++++++++++ tests/test_todo_parser.py | 4 ++-- 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 75595a0..32ec12a 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,7 @@ These will be applied automatically to every issue, but will be overrode by any - ABAP - ABAP CDS +- Agda - AutoHotkey - C - C++ diff --git a/tests/test_closed.diff b/tests/test_closed.diff index f9e9d95..1422c1e 100644 --- a/tests/test_closed.diff +++ b/tests/test_closed.diff @@ -448,3 +448,22 @@ index 525e25d..ba4e68d 100644 -TODO: Create an issue for TODO --} -sum a b = a + b +diff --git a/src/Swarm/Game/example.agda b/src/Swarm/Game/example.agda +index 525e25d..ba4e68d 100644 +--- a/src/Swarm/Game/example.agda ++++ b/src/Swarm/Game/example.agda +@@ -1,14 +0,0 @@ +--- | Standard devices that are always installed. +--- +--- TODO: Remove standard devices +--- In the future, make a way to build these and just start the base +--- out with a large supply of each? +--- labels: redesign +-stdDeviceList = +- ["treads", "grabber", "solar panel", "scanner", "plasma cutter"] +- +-{- | Very complicated function. +- +-TODO: Create an issue for TODO +--} +-sum a b = a + b diff --git a/tests/test_new.diff b/tests/test_new.diff index 657f916..b0b2454 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -491,3 +491,23 @@ index 0000000..0ce9b1a +TODO: Create an issue for TODO +-} +sum a b = a + b +diff --git a/src/Swarm/Game/example.agda b/src/Swarm/Game/example.agda +new file mode 100644 +index 0000000..0ce9b1a +--- /dev/null ++++ b/src/Swarm/Game/example.agda +@@ -0,0 +1,14 @@ ++-- | Standard devices that are always installed. ++-- ++-- TODO: Remove standard devices ++-- In the future, make a way to build these and just start the base ++-- out with a large supply of each? ++-- labels: redesign ++stdDeviceList = ++ ["treads", "grabber", "solar panel", "scanner", "plasma cutter"] ++ ++{- | Very complicated function. ++ ++TODO: Create an issue for TODO ++-} ++sum a b = a + b diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index 5f542d5..451990a 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'), 4) + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'text'), 6) def test_scss_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'scss'), 2) @@ -153,7 +153,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'), 4) + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'text'), 6) def test_scss_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'scss'), 2) From 1ff063b19e55a2041e3d1d1c1f9b8c3d7d15296c Mon Sep 17 00:00:00 2001 From: Kevin Ge Date: Mon, 5 Aug 2024 22:38:54 -0700 Subject: [PATCH 08/10] fix: check filename if no extensions match --- main.py | 4 +++- tests/test_new.diff | 14 ++++++++++++++ tests/test_todo_parser.py | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 2abd73a..403c637 100644 --- a/main.py +++ b/main.py @@ -564,11 +564,13 @@ class TodoParser(object): """Try and get the Markdown language and comment syntax data for the given file.""" file_name, extension = os.path.splitext(os.path.basename(file)) for language_name in self.languages_dict: + # Check if the file extension matches the language's extensions. if extension != "" and 'extensions' in self.languages_dict[language_name]: syntax_details, ace_mode = self._get_language_details(language_name, 'extensions', extension) if syntax_details is not None and ace_mode is not None: return syntax_details, ace_mode - elif 'filenames' in self.languages_dict[language_name]: + # Check if the file name matches the language's filenames. + if 'filenames' in self.languages_dict[language_name]: syntax_details, ace_mode = self._get_language_details(language_name, 'filenames', file_name) if syntax_details is not None and ace_mode is not None: return syntax_details, ace_mode diff --git a/tests/test_new.diff b/tests/test_new.diff index b0b2454..cb2dbd5 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -201,6 +201,20 @@ index 0000000..525e25d + # This function should probably do something more interesting + # labels: help wanted + pass +diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel +new file mode 100644 +index 0000000..525e25d +--- /dev/null ++++ b/tests/BUILD.bazel +@@ -0,0 +1,23 @@ ++def hello_world(): ++ # TODO: Come up with a more imaginative greeting ++ print('Hello world') ++ ++ # TODO: Do more stuff ++ # This function should probably do something more interesting ++ # labels: help wanted ++ pass diff --git a/tests/example_file.ahk b/src/tests/example_file.ahk new file mode 100644 index 0000000..7cccc5b diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index 451990a..9254e91 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -24,7 +24,7 @@ class NewIssueTests(unittest.TestCase): def test_python_issues(self): # Includes 2 tests for Starlark. - self.assertEqual(count_issues_for_file_type(self.raw_issues, 'python'), 6) + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'python'), 8) def test_yaml_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'yaml'), 2) @@ -56,7 +56,7 @@ class NewIssueTests(unittest.TestCase): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'julia'), 2) def test_starlark_issues(self): - self.assertEqual(count_issues_for_file_type(self.raw_issues, 'python'), 6) + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'python'), 8) def test_autohotkey_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'autohotkey'), 1) From 6ee994070c75d47c4947bfaf845d36cc8acd1788 Mon Sep 17 00:00:00 2001 From: Kevin Ge Date: Mon, 5 Aug 2024 22:41:00 -0700 Subject: [PATCH 09/10] fix: number of Starlark tests in comment --- tests/test_todo_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index 9254e91..9cb3236 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -23,7 +23,7 @@ class NewIssueTests(unittest.TestCase): self.raw_issues = parser.parse(diff_file) def test_python_issues(self): - # Includes 2 tests for Starlark. + # Includes 4 tests for Starlark. self.assertEqual(count_issues_for_file_type(self.raw_issues, 'python'), 8) def test_yaml_issues(self): From 3c45de9f2c2dbcebbcaa0f6ef528d96ff054eaab Mon Sep 17 00:00:00 2001 From: Alastair Mooney Date: Mon, 19 Aug 2024 16:34:02 +0100 Subject: [PATCH 10/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 32ec12a..f48c2fb 100644 --- a/README.md +++ b/README.md @@ -238,7 +238,7 @@ The workflow file takes the following optional inputs: | IGNORE | False | A collection of comma-delimited regular expressions that match files that should be ignored when searching for TODOs | | AUTO_ASSIGN | False | Automatically assign new issues to the user who triggered the action | | ACTOR | False | The username of the person who triggered the action | -| ISSUE_TEMPLATE | False | The template used to format new issues | +| ISSUE_TEMPLATE | False | The template used to format new issues, e.g. `TODO title: {{ title }}\nBody: {{ body }}\nLink: {{ url }}\nCode:\n{{ snippet }}` | | IDENTIFIERS | False | List of custom identifier dictionaries of the form `[{"name": "TODO", "labels": [todo]}]` | | GITHUB_URL | False | Base URL of GitHub API | | ESCAPE | False | Escape all special Markdown characters |