google / google/jsonnet

Concatenation with if conditions could be indented better

Open
#491 4 comments 0 reactions 0 assignees View on GitHub
enhancement formatter
Dominant language
Jsonnet
Stars
7.6k
Forks
475
PR merge metrics
No merged PRs in 30d

Description

Consider to following output for `jsonnet fmt --indent 4 --string-style l `

```
local tcm = if (env.isDev) then [] else [] +
if (env.isDev || env.isStaging) then [] else [] +
[
'app',
];

local tcm2 = "a" + "b " +
"c";

local tcm3 = ["a"] + ["b "] +
["c"];

{
}

```

Once if conditions are involved with concatenations, it looks like jsonnet fmt does not indent correctly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.