yq/pkg/yqlib/yaml.go
2025-07-14 16:26:26 +10:00

38 lines
1.1 KiB
Go

package yqlib
type YamlPreferences struct {
Indent int
ColorsEnabled bool
LeadingContentPreProcessing bool
PrintDocSeparators bool
UnwrapScalar bool
EvaluateTogether bool
FixMergeAnchorToSpec bool
}
func NewDefaultYamlPreferences() YamlPreferences {
return YamlPreferences{
Indent: 2,
ColorsEnabled: false,
LeadingContentPreProcessing: true,
PrintDocSeparators: true,
UnwrapScalar: true,
EvaluateTogether: false,
FixMergeAnchorToSpec: false,
}
}
func (p *YamlPreferences) Copy() YamlPreferences {
return YamlPreferences{
Indent: p.Indent,
ColorsEnabled: p.ColorsEnabled,
LeadingContentPreProcessing: p.LeadingContentPreProcessing,
PrintDocSeparators: p.PrintDocSeparators,
UnwrapScalar: p.UnwrapScalar,
EvaluateTogether: p.EvaluateTogether,
FixMergeAnchorToSpec: p.FixMergeAnchorToSpec,
}
}
var ConfiguredYamlPreferences = NewDefaultYamlPreferences()