Commit Graph

21 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
zimbatm
0b92af2a7f nix: allow to pass the system attribute
This allows to build ormolu for another system as the machine's,
combined with Nix remote builders. It is also useful in a context of a
pure evaluation (like Flakes).
2020-08-21 14:51:37 +02:00
Mark Karpov
5d1612f153 Replace “idempotency” with “idempotence” 2020-04-27 15:16:40 +02:00
Mark Karpov
39059761a5
Avoid re-compilation of ormolu for hackage test targets
Previously running tests took longer and this is why we have this
conditional. I doubt it was a good idea anyway, because the ‘dontCheck’
modifier causes re-compilation which takes longer than running tests anyway.
2020-04-23 21:06:08 +02:00
Mark Karpov
53f582a575
Implement experimental support for CPP 2020-04-22 14:47:09 +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
Mark Karpov
1e089f7dc8 Run the build with 3 latest GHC versions 2020-04-14 18:23:56 +02:00
Artyom Kazak
b08af17217 Migrate to ‘ghc-lib-parser’
This would let us have features from GHC 8.8.1 while still using GHC 8.6.5
from Nixpkgs. Bonus: Ormolu will be compilable with GHCJS.
2019-11-01 18:19:34 +01:00
mrkkrp
8466d6e743 Change the style of type signatures
The commit changes how type signatures are printed. The new style looks like
this:

  foo ::
    Int ->
    Char ->
    String

This works better with foralls and other features of the type system that
will be added in the near future, like linear arrows.

In order to print Haddocks nicely (this seems to be the only acceptable
placement):

  foo ::
    -- | First argument
    Int ->
    -- | Second argument
    Char ->
    -- | Result
    String

It is often necessary to re-arrange them completely and use the “pipe style”
instead of “caret style”. It proved to be a very hard task with our older
comment-handling system, if not impossible.

Here we start parsing Haddocks so that they are treated as components of AST
and we now render them as part of rendering of those components. The
existing framework for handling comments only prints non-Haddock comments
now.

The change caused a fair number of new problems and failures which I added
new tests for.
2019-10-02 16:52:42 +02:00
Utku Demir
d900f4efaf Test a few Hackage packages on CI 2019-08-30 12:44:14 +02:00
mrkkrp
c0513b3024 Use GHC 8.6.5 2019-08-28 15:44:41 +02:00
Utku Demir
da0b3b8565 Implement the --check-idempotency flag 2019-08-16 22:21:20 +02:00
mrkkrp
c6a6193525
Do not run tests when trying Ormolu on Hackage packages 2019-08-05 15:15:45 +02:00
mrkkrp
63478a0ba4
Drop shebang from the ormolize.sh script
This one is likely to incorrect in the context of the build.
2019-07-15 11:41:45 +02:00
mrkkrp
c5b9fa1168 Add an option to tolerate CPP pragmas 2019-07-14 13:14:55 +02:00
mrkkrp
78e8dd830a Make sure we always get both original and formatted files 2019-07-14 13:14:55 +02:00
mrkkrp
7a9aab77b3 Add nix expression for reformatting sources of arbitrary packages
See the description in readme.
2019-07-14 13:14:55 +02:00
mrkkrp
ca49003d41
Drop redundant trailing newlines in nix files 2019-06-24 20:14:49 +02:00
Luc Tielen
6b73283246 Clean nix configuration
* Point to more recent nixpkgs commit. This fixes build issue with python
  3.7.3 (only on darwin?).

* Separate shell.nix and default.nix. This is so that lorri can be used for
  development.

* Add nix output to .gitignore.

* Format *.nix using nixfmt.

* Use gitignore for filtering files in nix derivation.
2019-06-23 19:17:05 +02:00
mrkkrp
34b9b71601 Build the project with Nix and switct to GHC 8.6.4
It was decided that we're going to make the project compatible with just one
GHC version at a time. Right now this version is going to be 8.6.4.

A small refactoring included, plus support for the “deriving via” feature.
2019-05-31 14:43:15 +02:00