исправить: закрыть ревью сквозной корреляции
CI / Rust Checks (pull_request) Successful in 8m33s
CI / UI Checks (pull_request) Successful in 5s
CI / Frontend E2E (pull_request) Successful in 6m51s
CI / Community Image Smoke (pull_request) Failing after 9m10s
CI / Deploy (pull_request) Has been skipped

This commit is contained in:
2026-07-31 02:37:45 +03:00
parent 0e8f1ca03a
commit 9a7d60593a
28 changed files with 667 additions and 98 deletions
+13
View File
@@ -20,6 +20,11 @@ DEFAULT_EXCLUDED_PREFIXES = {
"apps/ui/dist/",
}
ALLOW_DIRECTIVE = re.compile(
r"community-scope:\s*allow=([a-z0-9-]+(?:,[a-z0-9-]+)*)",
re.IGNORECASE,
)
FORBIDDEN_PATTERNS = [
("enterprise", re.compile(r"\benterprise\b", re.IGNORECASE)),
("cloud", re.compile(r"\bcloud\b", re.IGNORECASE)),
@@ -100,7 +105,15 @@ def scan_file(root: Path, relative_path: str) -> list[str]:
text = data.decode("utf-8", errors="replace")
findings: list[str] = []
for line_no, line in enumerate(text.splitlines(), start=1):
directive = ALLOW_DIRECTIVE.search(line)
allowed_markers = (
{label.lower() for label in directive.group(1).split(",")}
if directive
else set()
)
for label, pattern in FORBIDDEN_PATTERNS:
if label in allowed_markers:
continue
if pattern.search(line):
findings.append(f"{relative_path}:{line_no}: forbidden marker `{label}`")
return findings