mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 19:24:59 +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
|
# Check if file contains AI markers
|
||||||
try:
|
try:
|
||||||
#ai use self.ai_comments() instead!
|
comments = self.get_ai_comment(str(path_abs))
|
||||||
content = self.io.read_text(str(path_abs))
|
|
||||||
res = bool(re.search(r"(?:#|//) *ai\b", content, re.IGNORECASE))
|
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
dump(res)
|
dump(bool(comments))
|
||||||
return res
|
return bool(comments)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
print("error")
|
print("error")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue