fmt: a regression was introduced in #22025 (vfmt struct init) #22026
Labels
Bug
This tag is applied to issues which reports bugs.
Unit: vfmt
Bugs/feature requests, that are related to the `vfmt`, the formatter for V.
Describe the bug
I'm not sure if the follwing vfmt struct init align changes in #22025 was intentional, but in
vab
a one-linerfield: if {} else {}
was "unrolled" resulting in a situation where I had to runv fmt -w .
twice (See this diff https://github.com/vlang/vab/pull/287/files#diff-d7aec8d71af6b80eee9d9768f16fd94d842270b868b008bf268679456c13df84R520-R527)The code in question went from:
to:
Reproduction Steps
It can be seen locally by checking out
vlang/vab
on master and runv fmt -w cli/options.v
Expected Behavior
I'd argue that the output is prettier if the
if {} else {}
was kept on one line. Alternatively if it should be "unrolled" it should not take two runs ofv fmt -w .
.Current Behavior
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.7 c51d30b
Environment details (OS name and version, etc.)
Linux
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: