From 9eb938fd6f5ef8671ebfc0cea00a6b4110a35ba0 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 11 Dec 2024 20:28:03 -0800 Subject: [PATCH] feat: Expand gitignore patterns to include editor temp files --- aider/watch.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/aider/watch.py b/aider/watch.py index 2b35384d6..dff865e8c 100644 --- a/aider/watch.py +++ b/aider/watch.py @@ -70,8 +70,24 @@ def load_gitignores(gitignore_paths: list[Path]) -> Optional[PathSpec]: if not gitignore_paths: return None - # expand this set of patterns to include all manner of text editor temp files like .bak, ...~, etc ai! - patterns = [".aider*", ".git"] # Always ignore + patterns = [ + ".aider*", + ".git", + # Common editor backup/temp files + "*~", # Emacs/vim backup + "*.bak", # Generic backup + "*.swp", # Vim swap + "*.swo", # Vim swap + "#*#", # Emacs auto-save + ".#*", # Emacs lock files + "*.tmp", # Generic temp files + "*.temp", # Generic temp files + "*.orig", # Merge conflict originals + "*.pyc", # Python bytecode + "__pycache__/", # Python cache dir + ".DS_Store", # macOS metadata + "Thumbs.db", # Windows thumbnail cache + ] # Always ignore for path in gitignore_paths: if path.exists(): with open(path) as f: