Skip to content

Consider adding one more indentation after if #490

Open
@ahakanbaba

Description

@ahakanbaba

Please consider the following different ways of writing if

{
    replicas: {
        build: if isCanary then 0
        else 1,

        dev: if isCanary then
            0
        else
            1,

        prod: if isCanary
        then 0
        else 1,

        perf: if isCanary
        then
            0
        else
            1,

    },
}

jsonnet fmt aligns then and else with the key name.

Did you consider adding one more indent to the blocks starting with then and else.
How about the following indentation assuming --indent 4 is passed to jsonnet fmt

{
    replicas: {
        build: if isCanary then 0
            else 1,

        dev: if isCanary then
                0
            else
                1,

        prod: if isCanary
            then 0
            else 1,

        perf: if isCanary
            then
                0
            else
                1,
    },
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions