refactor: simplify gitignore filter function creation

This commit is contained in:
Paul Gauthier 2024-12-01 08:08:54 -08:00 committed by Paul Gauthier (aider)
parent b1dbf340b8
commit aa6d9779d3

View file

@ -76,7 +76,7 @@ class FileWatcher:
self.changed_files = set() self.changed_files = set()
self.gitignores = gitignores self.gitignores = gitignores
# Create filter function during initialization #ai stop making this so indirect; just `def filter_func()` and use self.gitignores in it!
gitignore_paths = [Path(g) for g in self.gitignores] if self.gitignores else [] gitignore_paths = [Path(g) for g in self.gitignores] if self.gitignores else []
gitignore_spec = load_gitignores(gitignore_paths) gitignore_spec = load_gitignores(gitignore_paths)
self.filter_func = self.create_filter_func(gitignore_spec, None) self.filter_func = self.create_filter_func(gitignore_spec, None)