From 1a726726ab94477c19e5509f16562513c19f8072 Mon Sep 17 00:00:00 2001 From: alstr Date: Thu, 10 Apr 2025 14:53:23 +0100 Subject: [PATCH] Add Dockerfile support Original PR by @phyzical See #266 --- README.md | 1 + syntax.json | 9 +++++++++ tests/test_closed.diff | 10 ++++++++++ tests/test_new.diff | 13 +++++++++++++ tests/test_todo_parser.py | 6 ++++++ 5 files changed, 39 insertions(+) diff --git a/README.md b/README.md index d8a89a8..26c53aa 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ Only a single milestone can be specified. If the milestone does not exist, it wi - Clojure - Cuda - Dart +- Dockerfile - Elixir - GDScript - Go diff --git a/syntax.json b/syntax.json index 0b1ec1c..0e1c7cc 100644 --- a/syntax.json +++ b/syntax.json @@ -894,5 +894,14 @@ } } ] + }, + { + "language": "Dockerfile", + "markers": [ + { + "type": "line", + "pattern": "#" + } + ] } ] \ No newline at end of file diff --git a/tests/test_closed.diff b/tests/test_closed.diff index 88b50da..7785cf6 100644 --- a/tests/test_closed.diff +++ b/tests/test_closed.diff @@ -564,3 +564,13 @@ index 0000000..d340f6a - * labels: urgent - */ -} +diff --git a/src/Dockerfile b/src/Dockerfile +new file mode 100644 +index 0000000..d340f6a +--- a/src/Dockerfile ++++ b/src/Dockerfile +@@ -0,0 +1,4 @@ +-WORKDIR /app +-ENV PYTHONPATH /app +-# TODO: Update command +-CMD ["/app/main.py"] diff --git a/tests/test_new.diff b/tests/test_new.diff index fde2edb..4d4a980 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -563,6 +563,9 @@ index 0000000..d340f6a + * labels: urgent + */ +} +diff --git a/tests/package.move b/tests/package.move +new file mode 100644 +index 0000000..d340f6a --- /dev/null +++ b/package.move @@ -0,0 +1,20 @@ @@ -586,3 +589,13 @@ index 0000000..d340f6a + * labels: urgent + */ +} +diff --git a/src/Dockerfile b/src/Dockerfile +new file mode 100644 +index 0000000..d340f6a +--- /dev/null ++++ b/Dockerfile +@@ -0,0 +1,4 @@ ++WORKDIR /app ++ENV PYTHONPATH /app ++# TODO: Update command ++CMD ["/app/main.py"] diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index 0733ecd..daabf10 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -128,6 +128,9 @@ class NewIssueTest(unittest.TestCase): def test_lua_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'lua'), 2) + def test_dockerfile_issues(self): + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'dockerfile'), 1) + class CustomOptionsTest(unittest.TestCase): def setUp(self): parser = TodoParser(options={"identifiers": @@ -304,6 +307,9 @@ class ClosedIssueTest(unittest.TestCase): def test_lua_issues(self): self.assertEqual(count_issues_for_file_type(self.raw_issues, 'lua'), 2) + def test_dockerfile_issues(self): + self.assertEqual(count_issues_for_file_type(self.raw_issues, 'dockerfile'), 1) + class IgnorePatternTest(unittest.TestCase): def test_single_ignore(self): os.environ['INPUT_IGNORE'] = '.*\\.java'