Kubernetes Style YAML Formatter for Visual Studio Code
A Visual Studio Code extension that provides format support for YAML language.
You find the right format extension if you come from DevOps world, e.g., Kubernetes, Ansible Playbooks or CI workflow like Github Actions and so on.
We all love Emojis, and yes, it has builtin support!
As a Kubernetes developer, aka YAML engineer, you deal with a lot of yaml files everyday. Take the k8s yaml for example:
- name: nginx
- containerPort: 80
As you see, the sequence style(
ports) in the k8s style yaml has no indent. Each time you play with kubectl, there is no indent. Not to mention some tool like kustomize requires you do that.
Unluckily, the builtin yaml format has its own option philosophy. It always does indent and resists to accept such a customization setting.
It's useless. I have to keep the style manually every time editing yaml files, or you will end up with a non-idiomatic one.
It's tedious. So I create this extension to make life easier. Now you can control which way you prefer and everyone is happy.
This extension contributes the following settings:
kubernetes-yaml-formatter.compactSequenceIndent: Enable compact sequence indent, i.e. no indent (default
--- at document start (default
It makes format yaml on save default to
true, you can disable it:
Thanks lupengpeng for the icon design. It's great!
Thanks the following projects:
Without them there wouldn't be this extension.
Throughout the process I learnt a lot and also made some contributions back to them.
Definitely welcome your patches and contributions!