From c9df6c11c5c20db8bb5f2d3662366856f414a86e Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sun, 1 Dec 2024 07:26:21 -0800 Subject: [PATCH] refactor: extract regex pattern into compiled class attribute --- aider/watch.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aider/watch.py b/aider/watch.py index 1821e2c40..52cd77448 100644 --- a/aider/watch.py +++ b/aider/watch.py @@ -205,6 +205,7 @@ class FileWatcher: try: content = self.io.read_text(filepath) for line in content.splitlines(): + #ai refactor the regex into self, compile it! if match := re.search(r"(?:#|//) *(ai\b.*|ai)", line, re.IGNORECASE): comment = match.group(0).strip() if comment: