From 18b8f9602afd34b7bdabc7586c8410010e9cec5f Mon Sep 17 00:00:00 2001 From: rxxsta <37952239+rxxsta@users.noreply.github.com> Date: Fri, 13 Dec 2024 23:14:39 -0600 Subject: [PATCH] Update category regex match in lint.py The "\$" in the regex string collides with Python's escape sequence in string literals. Changing the string literal into a raw string literal to treat backslashes as literal characters instead of trying to escape the next character. --- scripts/test/lint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test/lint.py b/scripts/test/lint.py index 09c140a0..f510313e 100644 --- a/scripts/test/lint.py +++ b/scripts/test/lint.py @@ -354,7 +354,7 @@ def check(self, path): # utf-8-sig ignores BOM file_content = open(path, "r", encoding="utf-8-sig").read() - match = re.search("\$category = ['\"](?P[\w &/]+)['\"]", file_content) + match = re.search(r"\$category = ['\"](?P[\w &/]+)['\"]", file_content) if not match or match.group("category") not in self.CATEGORIES: return True return False