fix(hermes): detect sibling list-item indent when creating new cli block#520
Open
JirA44 wants to merge 1 commit into
Open
fix(hermes): detect sibling list-item indent when creating new cli block#520JirA44 wants to merge 1 commit into
JirA44 wants to merge 1 commit into
Conversation
When platform_toolsets already exists but has no cli key, the previous code unconditionally used 4-space item indent, producing mixed indentation if sibling sections (discord, telegram, etc.) used the 2-space PyYAML-default style. Add detectItemIndent() to scan existing list items in the parent range and return their actual leading whitespace, then use that in the !cli fallback so the new block matches whatever style is already present. Fixes colbymchenry#507
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.
Problem
When
platform_toolsetsalready exists but has nocli:key, the installer hardcoded 4-space item indent, producing mixed indentation if sibling sections used PyYAML 2-space default style.Fix
Added
detectItemIndent()that scans existing list items within theplatform_toolsetsrange and returns their actual leading whitespace. The!clifallback now uses this instead of hardcoded 4 spaces.Test
Added regression test:
platform_toolsetswith 2-space sibling items but nocli:key — verifies new block matches existing indent and is idempotent. All 133 tests pass.Fixes #507