INNER CODE UNIT · Python

parse_rules

MinaProtocol/mina · maintenance/deps/main.py:119

def parse_rules(raw: Any, key: str, *, required: bool) -> list[LayeringRule]:
    """The rules under `key`.

    `required` is what stops this gate from passing green when it is not
    actually enforcing anything: a missing file, or a `forbidden` key lost to a
    rename, would otherwise yield an empty rule list and a cheerful
    "0 layering rule(s) held".
    """
    if raw is None:
        if required:
            raise DepsError(
                ErrorCode.RULES_MISSING,
                f"{RULES_PATH} is missing; layering rules cannot be enforced",
                path=RULES_PATH,
            )
        return []
    if not isinstance(raw, dict) or (required and key not in raw):
        raise DepsError(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…