Please add a basic formatter setting that can force and check for plain string values when it is safe, especially inside flow arrays. This would let users keep CLI args readable without quotes.
Problem
force_array_style: flow can produce flow arrays, but there is no way to require unquoted strings inside them. force_quote_style only chooses single or double quotes for nodes that are already quoted.
Example
Config:
formatter:
type: basic
force_array_style: flow
# proposed new option, name is up to you:
prefer_unquoted_strings: true
Input:
args: ["--output=line", "--minAlertLevel=error"]
Expected output:
args: [--output=line, --minAlertLevel=error]
Safety rules
Only remove quotes when:
- the output remains valid YAML
- the parsed value stays a string (do not change types)
So values like yes, no, on, off, null, numbers, etc should remain quoted.
Acceptance criteria
- With the option enabled, yamlfmt rewrites quoted strings to unquoted form when safe.
- When not safe, yamlfmt keeps quotes.
- The option works consistently alongside
force_array_style: flow.
Please add a
basicformatter setting that can force and check for plain string values when it is safe, especially inside flow arrays. This would let users keep CLI args readable without quotes.Problem
force_array_style: flowcan produce flow arrays, but there is no way to require unquoted strings inside them.force_quote_styleonly chooses single or double quotes for nodes that are already quoted.Example
Config:
Input:
Expected output:
Safety rules
Only remove quotes when:
So values like
yes,no,on,off,null, numbers, etc should remain quoted.Acceptance criteria
force_array_style: flow.