Repository navigation
Config: Always produce loadable YAML when mutating .herb.yml - #2034
Merged
Merged
Conversation
marcoroth
enabled auto-merge (squash)
August 6, 2026 00:31
marcoroth
added a commit
that referenced
this pull request
Aug 6, 2026
This pull request makes the commands that write to `.herb.yml` report when the value they changed is aliased elsewhere in the file. Based on #2034, which stops mutations from writing invalid YAML. This one covers the case where the write succeeds and the file stays valid, but changes more than the user asked for. #### The problem Writing to a value that carries an anchor also changes every key aliasing it: ```yaml version: 0.10.3 linter: enabled: &flag true formatter: enabled: *flag ``` Running "Disable Herb Linter" in VS Code writes `enabled: &flag false`, which disables the formatter too. The file is valid and the result is what the alias asks for, so the behaviour is left alone. The problem was that nothing said so, and the effect is invisible unless you reread the config. Related #1632
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.
This pull request fixes two ways
herb-configcould write a.herb.ymlthat no longer loads, and adds a guard so it cannot happen again.Found while working on #1632, which enables YAML anchors and aliases in
.herb.yml. Now that anchors are supported, configs using them flow into the mutation path for the first time, and Yerba has no anchor or alias handling.Related #1632