fix: Correct ai comment regex to match ai? and ai!

This commit is contained in:
Paul Gauthier 2024-12-11 20:16:09 -08:00 committed by Paul Gauthier (aider)
parent a6ee3ce07f
commit 96086f12c6

View file

@ -83,7 +83,7 @@ class FileWatcher:
"""Watches source files for changes and AI comments"""
# Compiled regex pattern for AI comments
ai_comment_pattern = re.compile(r"(?:#|//|--) *(ai\b.*|ai\b.*|.*\bai!?) *$", re.IGNORECASE)
ai_comment_pattern = re.compile(r"(?:#|//|--) *(ai\b.*|ai\b.*|.*\bai[?!]?) *$", re.IGNORECASE)
def __init__(self, coder, gitignores=None, verbose=False, analytics=None):
self.coder = coder