From 76ef3ac3da44dfe73c3dc4ce41dabcafa41f25cc Mon Sep 17 00:00:00 2001 From: HappyOnigiri <253838257+NodeMeld@users.noreply.github.com> Date: Wed, 4 Mar 2026 09:56:08 +0900 Subject: [PATCH] fix: update check scripts regex and path resolution --- check_scripts/check_unused_css.py | 2 +- check_scripts/utils.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/check_scripts/check_unused_css.py b/check_scripts/check_unused_css.py index 1a38ddd..6ff2331 100644 --- a/check_scripts/check_unused_css.py +++ b/check_scripts/check_unused_css.py @@ -91,7 +91,7 @@ def get_referenced_classes(search_path: str) -> set[str]: # 4. Targeted extraction: search inside className usages # to properly handle class names inside complex template literals or conditionals for attr_match in re.finditer( - r'className\s*=\s*({(?:[^{}]|{(?:[^{}]|{[^{}]*})*})*}|["\'`][\s\S]*?["\'`])', content + r'className\s*=\s*({(?:[^{}]|{(?:[^{}]|{[^{}]*})*})*}|(["\'`])[\s\S]*?\2)', content ): attr_val = attr_match.group(1) for str_match in re.finditer(r'(["\'`])(.*?)\1', attr_val, flags=re.DOTALL): diff --git a/check_scripts/utils.py b/check_scripts/utils.py index d4a1943..0ec72a9 100644 --- a/check_scripts/utils.py +++ b/check_scripts/utils.py @@ -5,7 +5,8 @@ import sys def resolve_search_path() -> tuple[str, str, str]: """Resolves and validates the search directories, returning (base_dir, target_dir, search_path).""" target_dir = os.path.join("ui", "src") - base_dir = os.getcwd() + script_dir = os.path.dirname(os.path.abspath(__file__)) + base_dir = os.path.dirname(script_dir) search_path = os.path.join(base_dir, target_dir) if not os.path.exists(search_path):