Skip to content

Feature: indent multi line block #22

Description

@JulesdeCube

Hello (and thank you for this tools),

The tools work well with "simple" template where block span only on one line but on multi line block helmfmt
align all line to the same indentation.

It will be great to indent block base on parentheses.

example:

Current behavior:

{{- if .enabled -}}
    {{- $deny := include "network.listByFamily" (dict
    "ctx" .
    "ipv4" (dict
    "enabled" $v4On
    "subnets" (concat ($ipv4.defaultDenylist | default list) ($ipv4.denylist | default list))
    )
    "ipv6" (dict
    "enabled" $v6On
    "subnets" (concat ($ipv6.defaultDenylist | default list) ($ipv6.denylist | default list))
    )
    )
    -}}
{{- end -}}

expected behavior:

{{- if .enabled -}}
    {{- $deny := include "network.listByFamily" (dict
        "ctx" .
        "ipv4" (dict
            "enabled" $v4On
            "subnets" (concat ($ipv4.defaultDenylist | default list) ($ipv4.denylist | default list))
        )
        "ipv6" (dict
            "enabled" $v6On
            "subnets" (concat ($ipv6.defaultDenylist | default list) ($ipv6.denylist | default list))
        )
    )
    -}}
{{- end -}}

Note: If you agree with this feature i will be willing to propose a PR for it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions