From e356c2ed85321a85d7d72d096fb7cc2098bf84ac Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 18 Oct 2026 13:15:28 +0000 Subject: [PATCH] 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 Co-authored-by: silverwind --- internal/pkg/config/edit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/pkg/config/edit.go b/internal/pkg/config/edit.go index f65b6d32..9d2678d4 100644 --- a/internal/pkg/config/edit.go +++ b/internal/pkg/config/edit.go @@ -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)) }