mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +00:00
refactor: use get_ai_comment method instead of direct regex matching
This commit is contained in:
parent
014aeccde6
commit
56aaa08224
1 changed files with 3 additions and 5 deletions
|
@ -102,12 +102,10 @@ class FileWatcher:
|
|||
|
||||
# Check if file contains AI markers
|
||||
try:
|
||||
#ai use self.ai_comments() instead!
|
||||
content = self.io.read_text(str(path_abs))
|
||||
res = bool(re.search(r"(?:#|//) *ai\b", content, re.IGNORECASE))
|
||||
comments = self.get_ai_comment(str(path_abs))
|
||||
if self.verbose:
|
||||
dump(res)
|
||||
return res
|
||||
dump(bool(comments))
|
||||
return bool(comments)
|
||||
except Exception as err:
|
||||
if self.verbose:
|
||||
print("error")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue