Style presets

Presets are small, versioned JSON files: options only, never code. Compare two presets on the same source before you adopt one.

Available presets

Formatter 1.0.0 · yaml 2.9.1
NameWhat it doesKey optionsActions
StandardTwo-space indent, 80-column wrapping, quotes and collection styles kept as written.indent 2 · width 80 · quotes preserve · preserve · yaml-1.2-core
Whitespace onlyFixes indentation and spacing only. No wrapping, quoting or collection-style changes.indent 2 · width off · quotes preserve · preserve · yaml-1.2-core
Kubernetes manifestsConvention used by kubectl output: two spaces, sequences flush with their parent key, no wrapping. A formatting convention, not manifest validation.indent 2 flush-seq · width off · quotes preserve · block · yaml-1.2-core
GitHub Actions workflowsTwo spaces, indented sequences, block collections, YAML 1.1 hazards (on:, yes/no) kept quoted. A convention, not workflow validation.indent 2 · width off · quotes preserve · block · 1.1-guard · yaml-1.2-core
Ansible playbooksTwo spaces, explicit --- document start, legacy booleans quoted for YAML 1.1 loaders.indent 2 · width 160 · quotes preserve · preserve · 1.1-guard · yaml-1.2-core
Four-space indentFour spaces per level, 100-column wrapping.indent 4 · width 100 · quotes preserve · preserve · yaml-1.2-core
Double-quoted stringsQuotes every non-block string value with double quotes. Keys and block scalars are untouched.indent 2 · width 80 · quotes double · preserve · yaml-1.2-core
Plain strings when safeRemoves quotes only where the plain form still resolves to the same string, under YAML 1.2 and YAML 1.1.indent 2 · width 80 · quotes plain · preserve · 1.1-guard · yaml-1.2-core

Create or import a preset

Default. true/false/null/ints/floats resolve per YAML 1.2.2 core; yes/no/on/off and dates stay strings.

Compare two presets on the same source

Edit the sample source

Formatting with both presets…

Domain presets are conventions, not validation

The Kubernetes, GitHub Actions and Ansible presets follow common formatting conventions for those files. They do not check that a manifest or workflow is valid for its platform.

Exported presets record the formatter and parser versions. When you import one made by a different build, FormatYAML tells you that byte-identical output is not guaranteed.

Questions

Where are my presets stored?
In your browser’s IndexedDB. They are not synced; export them to share or back up.
Can a preset file run code?
No. Only known fields with valid values are accepted; anything else is rejected with a message.

Other tools