mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
style: fix linting issues in watch.py
This commit is contained in:
parent
bb1b3fdca1
commit
78c20a8c25
1 changed files with 7 additions and 3 deletions
|
@ -59,6 +59,7 @@ def load_gitignores(gitignore_paths: list[Path]) -> Optional[PathSpec]:
|
||||||
|
|
||||||
return PathSpec.from_lines(GitWildMatchPattern, patterns) if patterns else None
|
return PathSpec.from_lines(GitWildMatchPattern, patterns) if patterns else None
|
||||||
|
|
||||||
|
|
||||||
class FileWatcher:
|
class FileWatcher:
|
||||||
"""Watches source files for changes and AI comments"""
|
"""Watches source files for changes and AI comments"""
|
||||||
|
|
||||||
|
@ -67,7 +68,7 @@ class FileWatcher:
|
||||||
self.io = coder.io
|
self.io = coder.io
|
||||||
self.encoding = encoding
|
self.encoding = encoding
|
||||||
self.root = Path(coder.root)
|
self.root = Path(coder.root)
|
||||||
self.verbose = verbose #or True
|
self.verbose = verbose # or True
|
||||||
self.stop_event = None
|
self.stop_event = None
|
||||||
self.watcher_thread = None
|
self.watcher_thread = None
|
||||||
self.changed_files = set()
|
self.changed_files = set()
|
||||||
|
@ -175,13 +176,16 @@ class FileWatcher:
|
||||||
has_bangs = any(
|
has_bangs = any(
|
||||||
comment.strip().endswith("!")
|
comment.strip().endswith("!")
|
||||||
for comments in self.changed_files.values()
|
for comments in self.changed_files.values()
|
||||||
if comments for comment in comments
|
if comments
|
||||||
|
for comment in comments
|
||||||
)
|
)
|
||||||
|
|
||||||
if not has_bangs:
|
if not has_bangs:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
res = "\n".join(comment for comments in self.changed_files.values() if comments for comment in comments)
|
res = "\n".join(
|
||||||
|
comment for comments in self.changed_files.values() if comments for comment in comments
|
||||||
|
)
|
||||||
res = """The "ai" comments below can be found in the code above.
|
res = """The "ai" comments below can be found in the code above.
|
||||||
They contain your instructions.
|
They contain your instructions.
|
||||||
Make the requested changes.
|
Make the requested changes.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue