{"record":{"id":"9bbe357f1caea151","repo":"subframe7536/maple-font","slug":"tag-with-suffix-must-be-in-built-in-tag-text","errorCode":null,"errorMessage":"tag with suffix `:` must be in {built_in_tag_text}, but '{text}' is not","messagePattern":"tag with suffix `:` must be in (.+?), but '(.+?)' is not","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"source/py/feature/calt/tag.py","lineNumber":229,"sourceCode":"        lookup_name = f\"custom_tag_{'_'.join(desc)}\"\n\n        result.append(\n            ast.Lookup(\n                name=lookup_name,\n                desc=source,\n                content=subst_list,\n            )\n        )\n\n    return result\n\n\ndef tag_suffix_colon(text_list: list[str]):\n    result = []\n    for text in text_list:\n        text = text.lower()\n        if text not in built_in_tag_text:\n            raise Exception(\n                f\"tag with suffix `:` must be in {built_in_tag_text}, but '{text}' is not\"\n            )\n\n        result.append(\n            ast.subst_liga(\n                source=f\"{text.upper()}:\",\n                target=f\"tag_{text}.liga\",\n                lookup_name=f\"{text}_colon\",\n            )\n        )\n    return result\n\n\ndef get_lookup(cls_var: ast.Clazz):\n    # Dict to map letter and class.\n    # Only letter that has uppercase variant will be added.\n    # {\"q\": ast.Clazz(\"BgQ\", [\"Q\", \"Q.cv01\"])}\n    bg_cls_dict = {}","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/subframe7536/maple-font/blob/c08fda97fef73d68c1755219852150770f6e6578/source/py/feature/calt/tag.py#L211-L247","documentation":"tag_suffix_colon() generates ligature substitutions for the 'TEXT:' colon-suffix tag style (e.g. 'TODO:' becoming a colored tag glyph). To keep the tag set finite, text must be one of the built-in tag names defined in built_in_tag_text (trace, debug, info, warn, error, fatal, todo, fixme, note, hack, mark, eror, warning); anything else raises Exception. Input is lowercased before the check, so case doesn't matter.","triggerScenarios":"Calling tag_suffix_colon(['perf']) or including 'perf:' in the colon-suffix tag config where 'perf' is not in built_in_tag_text.","commonSituations":"Configuring custom log-level tags like 'debug2' or domain tags like 'security' in editor/font config expecting any name to work; typos of built-in names; expecting parity with tag_upper-style custom lists.","solutions":["Use one of the built-in names: trace, debug, info, warn, error, fatal, todo, fixme, note, hack, mark, eror, warning.","Fix typos in your configured tag names (they are matched after lowercasing).","Use the [NAME] bracket style via tag_upper() instead, which silently skips unknown names — or better, only pass supported names there too.","Add your name to built_in_tag_text in source/py/feature/calt/tag.py:4 if you maintain a font build fork."],"exampleFix":"// before\ntag_suffix_colon(['perf'])\n// after\ntag_suffix_colon(['note'])  # or another built-in tag name","handlingStrategy":"validation","validationCode":"from source.py.feature.calt.tag import built_in_tag_text\n\ndef filter_built_in_tags(names):\n    invalid = [n for n in names if n.lower() not in built_in_tag_text]\n    if invalid:\n        raise ValueError(f'colon-suffix tags must be in {built_in_tag_text}, got {invalid}')\n    return names\n\ntag_suffix_colon(filter_built_in_tags(my_tags))","typeGuard":"def is_built_in_tag(name: str) -> bool:\n    return name.lower() in built_in_tag_text","tryCatchPattern":"try:\n    result = tag_suffix_colon(text_list)\nexcept Exception as e:\n    if 'tag with suffix' in str(e):\n        allowed = [t for t in text_list if is_built_in_tag(t)]\n        result = tag_suffix_colon(allowed) if allowed else []\n    else:\n        raise","preventionTips":["Keep the built_in_tag_text list visible in your font config tooling and validate against it.","Match is case-insensitive — prefer lowercase in config to avoid confusion.","For arbitrary custom names, use the [NAME] bracket style (tag_upper/tag_any) instead of the colon suffix."],"tags":["python","exception","built-in-tags","colon-suffix","ligature"],"backgroundTag":"unknown-tag-name","analyzedSha":"c08fda97fef73d68c1755219852150770f6e6578","analyzedAt":"2026-08-28T22:07:29.503Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}