From 60031ecd290e052ea8e862cbee5d10f8ec3a0f9b Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 24 May 2023 19:09:05 -0700 Subject: [PATCH] fixed bug found by testing --- aider/repomap.py | 1 + tests/test_repomap.py | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/aider/repomap.py b/aider/repomap.py index abddf00c8..c4796b78b 100644 --- a/aider/repomap.py +++ b/aider/repomap.py @@ -112,6 +112,7 @@ class RepoMap: tags = [] for filename in filenames: if filename.endswith(".md") or filename.endswith(".json"): + tags.append(self.split_path(filename)) continue tags += self.get_tags(filename) if not tags: diff --git a/tests/test_repomap.py b/tests/test_repomap.py index 0032e048e..aa7e10b36 100644 --- a/tests/test_repomap.py +++ b/tests/test_repomap.py @@ -3,6 +3,7 @@ import tempfile import unittest from aider.repomap import RepoMap + class TestRepoMap(unittest.TestCase): def test_get_tags_map(self): # Create a temporary directory with sample files for testing @@ -25,8 +26,8 @@ class TestRepoMap(unittest.TestCase): # Check if the result contains the expected tags map self.assertIn("test_file1.py:", result) self.assertIn("test_file2.py:", result) - self.assertNotIn("test_file3.md:", result) - self.assertNotIn("test_file4.json:", result) + self.assertIn("test_file3.md:", result) + self.assertIn("test_file4.json:", result) def test_get_tags_map_with_identifiers(self): # Create a temporary directory with a sample Python file containing identifiers @@ -77,7 +78,10 @@ def my_function(arg1, arg2): # Check if the result contains each specific file in the expected tags map without ctags for file in test_files: - self.assertIn(f"{os.path.splitext(file)[0]}.{os.path.splitext(file)[1][1:]}:", result) + self.assertIn( + f"{os.path.splitext(file)[0]}.{os.path.splitext(file)[1][1:]}:", result + ) + if __name__ == "__main__": unittest.main()