fix: update check scripts regex and path resolution
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user