Closed ericzhang6222 closed 4 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
syntax/std_fmt.go | 8 | 10 | 80.0% | ||
syntax/format.go | 75 | 88 | 85.23% | ||
<!-- | Total: | 83 | 98 | 84.69% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
syntax/import_cache.go | 1 | 77.27% | ||
rel/value_set_generic.go | 2 | 74.47% | ||
rel/value_set_str.go | 6 | 60.23% | ||
<!-- | Total: | 9 | --> |
Totals | |
---|---|
Change from base Build e48178762c57f67f5ccfd3c330783a6fcfb5c785: | 0.3% |
Covered Lines: | 4382 |
Relevant Lines: | 9172 |
(In a separate PR) relations should be formatted as tables, e.g.: for a "simple" table: {|a, b| (1, 2), (12, 13)}
:
{|a , b |
(1 , 2 ),
(13, 14),
}
For a "complex" table, revert to set-of-tuples representation:
{
(
a: {1, 2},
b: {3, 4},
),
(
a: {20, 30},
b: {40, 50},
),
}
Simple structures should be inlined. E.g.,
[1, 2, 3]
should format as is.There's no hard and fast rule for what constitutes "simple". As a bare minimum, inline any array or set (up to some threshold length) with only trivial elements (numbers, strings, byte arrays,
()
,{}
andtrue
).The threshold could be fixed, or maybe a function of the current indent level.
Will do it in a separated PR. As @nofun97 want a MVP to help debugging ASAP, so I didn't do in this PR.
Fixes #171 .
Changes proposed in this pull request:
//fmt.pretty(value)
which can print more readable format of string representsrel.Value
:Checklist: