Skip to content

Fix DuplicateChildError on indented ! section separators in IOS-XR (#231)#233

Merged
jtdub merged 2 commits intomasterfrom
fix/231-indented-bang-duplicate-child-error
Mar 20, 2026
Merged

Fix DuplicateChildError on indented ! section separators in IOS-XR (#231)#233
jtdub merged 2 commits intomasterfrom
fix/231-indented-bang-duplicate-child-error

Conversation

@jtdub
Copy link
Contributor

@jtdub jtdub commented Mar 20, 2026

Summary

  • Fixes DuplicateChildError raised when parsing IOS-XR configs containing indented ! section separators (e.g., !, !) introduced in v3.5.0
  • Root cause: the per_line_sub regex ^!\s*$ only matched bare ! at column 0; changed to ^\s*!\s*$ to match at any indentation level
  • Adds tests for the parse fix, remediation no-ops (running with ! separators vs intended without, intended with ! comment vs running without, differing comment text), and a parsing edge case (trailing comment with no following sibling)
  • Bumps version to 3.5.1

Test plan

  • poetry run pytest tests/test_driver_cisco_xr.py tests/test_xr_comments.py -v — all 31 tests pass
  • poetry run ./scripts/build.py lint-and-test — full lint + test suite passes with no issues

Closes #231

🤖 Generated with Claude Code

jtdub and others added 2 commits March 20, 2026 08:51
…loses #231)

Change the per_line_sub regex from ^!\s*$ to ^\s*!\s*$ so that bare !
lines at any indentation level are stripped during parsing, not just
column-0 ones. Add tests covering the parse fix, remediation no-ops, and
comment edge cases. Bump version to 3.5.1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jtdub jtdub merged commit c6eb929 into master Mar 20, 2026
5 checks passed
@jtdub jtdub deleted the fix/231-indented-bang-duplicate-child-error branch March 20, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DuplicateChildError on indented ! section separators in v3.5.0

1 participant