Skip to content

fix(hermes): detect sibling list-item indent when creating new cli block#520

Open
JirA44 wants to merge 1 commit into
colbymchenry:mainfrom
JirA44:fix/hermes-toolset-indent
Open

fix(hermes): detect sibling list-item indent when creating new cli block#520
JirA44 wants to merge 1 commit into
colbymchenry:mainfrom
JirA44:fix/hermes-toolset-indent

Conversation

@JirA44
Copy link
Copy Markdown

@JirA44 JirA44 commented May 28, 2026

Problem

When platform_toolsets already exists but has no cli: 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 the platform_toolsets range and returns their actual leading whitespace. The !cli fallback now uses this instead of hardcoded 4 spaces.

Test

Added regression test: platform_toolsets with 2-space sibling items but no cli: key — verifies new block matches existing indent and is idempotent. All 133 tests pass.

Fixes #507

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
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.

install --target hermes: upsertCodeGraphToolset hardcodes 4-space indent, corrupts YAML with mixed indentation

1 participant