Commit Graph

13 Commits

Author SHA1 Message Date
Mark Karpov
e29dd2b1c7 Fix the bug when comments in different styles get glued together 2020-06-24 17:10:54 +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
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
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