Skip to content

格式化与代码

YAML 格式化工具

免费的 YAML 格式化工具。规范缩进、解决模糊引用,并对齐 Kubernetes 清单、CI 配置以及其他 YAML 文件中的键。由 Prettier 提供支持,在浏览器中运行。

Runs in your browser
YAML formatter & validator
lines: 0chars: 0size: 0 B
YAML · UTF-8 · 2-space indent

编辑注

Understanding · YAML's two minds.

本深度章节目前仅有英文版本。上方的转换工具支持您的语言;长篇说明文章尚未翻译。

常见问题

Quick answers.

Does it handle anchors and aliases?

Yes — Prettier's YAML parser understands *anchors, &aliases, block scalars, flow-style sequences and maps, all of it. The output round-trips cleanly.

Will it change my values?

Only whitespace and quoting. If a value was ambiguous (like unquoted `yes` being coerced to boolean), it stays as-written — Prettier won't silently re-parse scalars.

Is this a linter?

No — it's a formatter. For lint rules (required keys, schema validation) use yamllint or a Kubernetes-specific linter.

Safe for Kubernetes manifests?

Yes — tested on Deployments, Services, ConfigMaps, Helm templates. Multi-document files (--- separators) round-trip cleanly.

大家也在搜索

相关工具

More in this room.

查看所有 格式化与代码