mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 16:25:00 +00:00
refactor: remove ignore_func parameter from FileWatcher.start()
This commit is contained in:
parent
2e63f62215
commit
27540d16ed
1 changed files with 3 additions and 10 deletions
|
@ -120,18 +120,11 @@ class FileWatcher:
|
|||
|
||||
return filter_func
|
||||
|
||||
# ai remove ignore_func!
|
||||
def start(self, ignore_func=None):
|
||||
def start(self):
|
||||
"""Start watching for file changes"""
|
||||
self.stop_event = threading.Event()
|
||||
self.changed_files = set()
|
||||
|
||||
# Update filter_func if ignore_func is provided
|
||||
if ignore_func:
|
||||
gitignore_paths = [Path(g) for g in self.gitignores] if self.gitignores else []
|
||||
gitignore_spec = load_gitignores(gitignore_paths)
|
||||
self.filter_func = self.create_filter_func(gitignore_spec, ignore_func)
|
||||
|
||||
def watch_files():
|
||||
try:
|
||||
for changes in watch(
|
||||
|
@ -240,9 +233,9 @@ def main():
|
|||
def ignore_test_files(path):
|
||||
return "test" in path.name.lower()
|
||||
|
||||
watcher = FileWatcher(directory)
|
||||
watcher = FileWatcher(directory, gitignores=args.gitignore)
|
||||
try:
|
||||
watcher.start(gitignores=args.gitignore, ignore_func=ignore_test_files)
|
||||
watcher.start()
|
||||
while True:
|
||||
if changes := watcher.get_changes():
|
||||
for file in sorted(changes.keys()):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue