Configure IntelliJ reformat for double curly braces in yaml

Viewed 185

YAML files sometimes contain templated values in double curly braces, e.g. when used by Helm to configure Kubernetes:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}
  namespace: {{ .Release.Namespace }}

The formatting as I have shown it is what I want, and what is standard in Helm files: a space within the inner pair of curly braces, but not between the two curly braces on each side.

Is it possible to configure IntelliJ to respect this formatting style? As far as I can tell, the options (under File > Settings > Editor > Code Style > YAML > Spaces) are either:

  • Within code braces YES, which would produce { { .Release.Name } }
  • Within code braces NO, which would produce {{.Release.Name}}
0 Answers
Related