From d66143acd10aecae21da864b87eb628cc9368a4d Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Wed, 29 Apr 2026 11:29:25 -0700 Subject: [PATCH] codex: address PR review feedback (#20179) --- .github/scripts/verify_tui_core_boundary.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/scripts/verify_tui_core_boundary.py b/.github/scripts/verify_tui_core_boundary.py index 7c7dd83b10..4b101dfcd7 100644 --- a/.github/scripts/verify_tui_core_boundary.py +++ b/.github/scripts/verify_tui_core_boundary.py @@ -473,7 +473,7 @@ def use_tree_alias_pairs(tree: str) -> list[tuple[str, str]]: if source == "self": pairs.append((group_source, alias)) else: - pairs.append((f"{group_source}::{source}", alias)) + pairs.append((join_paths(group_source, source), alias)) return pairs @@ -539,6 +539,8 @@ def grouped_use_tree(tree: str) -> tuple[str, str, int] | None: def root_braced_body(tree: str) -> tuple[str, int] | None: tree = tree.strip() + if tree.startswith("::"): + tree = tree[2:].strip() if not tree.startswith("{"): return None close_index = matching_brace_index(tree, 0) @@ -610,6 +612,14 @@ def item_alias(item: str) -> tuple[str, str | None]: return normalize_path(match.group(1)), normalize_identifier(match.group(2)) +def join_paths(prefix: str, suffix: str) -> str: + if not prefix: + return suffix + if not suffix: + return prefix + return f"{prefix}::{suffix}" + + def item_without_alias(item: str) -> str: return re.split(rf"\b{REQUIRED_TOKEN_SEPARATOR}as{REQUIRED_TOKEN_SEPARATOR}\b", item, 1)[ 0