avh4 / avh4/elm-format

Formatting unspaced operators

Open
#810 2 comments 2 reactions 0 assignees View on GitHub
0.9 full operators list
Dominant language
Haskell
Stars
1.3k
Forks
147
PR merge metrics
No merged PRs in 30d

Description

I (too often) have code like this

Input:
```elm
a = f>>.field
b = g|>.field
```
Actual output (version 0.8.5):
```elm
a =
f >>. field

b =
g |>. field
```
Expected output:

```elm
a =
f >> .field

b =
g |> .field
```

I think the current behavior was correct for older versions of Elm, where `>>.` was potentially a valid Elm operator. Since 0.19, the operators are all known, and my thinking is that we could decide to try to end up in a state that it is more likely correct code (but is less agnostic about the operators).

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue using the Elm snippets in the report and compare the current output with the expected spacing around >>. and |>. Then trace the formatter behavior responsible for these operators and add coverage for both examples; done means the output matches the expected formatting without regressing older operator cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
elm
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.