Skip to content

config.yaml loses its comments when a command writes it #525

Closed

Description

@cescox

Split out from #497.

On v0.25.4, skillshare target universal --mode copy --target-naming prefixed wrote the right values to config.yaml but dropped its comments, including marker comments a script of mine relies on (# BEGIN HUMAN-ONLY (generated) / # END HUMAN-ONLY). As confirmed in #497, this happens with every command that writes the config.

Expected: writing a key leaves the rest of the file unchanged, comments included.

Activity

  1. self-assigned this
    on Oct 11, 2026
  2. added
    bug
    on Oct 11, 2026
  3. runkids commented on Oct 11, 2026

    @runkids
    Owner

    Thanks for the clear report, and for testing the migration on your real setup first; that is what surfaced this.

    Fixed in v0.25.5. Every command that writes config.yaml (and registry.yaml) now keeps the comments it finds there: head comments, inline comments, and ones with odd spacing or no space after #. A comment on a key the command removes is kept too; it moves in front of the next key, or to the end of its section. Two things the write still normalizes, so you know what to expect: top-level section order and the blank lines between sections.

    Your # BEGIN HUMAN-ONLY (generated) / # END HUMAN-ONLY case is covered by a test and an end-to-end run of target --mode copy --target-naming prefixed. If anything in your file still comes out different, please reopen this with the before and after and I'll look at it right away.

  4. cescox commented on Oct 11, 2026

    @cescox
    Author

    Confirmed on v0.25.5: comments and our marker blocks survive skillshare target … --add-exclude. Thanks. One thing left: that command expands YAML anchors (include: *global) into separate lists, while plugin add keeps them.

  5. added a commit that references this issue on Oct 11, 2026
    551a154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions