From 7ed2b20a5a96d3c2c8c05e6ee71a6c86ea75d48e Mon Sep 17 00:00:00 2001 From: Atirna Date: Tue, 18 Aug 2026 02:14:37 +0530 Subject: [PATCH] fix(lint): allow CJK fallback stacks documented in output-spec.md (#75) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend lint-skin.py font allowlist with the Hiragino/Noto/Yu Gothic families from output-spec.md §4 and add adversarial tests including a Yu Gothic UI rejection case. Fixes #74 --- .claude-plugin/plugin.json | 2 +- .codex-plugin/plugin.json | 2 +- scripts/lint-skin.py | 4 ++++ scripts/test-lint-a11y.py | 43 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 2 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 14ff439..a40142f 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "diagram-design", "description": "Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, or DP security matrix diagrams as standalone HTML/SVG/PNG. Redraw .drawio/.drawio.png/.drawio.svg or Mermaid .mmd sources at a chosen size/detail; onboard brand tokens from a website; add semantic patterns, callouts, accessible motion, or sketchy/hand-drawn styling.", - "version": "2.4.0", + "version": "2.4.1", "author": { "name": "Cathryn Lavery", "url": "https://github.com/cathrynlavery" diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index d3c0828..afdeaa5 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "diagram-design", "description": "Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, or DP security matrix diagrams as standalone HTML/SVG/PNG. Redraw .drawio/.drawio.png/.drawio.svg or Mermaid .mmd sources at a chosen size/detail; onboard brand tokens from a website; add semantic patterns, callouts, accessible motion, or sketchy/hand-drawn styling.", - "version": "2.4.0", + "version": "2.4.1", "author": { "name": "Cathryn Lavery", "url": "https://github.com/cathrynlavery" diff --git a/scripts/lint-skin.py b/scripts/lint-skin.py index 0911fa9..874a90f 100644 --- a/scripts/lint-skin.py +++ b/scripts/lint-skin.py @@ -53,6 +53,10 @@ ALLOWED_FONTS = { "instrument serif", "geist", "geist mono", + "hiragino sans", + "noto sans jp", + "yu gothic", + "noto sans mono cjk jp", "system-ui", "sans-serif", "serif", diff --git a/scripts/test-lint-a11y.py b/scripts/test-lint-a11y.py index e85c523..45aa051 100644 --- a/scripts/test-lint-a11y.py +++ b/scripts/test-lint-a11y.py @@ -363,6 +363,49 @@ def main() -> int: "font-family: unsupported font family: Unapproved Sans", directory, ) + cjk_name_svg = VALID_SVG.replace("fixture-title", "cjk-name-stack-title").replace( + "fixture-desc", "cjk-name-stack-desc" + ) + require_pass( + "cjk-name-stack", + cjk_name_svg.replace( + "", + '認証サービス\n', + ), + directory, + ) + cjk_mono_svg = VALID_SVG.replace("fixture-title", "cjk-mono-stack-title").replace( + "fixture-desc", "cjk-mono-stack-desc" + ) + require_pass( + "cjk-mono-stack", + cjk_mono_svg.replace( + "", + '포트 443\n', + ), + directory, + ) + cjk_css_svg = VALID_SVG.replace("fixture-title", "cjk-css-stack-title").replace( + "fixture-desc", "cjk-css-stack-desc" + ) + require_pass( + "cjk-css-stack", + '\n' + cjk_css_svg, + directory, + ) + yu_gothic_ui_svg = VALID_SVG.replace( + "fixture-title", "yu-gothic-ui-title" + ).replace("fixture-desc", "yu-gothic-ui-desc") + require_lint_finding( + "yu-gothic-ui", + '\n' + + yu_gothic_ui_svg, + "font-family: unsupported font family: Yu Gothic UI", + directory, + ) spec = importlib.util.spec_from_file_location("build_icons", BUILD_ICONS) if spec is None or spec.loader is None: