mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 08:14:59 +00:00
fix: improve AI comment detection with case-insensitive matching
This commit is contained in:
parent
5b2bd90071
commit
fb005dd01b
1 changed files with 4 additions and 3 deletions
|
@ -11,7 +11,6 @@ from watchfiles import watch
|
|||
from aider.dump import dump # noqa
|
||||
|
||||
|
||||
# ai
|
||||
def is_source_file(path: Path) -> bool:
|
||||
"""
|
||||
Check if a file is a source file that uses # or // style comments.
|
||||
|
@ -226,8 +225,10 @@ Be sure to remove all these "ai" comments from the code!
|
|||
if comment:
|
||||
line_nums.append(i)
|
||||
comments.append(comment)
|
||||
# Use the ai regex, but ensure it's "ai!" ... AI!
|
||||
if comment.strip().endswith("!"):
|
||||
comment = comment.lower()
|
||||
comment = comment.lstrip("/#-")
|
||||
comment = comment.strip()
|
||||
if comment.startswith("ai!") or comment.endswith("ai!"):
|
||||
has_bang = True
|
||||
if not line_nums:
|
||||
return None, None, False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue