From dab20df5f260517df424e74f20e4b00373122f10 Mon Sep 17 00:00:00 2001
From: Max Brede <50902832+MBrede@users.noreply.github.com>
Date: Thu, 23 Mar 2023 14:05:08 +0100
Subject: [PATCH 1/5] added rmd support
---
syntax.json | 25 ++++++++++++++++++++++++-
tests/test_closed.diff | 12 ++++++++++++
tests/test_new.diff | 15 ++++++++++++++-
tests/test_todo_parser.py | 6 ++++++
4 files changed, 56 insertions(+), 2 deletions(-)
diff --git a/syntax.json b/syntax.json
index 808f963..27b101d 100644
--- a/syntax.json
+++ b/syntax.json
@@ -429,6 +429,29 @@
}
]
},
+ {
+ "language": "Rmarkdown",
+ "markers": [
+ {
+ "type": "block",
+ "pattern": {
+ "start": ""
+ }
+ },
+ {
+ "type": "block",
+ "pattern": {
+ "start": "{/\\*",
+ "end": "\\*/}"
+ }
+ },
+ {
+ "type": "line",
+ "pattern": "- \\[ \\]"
+ }
+ ]
+ },
{
"language": "Shell",
"markers": [
@@ -721,4 +744,4 @@
}
]
}
-]
\ No newline at end of file
+]
diff --git a/tests/test_closed.diff b/tests/test_closed.diff
index 19df3f3..134265b 100644
--- a/tests/test_closed.diff
+++ b/tests/test_closed.diff
@@ -240,6 +240,18 @@ 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.md b/src/tests/example_file.rmd
+index 525e25d..ba4e68d 100644
+--- a/src/tests/example_file.rmd
++++ b/src/tests/example_file.rmd
+@@ -1,7 +0,0 @@
+- {/* TODO: Hopefully this comment turns into a todo issue */}
+- {/*
+- TODO:Multiline comments
+- also need to be turned into todos, and hopefully
+- kept together as one todo
+- */}
+- - [ ] TODO: An inline todo that's NOT a comment (what)
diff --git a/tests/example_file.mdx b/src/tests/example_file.mdx
index 525e25d..ba4e68d 100644
--- a/src/tests/example_file.mdx
diff --git a/tests/test_new.diff b/tests/test_new.diff
index 74c6e4a..e957a6e 100644
--- a/tests/test_new.diff
+++ b/tests/test_new.diff
@@ -279,6 +279,19 @@ index 0000000..7cccc5b
+ kept together as one todo
+ */}
+ - [ ] TODO: An inline todo that's NOT a comment (what)
+diff --git a/tests/example_file.rmd b/src/tests/example_file.rmd
+new file mode 100644
+index 0000000..7cccc5b
+--- /dev/null
++++ b/src/tests/example_file.rmd
+@@ -0,0 +1,7 @@
++ {/* TODO: Hopefully this comment turns into a todo issue */}
++ {/*
++ TODO:Multiline comments
++ also need to be turned into todos, and hopefully
++ kept together as one todo
++ */}
++ - [ ] TODO: An inline todo that's NOT a comment (what)
diff --git a/tests/example_file.mdx b/src/tests/example_file.mdx
new file mode 100644
index 0000000..7cccc5b
@@ -388,4 +401,4 @@ index 0000000..a6c6cb0
+
+
+
-+
\ No newline at end of file
++
diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py
index c53f2d1..5ae7c4d 100644
--- a/tests/test_todo_parser.py
+++ b/tests/test_todo_parser.py
@@ -78,6 +78,9 @@ def test_twig_issues(self):
def test_md_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'markdown'), 6)
+ def test_rmd_issues(self):
+ self.assertEqual(count_issues_for_file_type(self.raw_issues, 'rmarkdown'), 6)
+
def test_r_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'r'), 2)
@@ -157,6 +160,9 @@ def test_twig_issues(self):
def test_md_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'markdown'), 6)
+
+ def test_rmd_issues(self):
+ self.assertEqual(count_issues_for_file_type(self.raw_issues, 'rmarkdown'), 6)
def test_r_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'r'), 2)
From 903c9cdf924cc0a71ef44bad8735889528811cd8 Mon Sep 17 00:00:00 2001
From: Max Brede <50902832+MBrede@users.noreply.github.com>
Date: Thu, 23 Mar 2023 14:22:28 +0100
Subject: [PATCH 2/5] added Rmd-Support, tests subsumised under md
---
syntax.json | 2 +-
tests/test_closed.diff | 36 ++++++++++++++++++++++++------------
tests/test_new.diff | 39 ++++++++++++++++++++++++++-------------
tests/test_todo_parser.py | 10 ++--------
4 files changed, 53 insertions(+), 34 deletions(-)
diff --git a/syntax.json b/syntax.json
index 27b101d..60ff4c0 100644
--- a/syntax.json
+++ b/syntax.json
@@ -430,7 +430,7 @@
]
},
{
- "language": "Rmarkdown",
+ "language": "RMarkdown",
"markers": [
{
"type": "block",
diff --git a/tests/test_closed.diff b/tests/test_closed.diff
index 134265b..17cc92d 100644
--- a/tests/test_closed.diff
+++ b/tests/test_closed.diff
@@ -240,18 +240,6 @@ 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.md b/src/tests/example_file.rmd
-index 525e25d..ba4e68d 100644
---- a/src/tests/example_file.rmd
-+++ b/src/tests/example_file.rmd
-@@ -1,7 +0,0 @@
-- {/* TODO: Hopefully this comment turns into a todo issue */}
-- {/*
-- TODO:Multiline comments
-- also need to be turned into todos, and hopefully
-- kept together as one todo
-- */}
-- - [ ] TODO: An inline todo that's NOT a comment (what)
diff --git a/tests/example_file.mdx b/src/tests/example_file.mdx
index 525e25d..ba4e68d 100644
--- a/src/tests/example_file.mdx
@@ -277,6 +265,30 @@ hello_world <- function() {
- # This function should probably do something more interesting
- # labels: help wanted
}
+diff --git a/tests/example_file.rmd b/src/tests/example_file.rmd
+index 525e25d..ba4e68d 100644
+--- a/src/tests/example_file.rmd
++++ b/src/tests/example_file.rmd
+@@ -1,7 +0,0 @@
+- {/* TODO: Hopefully this comment turns into a todo issue */}
+- {/*
+- TODO:Multiline comments
+- also need to be turned into todos, and hopefully
+- kept together as one todo
+- */}
+- - [ ] TODO: An inline todo that's NOT a comment (what)
+diff --git a/tests/example_file.qmd b/src/tests/example_file.qmd
+index 525e25d..ba4e68d 100644
+--- a/src/tests/example_file.qmd
++++ b/src/tests/example_file.qmd
+@@ -1,7 +0,0 @@
+- {/* TODO: Hopefully this comment turns into a todo issue */}
+- {/*
+- TODO:Multiline comments
+- also need to be turned into todos, and hopefully
+- kept together as one todo
+- */}
+- - [ ] TODO: An inline todo that's NOT a comment (what)
diff --git a/src/Swarm/Game/example.hs b/src/Swarm/Game/example.hs
index 525e25d..ba4e68d 100644
--- a/src/Swarm/Game/example.hs
diff --git a/tests/test_new.diff b/tests/test_new.diff
index e957a6e..785b298 100644
--- a/tests/test_new.diff
+++ b/tests/test_new.diff
@@ -279,19 +279,6 @@ index 0000000..7cccc5b
+ kept together as one todo
+ */}
+ - [ ] TODO: An inline todo that's NOT a comment (what)
-diff --git a/tests/example_file.rmd b/src/tests/example_file.rmd
-new file mode 100644
-index 0000000..7cccc5b
---- /dev/null
-+++ b/src/tests/example_file.rmd
-@@ -0,0 +1,7 @@
-+ {/* TODO: Hopefully this comment turns into a todo issue */}
-+ {/*
-+ TODO:Multiline comments
-+ also need to be turned into todos, and hopefully
-+ kept together as one todo
-+ */}
-+ - [ ] TODO: An inline todo that's NOT a comment (what)
diff --git a/tests/example_file.mdx b/src/tests/example_file.mdx
new file mode 100644
index 0000000..7cccc5b
@@ -319,6 +306,32 @@ index 0000000..525e25d
+ # This function should probably do something more interesting
+ # labels: help wanted
+}
+diff --git a/tests/example_file.rmd b/src/tests/example_file.rmd
+new file mode 100644
+index 0000000..525e25d
+--- /dev/null
++++ b/src/tests/example_file.rmd
+@@ -0,0 +1,7 @@
++ {/* TODO: Hopefully this comment turns into a todo issue */}
++ {/*
++ TODO:Multiline comments
++ also need to be turned into todos, and hopefully
++ kept together as one todo
++ */}
++ - [ ] TODO: An inline todo that's NOT a comment (what)
+diff --git a/tests/example_file.qmd b/src/tests/example_file.qmd
+new file mode 100644
+index 0000000..525e25d
+--- /dev/null
++++ b/src/tests/example_file.qmd
+@@ -0,0 +1,7 @@
++ {/* TODO: Hopefully this comment turns into a todo issue */}
++ {/*
++ TODO:Multiline comments
++ also need to be turned into todos, and hopefully
++ kept together as one todo
++ */}
++ - [ ] TODO: An inline todo that's NOT a comment (what)
diff --git a/tests/config.jsonc b/tests/config.jsonc
new file mode 100644
index 0000000..525e25d
diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py
index 5ae7c4d..f858a2e 100644
--- a/tests/test_todo_parser.py
+++ b/tests/test_todo_parser.py
@@ -76,10 +76,7 @@ def test_twig_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'twig'), 2)
def test_md_issues(self):
- self.assertEqual(count_issues_for_file_type(self.raw_issues, 'markdown'), 6)
-
- def test_rmd_issues(self):
- self.assertEqual(count_issues_for_file_type(self.raw_issues, 'rmarkdown'), 6)
+ self.assertEqual(count_issues_for_file_type(self.raw_issues, 'markdown'), 12)
def test_r_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'r'), 2)
@@ -159,10 +156,7 @@ def test_twig_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'twig'), 2)
def test_md_issues(self):
- self.assertEqual(count_issues_for_file_type(self.raw_issues, 'markdown'), 6)
-
- def test_rmd_issues(self):
- self.assertEqual(count_issues_for_file_type(self.raw_issues, 'rmarkdown'), 6)
+ self.assertEqual(count_issues_for_file_type(self.raw_issues, 'markdown'), 12)
def test_r_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'r'), 2)
From 228e74fe0e59c1db3894da03dac38b78f2ae8665 Mon Sep 17 00:00:00 2001
From: Max Brede <50902832+MBrede@users.noreply.github.com>
Date: Thu, 23 Mar 2023 14:34:50 +0100
Subject: [PATCH 3/5] Update test_new.diff
---
tests/test_new.diff | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/tests/test_new.diff b/tests/test_new.diff
index 785b298..5adfde7 100644
--- a/tests/test_new.diff
+++ b/tests/test_new.diff
@@ -312,26 +312,14 @@ index 0000000..525e25d
--- /dev/null
+++ b/src/tests/example_file.rmd
@@ -0,0 +1,7 @@
-+ {/* TODO: Hopefully this comment turns into a todo issue */}
-+ {/*
-+ TODO:Multiline comments
-+ also need to be turned into todos, and hopefully
-+ kept together as one todo
-+ */}
-+ - [ ] TODO: An inline todo that's NOT a comment (what)
++
diff --git a/tests/example_file.qmd b/src/tests/example_file.qmd
new file mode 100644
index 0000000..525e25d
--- /dev/null
+++ b/src/tests/example_file.qmd
@@ -0,0 +1,7 @@
-+ {/* TODO: Hopefully this comment turns into a todo issue */}
-+ {/*
-+ TODO:Multiline comments
-+ also need to be turned into todos, and hopefully
-+ kept together as one todo
-+ */}
-+ - [ ] TODO: An inline todo that's NOT a comment (what)
++
diff --git a/tests/config.jsonc b/tests/config.jsonc
new file mode 100644
index 0000000..525e25d
From 71745257079bffdc52281dbfaa8252ed6d2d63e3 Mon Sep 17 00:00:00 2001
From: Max Brede <50902832+MBrede@users.noreply.github.com>
Date: Thu, 23 Mar 2023 14:35:41 +0100
Subject: [PATCH 4/5] Update test_new.diff
---
tests/test_new.diff | 1 -
1 file changed, 1 deletion(-)
diff --git a/tests/test_new.diff b/tests/test_new.diff
index 5adfde7..7c9037e 100644
--- a/tests/test_new.diff
+++ b/tests/test_new.diff
@@ -319,7 +319,6 @@ index 0000000..525e25d
--- /dev/null
+++ b/src/tests/example_file.qmd
@@ -0,0 +1,7 @@
-+
diff --git a/tests/config.jsonc b/tests/config.jsonc
new file mode 100644
index 0000000..525e25d
From 4f20f4b489f3adc2a70c731f92e28fd3b1d26420 Mon Sep 17 00:00:00 2001
From: Max Brede <50902832+MBrede@users.noreply.github.com>
Date: Thu, 23 Mar 2023 14:44:16 +0100
Subject: [PATCH 5/5] Added Rmarkdown-support
---
syntax.json | 11 -----------
tests/test_closed.diff | 20 ++++----------------
tests/test_new.diff | 5 +++--
tests/test_todo_parser.py | 4 ++--
4 files changed, 9 insertions(+), 31 deletions(-)
diff --git a/syntax.json b/syntax.json
index 60ff4c0..978c116 100644
--- a/syntax.json
+++ b/syntax.json
@@ -438,17 +438,6 @@
"start": ""
}
- },
- {
- "type": "block",
- "pattern": {
- "start": "{/\\*",
- "end": "\\*/}"
- }
- },
- {
- "type": "line",
- "pattern": "- \\[ \\]"
}
]
},
diff --git a/tests/test_closed.diff b/tests/test_closed.diff
index 17cc92d..d3ee0fb 100644
--- a/tests/test_closed.diff
+++ b/tests/test_closed.diff
@@ -269,26 +269,14 @@ diff --git a/tests/example_file.rmd b/src/tests/example_file.rmd
index 525e25d..ba4e68d 100644
--- a/src/tests/example_file.rmd
+++ b/src/tests/example_file.rmd
-@@ -1,7 +0,0 @@
-- {/* TODO: Hopefully this comment turns into a todo issue */}
-- {/*
-- TODO:Multiline comments
-- also need to be turned into todos, and hopefully
-- kept together as one todo
-- */}
-- - [ ] TODO: An inline todo that's NOT a comment (what)
+@@ -0,1 +0,0 @@
+-
diff --git a/tests/example_file.qmd b/src/tests/example_file.qmd
index 525e25d..ba4e68d 100644
--- a/src/tests/example_file.qmd
+++ b/src/tests/example_file.qmd
-@@ -1,7 +0,0 @@
-- {/* TODO: Hopefully this comment turns into a todo issue */}
-- {/*
-- TODO:Multiline comments
-- also need to be turned into todos, and hopefully
-- kept together as one todo
-- */}
-- - [ ] TODO: An inline todo that's NOT a comment (what)
+@@ -0,1 +0,0 @@
+-
diff --git a/src/Swarm/Game/example.hs b/src/Swarm/Game/example.hs
index 525e25d..ba4e68d 100644
--- a/src/Swarm/Game/example.hs
diff --git a/tests/test_new.diff b/tests/test_new.diff
index 7c9037e..4dd93f9 100644
--- a/tests/test_new.diff
+++ b/tests/test_new.diff
@@ -311,14 +311,15 @@ new file mode 100644
index 0000000..525e25d
--- /dev/null
+++ b/src/tests/example_file.rmd
-@@ -0,0 +1,7 @@
+@@ -0,0 +0,1 @@
+
diff --git a/tests/example_file.qmd b/src/tests/example_file.qmd
new file mode 100644
index 0000000..525e25d
--- /dev/null
+++ b/src/tests/example_file.qmd
-@@ -0,0 +1,7 @@
+@@ -0,0 +0,1 @@
++
diff --git a/tests/config.jsonc b/tests/config.jsonc
new file mode 100644
index 0000000..525e25d
diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py
index f858a2e..0b0c1f8 100644
--- a/tests/test_todo_parser.py
+++ b/tests/test_todo_parser.py
@@ -76,7 +76,7 @@ def test_twig_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'twig'), 2)
def test_md_issues(self):
- self.assertEqual(count_issues_for_file_type(self.raw_issues, 'markdown'), 12)
+ self.assertEqual(count_issues_for_file_type(self.raw_issues, 'markdown'), 8)
def test_r_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'r'), 2)
@@ -156,7 +156,7 @@ def test_twig_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'twig'), 2)
def test_md_issues(self):
- self.assertEqual(count_issues_for_file_type(self.raw_issues, 'markdown'), 12)
+ self.assertEqual(count_issues_for_file_type(self.raw_issues, 'markdown'), 8)
def test_r_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'r'), 2)