From de829edf0c606f0959a2a40fc3697b0ad1a6717c Mon Sep 17 00:00:00 2001 From: Walker Date: Wed, 21 Dec 2022 14:46:54 -0300 Subject: [PATCH] Add Nix support --- README.md | 1 + syntax.json | 16 ++++++++++++++++ tests/test_closed.diff | 16 ++++++++++++++++ tests/test_new.diff | 17 +++++++++++++++++ tests/test_todo_parser.py | 5 +++++ 5 files changed, 55 insertions(+) diff --git a/README.md b/README.md index 60d7998..9aba356 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ jobs: - Kotlin - Less - Markdown +- Nix - Objective-C - Org Mode - PHP diff --git a/syntax.json b/syntax.json index 3d8848d..c9016db 100644 --- a/syntax.json +++ b/syntax.json @@ -658,5 +658,21 @@ "pattern": ";;" } ] + }, + { + "language": "Nix", + "markers": [ + { + "type": "line", + "pattern": "#" + }, + { + "type": "block", + "pattern": { + "start": "/\\*", + "end": "\\*/" + } + } + ] } ] diff --git a/tests/test_closed.diff b/tests/test_closed.diff index b8494b4..735e347 100644 --- a/tests/test_closed.diff +++ b/tests/test_closed.diff @@ -297,3 +297,19 @@ index 0000000..525e25d 100644 - ;; TODO: todo with description (sub-level) - ;; Body of the issue should stay here - (str "hello" name)) +diff --git a/tests/example.nix b/tests/example.nix +index a6c6cb0..25d195f 100644 +--- a/tests/example.nix ++++ b/tests/example.nix +@@ -1,11 +1,7 @@ + { +- # TODO add missing devices + stdDeviceList = [ + "treads" + "grabber" + ]; +- /* +- TODO add missing c +- */ + sum = a: b: a + b; + } diff --git a/tests/test_new.diff b/tests/test_new.diff index dda3bc4..4e250c6 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -320,3 +320,20 @@ index 0000000..525e25d + ;; TODO: todo with description (sub-level) + ;; Body of the issue should stay here + (str "hello" name)) +diff --git a/tests/example.nix b/tests/example.nix +new file mode 100644 +index 0000000..a6c6cb0 +--- /dev/null ++++ b/tests/example.nix +@@ -0,0 +1,11 @@ ++{ ++ # TODO add missing devices ++ stdDeviceList = [ ++ "treads" ++ "grabber" ++ ]; ++ /* ++ TODO add missing c ++ */ ++ sum = a: b: a + b; ++} diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index 837efaf..94ab65a 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -79,6 +79,8 @@ class NewIssueTests(unittest.TestCase): def test_clojure_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'clojure'), 2) + def test_nix_issues(self): + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'nix'), 2) class ClosedIssueTests(unittest.TestCase): # Check for removed TODOs across the files specified. @@ -147,6 +149,9 @@ class ClosedIssueTests(unittest.TestCase): def test_clojure_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'clojure'), 2) + def test_nix_issues(self): + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'nix'), 2) + class IgnorePatternTests(unittest.TestCase):