mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-14 11:53:42 +00:00
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 <[email protected]> Co-authored-by: silverwind <[email protected]>
This commit is contained in:
1 parent
ed940db4f0
commit
e356c2ed85
1 file changed
+1
-1
@@ -312,7 +312,7 @@ func allScalars(nodes []*yaml.Node) bool {
|
|||||||
return true
|
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) {
|
func encodeYAML(node *yaml.Node) ([]byte, error) {
|
||||||
return yaml.Dump(node, yaml.WithV3Defaults(), yaml.WithIndent(2), yaml.WithLineWidth(-1))
|
return yaml.Dump(node, yaml.WithV3Defaults(), yaml.WithIndent(2), yaml.WithLineWidth(-1))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user