From 48caf5c8abd66fde1cb9c1a9be91194619e7c284 Mon Sep 17 00:00:00 2001 From: James McMahon Date: Wed, 18 May 2022 15:43:07 +0100 Subject: [PATCH 1/4] Add language definition for R [R](https://en.wikipedia.org/wiki/R_(programming_language)) Comments are simply started with a `#` --- syntax.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/syntax.json b/syntax.json index 374112e..58d6935 100644 --- a/syntax.json +++ b/syntax.json @@ -600,5 +600,14 @@ "pattern": "#" } ] + }, + { + "language": "R", + "markers": [ + { + "type": "line", + "pattern": "#" + } + ] } ] From ef90653a9cd4b393b68b669019fe9584070290c3 Mon Sep 17 00:00:00 2001 From: James McMahon Date: Fri, 20 May 2022 12:15:03 +0100 Subject: [PATCH 2/4] Add tests for R --- tests/test_closed.diff | 13 +++++++++++++ tests/test_new.diff | 14 ++++++++++++++ tests/test_todo_parser.py | 5 +++++ 3 files changed, 32 insertions(+) diff --git a/tests/test_closed.diff b/tests/test_closed.diff index d7190f1..f49f688 100644 --- a/tests/test_closed.diff +++ b/tests/test_closed.diff @@ -222,3 +222,16 @@ index 525e25d..ba4e68d 100644 - also need to be turned into todos, and hopefully - kept together as one todo - #} +diff --git a/tests/example_file.py b/tests/example_file.R +index 525e25d..ba4e68d 100644 +--- a/tests/example_file.R ++++ b/tests/example_file.R +@@ -1,23 +1,2 @@ +hello_world <- function() { +- # TODO: Come up with a more imaginative greeting + message("Hello world") +- +- # TODO: Do more stuff +- # This function should probably do something more interesting +- # labels: help wanted + diff --git a/tests/test_new.diff b/tests/test_new.diff index 690698e..6df3bae 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -232,3 +232,17 @@ index 0000000..7cccc5b + also need to be turned into todos, and hopefully + kept together as one todo + #} +diff --git a/tests/example_file.py b/tests/example_file.R +new file mode 100644 +index 0000000..525e25d +--- /dev/null ++++ b/tests/example_file.R +@@ -0,0 +1,23 @@ ++hello_world <- function() { ++ # TODO: Come up with a more imaginative greeting ++ message("Hello world") ++ ++ # TODO: Do more stuff ++ # This function should probably do something more interesting ++ # labels: help wanted ++} \ No newline at end of file diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index 2c1e671..f02c8f5 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -64,6 +64,9 @@ class NewIssueTests(unittest.TestCase): def test_twig_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'twig'), 2) + def test_r_issues(self): + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'r'), 2) + class ClosedIssueTests(unittest.TestCase): # Check for removed TODOs across the files specified. @@ -117,6 +120,8 @@ class ClosedIssueTests(unittest.TestCase): def test_twig_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'twig'), 2) + def test_r_issues(self): + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'r'), 2) class IgnorePatternTests(unittest.TestCase): From 5aa073df5e9d6ee91cc50e8b29ccafd2241227e7 Mon Sep 17 00:00:00 2001 From: Alastair Mooney Date: Fri, 20 May 2022 17:18:46 +0100 Subject: [PATCH 3/4] Update test_closed.diff --- tests/test_closed.diff | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_closed.diff b/tests/test_closed.diff index 581cfdf..ba9b759 100644 --- a/tests/test_closed.diff +++ b/tests/test_closed.diff @@ -246,10 +246,10 @@ index 525e25d..ba4e68d 100644 - kept together as one todo - */} - - [ ] TODO: An inline todo that's NOT a comment (what) -diff --git a/tests/example_file.py b/tests/example_file.R +diff --git a/tests/example_file.r b/tests/example_file.r index 525e25d..ba4e68d 100644 ---- a/tests/example_file.R -+++ b/tests/example_file.R +--- a/tests/example_file.r ++++ b/tests/example_file.r @@ -1,23 +1,2 @@ hello_world <- function() { - # TODO: Come up with a more imaginative greeting @@ -258,4 +258,4 @@ hello_world <- function() { - # TODO: Do more stuff - # This function should probably do something more interesting - # labels: help wanted -} \ No newline at end of file +} From 13ebb378a7e44e30389d43987a0508299531c0d5 Mon Sep 17 00:00:00 2001 From: Alastair Mooney Date: Fri, 20 May 2022 17:19:25 +0100 Subject: [PATCH 4/4] Update test_new.diff --- tests/test_new.diff | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_new.diff b/tests/test_new.diff index c9aadb7..7aa01e1 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -258,11 +258,11 @@ index 0000000..7cccc5b + kept together as one todo + */} + - [ ] TODO: An inline todo that's NOT a comment (what) -diff --git a/tests/example_file.py b/tests/example_file.R +diff --git a/tests/example_file.r b/tests/example_file.r new file mode 100644 index 0000000..525e25d --- /dev/null -+++ b/tests/example_file.R ++++ b/tests/example_file.r @@ -0,0 +1,23 @@ +hello_world <- function() { + # TODO: Come up with a more imaginative greeting @@ -271,4 +271,4 @@ index 0000000..525e25d + # TODO: Do more stuff + # This function should probably do something more interesting + # labels: help wanted -+} \ No newline at end of file ++}