roughed in .aiderignore

This commit is contained in:
Paul Gauthier 2023-10-18 10:26:43 -07:00
parent f8e30ad7a0
commit 9725b236a3
3 changed files with 11 additions and 6 deletions

View file

@ -1,8 +1,8 @@
import os
import pathspec
from pathlib import Path, PurePosixPath
import git
import pathspec
from aider import models, prompts, utils
from aider.sendchat import simple_send_with_retries
@ -196,14 +196,14 @@ class GitRepo:
for path in files
)
return res
return self.filter_ignored_files(res)
def filter_ignored_files(self, fnames):
if not self.aider_ignore_file:
return fnames
with open(self.aider_ignore_file, 'r') as f:
ignore_spec = pathspec.PathSpec.from_lines('gitwildmatch', f)
with open(self.aider_ignore_file, "r") as f:
ignore_spec = pathspec.PathSpec.from_lines("gitwildmatch", f)
return [fname for fname in fnames if not ignore_spec.match_file(fname)]