mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
roughed in .aiderignore
This commit is contained in:
parent
f8e30ad7a0
commit
9725b236a3
3 changed files with 11 additions and 6 deletions
|
@ -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)]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue