mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
style: Format code and fix whitespace issues
This commit is contained in:
parent
5c9746e209
commit
b5d17b99df
2 changed files with 15 additions and 18 deletions
|
@ -140,9 +140,7 @@ class FileWatcher:
|
|||
roots_to_watch = self.get_roots_to_watch()
|
||||
|
||||
for changes in watch(
|
||||
*roots_to_watch,
|
||||
watch_filter=self.filter_func,
|
||||
stop_event=self.stop_event
|
||||
*roots_to_watch, watch_filter=self.filter_func, stop_event=self.stop_event
|
||||
):
|
||||
if self.handle_changes(changes):
|
||||
return
|
||||
|
@ -157,10 +155,7 @@ class FileWatcher:
|
|||
self.stop_event = threading.Event()
|
||||
self.changed_files = set()
|
||||
|
||||
self.watcher_thread = threading.Thread(
|
||||
target=self.watch_files,
|
||||
daemon=True
|
||||
)
|
||||
self.watcher_thread = threading.Thread(target=self.watch_files, daemon=True)
|
||||
self.watcher_thread.start()
|
||||
|
||||
def stop(self):
|
||||
|
|
|
@ -83,6 +83,7 @@ def test_get_roots_to_watch(tmp_path):
|
|||
assert len(roots) == 1
|
||||
assert Path(roots[0]).name == "included"
|
||||
|
||||
|
||||
def test_handle_changes():
|
||||
io = InputOutput(pretty=False, fancy_input=False, yes=False)
|
||||
coder = MinimalCoder(io)
|
||||
|
@ -93,10 +94,11 @@ def test_handle_changes():
|
|||
assert len(watcher.changed_files) == 0
|
||||
|
||||
# Test with changes
|
||||
changes = [('modified', '/path/to/file.py')]
|
||||
changes = [("modified", "/path/to/file.py")]
|
||||
assert watcher.handle_changes(changes)
|
||||
assert len(watcher.changed_files) == 1
|
||||
assert str(Path('/path/to/file.py')) in watcher.changed_files
|
||||
assert str(Path("/path/to/file.py")) in watcher.changed_files
|
||||
|
||||
|
||||
def test_ai_comment_pattern():
|
||||
# Create minimal IO and Coder instances for testing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue