handle and test for trailing whitespace after ai

This commit is contained in:
Paul Gauthier 2024-12-06 12:23:27 -08:00
parent cca4f894a8
commit 881527ddd0
3 changed files with 5 additions and 2 deletions

View file

@ -72,7 +72,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):
self.coder = coder