chore: tighten upkeep boundaries and static checks
tracker-policy-pr / check-pr (pull_request) Successful in 10s
test / integration-docker (pull_request) Successful in 19s
test / unit (pull_request) Successful in 53s
test / coverage (pull_request) Successful in 16s

This commit is contained in:
2026-07-26 06:42:03 +00:00
parent b8893d4c0c
commit 571ea4dbf0
7 changed files with 32 additions and 14 deletions
+6 -3
View File
@@ -21,9 +21,12 @@ class TestCliBackendBoundaries(unittest.TestCase):
for path in (ROOT / "bot_bottle" / "cli").rglob("*.py"):
tree = ast.parse(path.read_text(), filename=str(path))
for node in ast.walk(tree):
module = node.module if isinstance(node, ast.ImportFrom) else None
if module and module.startswith(forbidden):
violations.append(f"{path.relative_to(ROOT)}:{node.lineno}: {module}")
if isinstance(node, ast.ImportFrom):
module = node.module
if module and module.startswith(forbidden):
violations.append(
f"{path.relative_to(ROOT)}:{node.lineno}: {module}"
)
if isinstance(node, ast.Import):
violations.extend(
f"{path.relative_to(ROOT)}:{node.lineno}: {alias.name}"