doxyfile.py

clew/guard/doxyfile.py

Doxyfile fragment generation.

build_fragment

str clew.guard.doxyfile.build_fragment(dict[str, Any] config)

Build the Doxyfile fragment for the given config.

clew/guard/doxyfile.py:97

Source · 28 lines
def build_fragment(config: dict[str, Any]) -> str:
    lines = [_HEADER, "# Tags clew guard defines that doxygen does not."]

    for tag in tool_tags_for(config):
        if tag in EXEMPTION_TAGS:
            lines.append(f"# @{tag}: exemption marker, no rendered output")
            lines.append(_marker_alias(tag))
        else:
            title = _TAG_TITLES.get(tag, tag.replace("_", " ").title())
            lines.append(_xref_alias(tag, title, f"{title} Index"))

    lines.append("")
    lines.append("# Validity: is the comment well-formed doxygen.")
    for key, value, why in _WARNINGS:
        lines.append(f"# {why}")
        lines.append(f"{key} = {value}")

    lines.append("")
    lines.append("# Policy, not validity — stricter than clew guard. Opt in if you want it.")
    for key, why in _OPTIONAL_WARNINGS:
        lines.append(f"# {key} = YES   # {why}")

    lines.append("")
    lines.append("# Exemption markers must not hide the rest of the block.")
    lines.append("INTERNAL_DOCS = YES")

    logger.info("Generated Doxyfile fragment for %d tool-owned tag(s)", len(tool_tags_for(config)))
    return "\n".join(lines) + "\n"

1 more lines, not shown

Activity · 22 steps
lines 98–98lines = [_HEADER, "# Tags clew guard defines that doxygen does not."]lines 100–100◇ for tag in tool_tags_for(config)lines 101–101◇ if tag in EXEMPTION_TAGSlines 102–102lines.append(f"# @{tag}: exemption marker, no rendered output")lines 103–103lines.append(_marker_alias(tag))lines 104–104elselines 105–105title = _TAG_TITLES.get(tag, tag.replace("_", " ").title())lines 106–106lines.append(_xref_alias(tag, title, f"{title} Index"))lines 108–108lines.append("")lines 109–109lines.append("# Validity: is the comment well-formed doxygen.")lines 110–110◇ for key, value, why in _WARNINGSlines 111–111lines.append(f"# {why}")lines 112–112lines.append(f"{key} = {value}")lines 114–114lines.append("")lines 115–115lines.append("# Policy, not validity — stricter than clew guard. Opt in if you want it.")lines 116–116◇ for key, why in _OPTIONAL_WARNINGSlines 117–117lines.append(f"# {key} = YES # {why}")lines 119–119lines.append("")lines 120–120lines.append("# Exemption markers must not hide the rest of the block.")lines 121–121lines.append("INTERNAL_DOCS = YES")lines 123–123logger.info("Generated Doxyfile fragment for %d tool-owned tag(s)", len(tool_tags_for(config)))lines 124–124return "\n".join(lines) + "\n"

Requirements

REQ-DDB-GUARD-017

Flows

tool_tags_for

list[str] clew.guard.doxyfile.tool_tags_for(dict[str, Any] config)

Collect the tool-owned tags that need declaring for a given config.

clew/guard/doxyfile.py:79

Source · 13 lines
def tool_tags_for(config: dict[str, Any]) -> list[str]:
    validate = get_validate(config)
    tags = set(TOOL_OWNED_TAGS)
    tags.update(validate.get("tags", {}).keys())
    tags.update(str(t).lstrip("@") for t in validate.get("extra_tags", []))

    version_tag = str(validate.get("version", {}).get("tag", "@version")).lstrip("@")
    if version_tag != "version":
        tags.add(version_tag)
    # brief/version/return and friends are real doxygen commands; never alias those.
    return sorted(tags - {"brief", "version", "return", "returns", "file", "param"})

Activity · 8 steps
lines 80–80validate = get_validate(config)lines 81–81tags = set(TOOL_OWNED_TAGS)lines 82–82tags.update(validate.get("tags", {}).keys())lines 83–83tags.update(str(t).lstrip("@") for t in validate.get("extra_tags", []))lines 85–85version_tag = str(validate.get("version", {}).get("tag", "@version")).lstrip("@")lines 86–86◇ if version_tag != "version"lines 87–87tags.add(version_tag)lines 89–89return sorted(tags - {"brief", "version", "return", "returns", "file", "param"})

Requirements

REQ-DDB-GUARD-017