[refmt] Refmt favors multiple lines for short tuples and lists
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 10.3k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
In general, I find this:
[123, 456789, 0]
easier to read than this:
[
123,
456789,
0
]
In the case where this list is defined after a very long pattern match, for example, refmt prefers the multi-line approach, instead of having the full list definition on a single new line:
/* ideal, in my opinion */
| Some(VeryVeryVery(Loooooong(PatternMatch(_)))) =>
[123, 456789, 0]
/* what refmt currently does */
| Some(VeryVeryVery(Loooooong(PatternMatch(_)))) => [
123,
456789,
0
]
The same also applies to tuples (and probably arrays).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with refmt and reproduce the playground example using the short list and tuple cases after a long pattern match. Compare the current formatting with the requested single-line output, including the analogous array behavior if applicable; done means refmt consistently produces the preferred layout without regressing other formatting cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100