fix: discover all .gitignore files in project

Before this change only `.gitignore` files at the project root and its direct subdirectories where found.
This commit is contained in:
Gabriel Terwesten committed 2025-08-08 19:45:40 +02:00
1 parent b8daef9167
commit cffbb81036
1 file changed
+2 -1
+2 -1
View File
@@ -141,7 +141,8 @@ class GitignoreParser:
:return: List of absolute paths to .gitignore files
"""
return glob.glob(self.repo_root + "/.gitignore") + glob.glob(self.repo_root + "/**/.gitignore")
relative_paths = glob.glob("**/.gitignore", root_dir=self.repo_root, recursive=True)
return [os.path.join(self.repo_root, rel_path) for rel_path in relative_paths]
def _create_ignore_spec(self, gitignore_file_path: str) -> GitignoreSpec:
"""