feat: extend AI comment regex to match 'ai!' suffix

This commit is contained in:
Paul Gauthier 2024-12-01 08:11:07 -08:00 committed by Paul Gauthier (aider)
parent a8bae3fb01
commit a8f20196b2

View file

@ -63,6 +63,8 @@ def load_gitignores(gitignore_paths: list[Path]) -> Optional[PathSpec]:
class FileWatcher:
"""Watches source files for changes and AI comments"""
# ai make this regex also match comments that end with "ai!"!
# so this comment would match ai!
# Compiled regex pattern for AI comments
ai_comment_pattern = re.compile(r"(?:#|//) *(ai\b.*|ai)", re.IGNORECASE)