refmt: keep new line characters when using infix operators
Open
Nobody has claimed this yet.
Printer
- Dominant language
- OCaml
- Stars
- 10.3k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
It is often more readable to have line breaks when using infix operators.
example 1
thing |> doFirstThing |> doSecondThing |> doThirdThing |> doFourthThing;
// vs
thing
|> doFirstThing
|> doSecondThing
|> doThirdThing
|> doFourthThing;
example 2:
thing >>= doFirstThing >>= doSecondThing >>= doThirdThing >>= doFourthThing;
// vs
thing
>>= doFirstThing
>>= doSecondThing
>>= doThirdThing
>>= doFourthThing;
refmt currently forces you into the first example when there are less than 80 characters on the line. I'd like to allow both styles.
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's formatting logic for infix operators and locate the existing formatter tests. Compare the two styles shown in the issue, then verify that line breaks can be preserved while the current compact style remains supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100