Files
Willie ece7090b1b fix: write every YAML file with 2-space indentation
yaml.Marshal defaults to 4 spaces, and only the config package forced 2.
Saving a plugin re-encodes the whole config.yaml, so installing one
reindented a user's entire file; skill/agent frontmatter and
audit-rules.yaml were written with 4 spaces too.

Route all YAML writers (config, registry, plugins, MCP, frontmatter,
audit rules) through one utils.MarshalYAML so they cannot drift apart.
2026-09-21 16:54:13 +08:00

14 lines
309 B
Go

package utils
import "testing"
func TestMarshalYAML_TwoSpaceIndent(t *testing.T) {
got, err := MarshalYAML(map[string]any{"a": map[string]any{"b": []string{"c"}}})
if err != nil {
t.Fatal(err)
}
if want := "a:\n b:\n - c\n"; string(got) != want {
t.Errorf("got:\n%s\nwant:\n%s", got, want)
}
}