kubernetes-yaml-formatter
kubernetes-yaml-formatter copied to clipboard
Question: how to apply it to helm-template files?
This is great, finally sane indent for list in Kubernetes / Ansible yaml files.
Just a question - how can I make it also work if file is recognized as helm-template?
I tried to set
"[helm-template]": {
"editor.defaultFormatter": "kennylong.kubernetes-yaml-formatter"
},
but VS Code still complains that "There is no formatter for 'helm' files installed.".
I did it in this way:
"[yaml]": {
"editor.defaultFormatter": "kennylong.kubernetes-yaml-formatter",
"editor.formatOnSave": true
},
"files.associations": {
"*.yml": "yaml",
"*.yaml": "yaml"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
Hi!
Sorry for the delay.
I use helm very often. But since helm is not really yaml but a template-engine we cannot format the mixed two directly.
However, for the template part you can use builtin function like indentn.
for the yaml part, the new v2 version has implemented a range format, so just select range code and the extension will format those region.
You can config with(which is the default value):
"[helm]": {
"editor.defaultFormatter": "kennylong.kubernetes-yaml-formatter",
"editor.formatOnSave": false
},
"[ansible]": {
"editor.defaultFormatter": "kennylong.kubernetes-yaml-formatter",
"editor.formatOnSave": false
}