avh4 / avh4/elm-format

wrapped doc lines starting with numbers get turned into lists.

Open
#418 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug documentation invalid
Dominant language
Haskell
Stars
1.3k
Forks
148
PR merge metrics
No merged PRs in 30d

Description

I've got a doc comment that looks like this:

{-| Find an appropriate sample size for benchmarking. This should be much
greater than the clock resolution (5µs in the browser) to make sure we get good
data.

We do this by starting at sample size 1. If that doesn't pass our threshold, we
multiply by [the golden ratio](https://en.wikipedia.org/wiki/Golden_ratio) and
try again until we get a large enough sample.

In addition, we want the sample size to be more-or-less the same across runs,
despite small differences in measured fit. We do this by rounding to the nearest
order of magnitude. So, for example, if the sample size is 1234 we round to
1000. If it's 8800, we round to 9000.

-}
findSampleSize : Benchmark -> Task Error Int
findSampleSize benchmark =

I wrap my doc lines to 80 columns. elm-format takes that last line and turns it into a numbered list, like this:

order of magnitude. So, for example, if the sample size is 1234 we round to

1.  If it's 8800, we round to 9000.

I got around this for now by adding commas to my numbers (which really should be there anyway for readability) but it seems like this may be a bug?

SSCCE:

https://ellie-app.com/bRh4Wds6Wa1/0

Using elm-format@0.7.0-exp

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the formatting change from the linked SSCCE with elm-format@0.7.0-exp, focusing on wrapped doc comments whose continuation line begins with a number. Inspect the formatter's handling of Markdown-style lists and confirm the fix when the example remains prose rather than becoming a numbered list.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.