Fix markdown metadata propagation, silent pin drops, and mermaid keyword gaps#57
Merged
zcohen-nerd merged 2 commits intomainfrom Feb 27, 2026
Merged
Conversation
… dropped, missing communication keywords, add --version flag Co-authored-by: zcohen-nerd <61070171+zcohen-nerd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Analyze code for potential bugs and usability problems
Fix markdown metadata propagation, silent pin drops, and mermaid keyword gaps
Feb 27, 2026
There was a problem hiding this comment.
Pull request overview
This PR fixes three bugs in the emitter pipeline and adds a --version flag to the CLI. The bugs were causing incorrect output for TOML-defined MCU profiles and silently dropping pins with non-numeric names.
Changes:
- Fixed
emit_markdown.pyto passcanonical_dictto_get_special_function()so TOML profiles display correct special function metadata instead of "General Purpose I/O" - Fixed silent pin drops in both
emit_markdown.pyandemit_mermaid.pyby usingfloat("inf")as fallback sort key for pins without numeric characters - Added missing communication protocol keywords (SCK, TX, RX, CS, SS) to Mermaid grouping and styling functions
- Added
--versionflag to CLI displaying "0.1.0" from pyproject.toml
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tools/pinmapgen/emit_markdown.py | Fixed metadata propagation to _get_special_function() calls (line 85, 219) and added fallback sort key for non-numeric pins (line 218) |
| tools/pinmapgen/emit_mermaid.py | Added fallback sort key for non-numeric pins (line 108) and expanded communication keyword lists in two functions (lines 266-269, 329-332) |
| tools/pinmapgen/cli.py | Added --version argument displaying version "0.1.0" (lines 102-104) |
| tests/test_fixes_61_64.py | Added 12 regression tests covering all four issues (#61-#64) with proper test structure following codebase conventions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deep analysis of emitter pipeline revealed three bugs and one missing CLI feature.
Bug fixes
emit_markdown.py:canonical_dictnot passed to_get_special_function()in the special pins section and single-ended table — TOML-only profiles (nRF52840, ATmega328P, etc.) always showed "General Purpose I/O" instead of actual special function descriptionsemit_markdown.py/emit_mermaid.py: Pins with no numeric characters in their name silently dropped from output (guarded byif num_match:with no else branch). Usesfloat("inf")as fallback sort key so they sort last instead of vanishingemit_mermaid.py:_group_pins_by_function()and_get_node_style()missingSCK,TX,RX,CS,SSkeywords — standalone nets likeSCKmiscategorized as "Digital I/O" instead of "Communication"Enhancement
cli.py: Added--versionflagBefore/after (markdown special functions)
12 regression tests added in
test_fixes_61_64.py.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.