feat: Print changed file path and check before reading content

This commit is contained in:
Paul Gauthier 2025-04-25 07:58:51 -07:00 committed by Paul Gauthier (aider)
parent df1a0c5b8d
commit 591d294052

View file

@ -96,20 +96,20 @@ class FileWatcher:
rel_path = path_abs.relative_to(self.root)
if self.verbose:
dump(rel_path)
print("Changed", rel_path)
if self.gitignore_spec and self.gitignore_spec.match_file(
rel_path.as_posix() + ("/" if path_abs.is_dir() else "")
):
return False
if self.verbose:
dump("ok", rel_path)
# Check file size before reading content
if path_abs.is_file() and path_abs.stat().st_size > 1 * 1024 * 1024: # 1MB limit
return False
if self.verbose:
print("Checking", rel_path)
# Check if file contains AI markers
try:
comments, _, _ = self.get_ai_comments(str(path_abs))