Commit Graph

22 Commits

Author SHA1 Message Date
Mark Karpov
54d36fcc2c Update nix pin, test with GHC 8.8.4 2020-08-23 11:57:50 +02:00
Mark Karpov
68c3147f5e Improve grouping of top-level type signatures 2020-06-26 14:04:47 +02:00
Mark Karpov
e29dd2b1c7 Fix the bug when comments in different styles get glued together 2020-06-24 17:10:54 +02:00
Mark Karpov
ca83f15869 Implement merging on imports 2020-06-22 16:31:26 +02:00
Mark Karpov
a877785709 Preserve blank lines in ‘let’ and ‘where’ bindings 2020-06-15 10:56:03 +02:00
Mark Karpov
d5a5bf66c0 Fix rendering of function arguments in multiline layout 2020-06-10 15:14:46 +02:00
Mark Karpov
2efc5d37f9 Format linked lists with colon as line terminator
This adds support for a formatting style described here:

<https://wiki.haskell.org/List_notation>
2020-06-10 14:31:07 +02:00
Mark Karpov
8eac6bb7a0 Fix an idempotence issue with operators chains 2020-05-25 16:19:37 +02:00
Mark Karpov
1fb65a218c Fix non-idempotent transformation of partly documented data definition 2020-05-15 12:21:27 +02:00
Mark Karpov
b0092e11a1 Fix another case of non-idempotence with inline comments 2020-05-14 15:45:01 +02:00
Mark Karpov
76c4f523d7 Fix rendering of unnamed fields of data constructors 2020-05-13 15:37:07 +02:00
Mark Karpov
60752a2853 Fixed an idempotence issue in type synonym and data declarations 2020-05-07 19:29:52 +02:00
Mark Karpov
0abedcce03 Prevent the equality sign from “disconnecting” comments
This resolves a class of idempotence issues when the equality sign happens
to be inserted between an element and its comment that follows on the same
line. I had to special-case equality sign for this, because all alternative
approaches (changing comment association logic or trying to find a more
general rule) did not work or fixed this issue yet made other things worse.

There is nothing special about the equality sign per se, but it (always?)
starts definitions which have their own ‘Located’ wrappers and it is those
spans interfere with the logic of comment association (they are detected as
AST elements between the “host” element and its comment) on subsequent
passes. This results in non-idempotent formatting.

The solution is OKish in that it fixes 99% of problems that one will
encounter in practice, but I see how an input can be crafted to show that
there is still an issue with idempotence.
2020-05-06 23:03:57 +02:00
Mark Karpov
991bf8e24d Prevent incorrect detection of continuations of comment series 2020-05-04 19:02:42 +02:00
Mark Karpov
22839ed74c Improve tracking of dirty lines, better hang expressions in records 2020-04-29 18:12:42 +02:00
Mark Karpov
21dd3775e7 Fix rendering of module headers 2020-04-24 20:21:35 +02:00
Mark Karpov
490720fedc Preserve comments on pragmas 2020-04-17 17:01:34 +02:00
Mark Karpov
145f7296f5 Preserve grouping of do statements 2020-04-16 20:41:36 +02:00
Mark Karpov
44cef926de Improve the error message in case of a parse error (take 2) 2020-04-16 12:20:20 +02:00
Mark Karpov
ab179d5a17 Improve the error message in case of a parse error
Parse errors are typically not Ormolu errors.
2020-04-15 19:07:57 +02:00
Mark Karpov
0e40431ba3
Ignore blank lines when checking the logs for Hackage packages
My editor trims trailing blank lines, so it is not handy to edit the
expected failures manually.
2020-04-15 17:56:31 +02:00
Mark Karpov
31f6cfd83f Compare failing logs with exact expected result
This will allow us to test on more code and catch changes in the logs as
they happen.
2020-04-15 15:00:08 +02:00