blob: f216ff75e1f5dcd8751916c98ca0021fd8729cfa [file]
"""Shared normalization for checked-in golden files."""
# Canonical bzlmod repo separators changed from ~~/~ (Bazel 7) to ++/+ (Bazel 8+), so a
# golden that names one has to be rewritten to match whichever Bazel is running.
REPO_SEPARATOR_NORMALIZE = (
"sed -E -e 's/~~/++/g'" +
" -e 's|([+][+][^/~]+)~([^/~]+)~([^/~]+)|\\1+\\2+\\3|g'" +
" -e 's|([+][+][^/~]+)~([^/~]+)|\\1+\\2|g'"
)