chore(config): update stale go-yaml wrapping comment (#1324)

https://github.com/yaml/go-yaml/pull/441 fixed the wrapping bug this comment waited for, so reword it. `WithLineWidth(-1)` stays, `config edit` re-encodes the whole file and wrapping would reflow every long value.

Gitea: https://github.com/go-gitea/gitea/pull/39844

This PR was written with Claude.
Reviewed-on: https://gitea.com/gitea/runner/pulls/1324
Reviewed-by: bircni <bircni@icloud.com>
Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
silverwind
2026-10-18 13:15:28 +00:00
committed by bircni
parent ed940db4f0
commit e356c2ed85

View File

@@ -312,7 +312,7 @@ func allScalars(nodes []*yaml.Node) bool {
return true
}
// encodeYAML never wraps lines, go-yaml wraps more-indented lines of folded scalars until https://github.com/yaml/go-yaml/pull/441 is released.
// encodeYAML never wraps lines, re-encoding must not reflow long values.
func encodeYAML(node *yaml.Node) ([]byte, error) {
return yaml.Dump(node, yaml.WithV3Defaults(), yaml.WithIndent(2), yaml.WithLineWidth(-1))
}