style: remove most right whitespace chomps except those directly following a template definition

This commit is contained in:
Chi-En Wu
2020-04-27 10:27:26 +08:00
parent dd6822704c
commit a0bfeb4cf6
17 changed files with 195 additions and 195 deletions

View File

@ -1,24 +1,24 @@
{{/* vim: set filetype=mustache: */}}
{{- /*
{{/*
Merge one or more YAML templates and output the result.
This takes an list of values:
- the top context
- [optional] zero or more template args
- [optional] the template name of the overrides (destination)
- the template name of the base (source)
*/ -}}
*/}}
{{- define "common.utils.merge" -}}
{{- $top := first . -}}
{{- $tplName := last . -}}
{{- $args := initial . -}}
{{- if typeIs "string" (last $args) -}}
{{- $overridesName := last $args -}}
{{- $args = initial $args -}}
{{- $tpl := fromYaml (include $tplName $args) | default (dict) -}}
{{- $overrides := fromYaml (include $overridesName $args) | default (dict) -}}
{{- toYaml (merge $overrides $tpl) -}}
{{- else -}}
{{- include $tplName $args -}}
{{- end -}}
{{- end -}}
{{- $top := first . }}
{{- $tplName := last . }}
{{- $args := initial . }}
{{- if typeIs "string" (last $args) }}
{{- $overridesName := last $args }}
{{- $args = initial $args }}
{{- $tpl := fromYaml (include $tplName $args) | default (dict) }}
{{- $overrides := fromYaml (include $overridesName $args) | default (dict) }}
{{- toYaml (merge $overrides $tpl) }}
{{- else }}
{{- include $tplName $args }}
{{- end }}
{{- end }}