From f1bb8b16fa12b5550d8aeff446d705202b21e069 Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 10 Sep 2024 10:33:22 -0500 Subject: [PATCH] fix: Make regex strings raw (#811) Regex strings should generally be raw as in "normal" strings, "\" signifies an escape. --- .../plugin_builder.py | 20 ++++++++-------- tools/plugin_builder.py | 24 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/templates/widget/{{ cookiecutter.python_project_name }}/plugin_builder.py b/templates/widget/{{ cookiecutter.python_project_name }}/plugin_builder.py index 8349153d5..8814eec66 100644 --- a/templates/widget/{{ cookiecutter.python_project_name }}/plugin_builder.py +++ b/templates/widget/{{ cookiecutter.python_project_name }}/plugin_builder.py @@ -17,22 +17,22 @@ # these are the patterns to watch for changes in this directory # if in editable mode, the builder will rerun when these files change REBUILD_REGEXES = [ - ".*\.py$", - ".*\.js$", - ".*\.ts$", - ".*\.tsx$", - ".*\.scss$", + r".*\.py$", + r".*\.js$", + r".*\.ts$", + r".*\.tsx$", + r".*\.scss$", ] # ignore these patterns in particular # prevents infinite loops when the builder is rerun IGNORE_REGEXES = [ - ".*/dist/.*", - ".*/build/.*", - ".*/node_modules/.*", - ".*/_js/.*", + r".*/dist/.*", + r".*/build/.*", + r".*/node_modules/.*", + r".*/_js/.*", # ignore hidden files and directories - ".*/\..*/.*", + r".*/\..*/.*", ] # the path where the python files are located relative to this script diff --git a/tools/plugin_builder.py b/tools/plugin_builder.py index 1a51ea16e..086cf9e21 100644 --- a/tools/plugin_builder.py +++ b/tools/plugin_builder.py @@ -20,24 +20,24 @@ # these are the patterns to watch for changes in the plugins directory # if in editable mode, the builder will rerun when these files change REBUILD_REGEXES = [ - ".*\.py$", - ".*\.js$", - ".*\.md$", - ".*\.svg$", - ".*\.ts$", - ".*\.tsx$", - ".*\.scss$", + r".*\.py$", + r".*\.js$", + r".*\.md$", + r".*\.svg$", + r".*\.ts$", + r".*\.tsx$", + r".*\.scss$", ] # ignore these patterns in particular # prevents infinite loops when the builder is rerun IGNORE_REGEXES = [ - ".*/dist/.*", - ".*/build/.*", - ".*/node_modules/.*", - ".*/_js/.*", + r".*/dist/.*", + r".*/build/.*", + r".*/node_modules/.*", + r".*/_js/.*", # ignore hidden files and directories - ".*/\..*/.*", + r".*/\..*/.*", ]