Commit Graph

643 Commits (f32f2cfdac8ae46ab92e31f9e095279cd6e913b5)

Author SHA1 Message Date
Evan Borden f32f2cfdac
Merge 7c1b731f1e into b960a3f4ac 2020-11-20 21:58:06 +08:00
Taylor Fausak b960a3f4ac Version 0.12.2.0 2020-11-15 12:44:05 -05:00
Taylor Fausak 2da92c403a
Merge pull request #323 from lspitzner/set-up-github-actions
Set up GitHub actions
2020-11-15 10:06:43 -05:00
Taylor Fausak 47865b708c Remove unnecessary call to sdist
For some reason `cabal install` does sdist.
2020-11-15 09:50:41 -05:00
Taylor Fausak 751ec8848a Also test with GHC 8.0.2 2020-11-15 09:30:12 -05:00
Taylor Fausak f333302406 Also test with GHC 8.2.2 2020-11-15 09:29:43 -05:00
Taylor Fausak fb8e3825aa Also test with GHC 8.4.4 2020-11-15 09:29:28 -05:00
Taylor Fausak 5f8d70e5f0 Revert "Also test with GHC 8.10.2"
This reverts commit 2d8d1f4d86.
2020-11-15 09:24:19 -05:00
Taylor Fausak 2d8d1f4d86 Also test with GHC 8.10.2 2020-11-15 09:22:02 -05:00
Taylor Fausak 213de6a16c Strip executables 2020-11-15 09:21:35 -05:00
Taylor Fausak 52603fa8cb Upload binaries 2020-11-15 09:01:51 -05:00
Taylor Fausak 05dd912283 Also test with GHC 8.6.5 2020-11-15 08:58:21 -05:00
Taylor Fausak 0a48b0f106 Also test on Windows 2020-11-15 08:52:02 -05:00
Taylor Fausak 01de8ea9b1 Only upload artifacts from Ubuntu 2020-11-15 08:43:37 -05:00
Taylor Fausak e88872994b Also test on macOS 2020-11-15 08:41:43 -05:00
Taylor Fausak d5a5bec729 Start setting up GitHub Actions 2020-11-15 08:28:00 -05:00
Taylor Fausak 8e168f1578 Update stack.yaml.lock 2020-11-15 08:23:03 -05:00
Taylor Fausak 682f08c562
Merge pull request #313 from expipiplus1/joe-exportlist
nondecreasing export list formatting
2020-10-20 16:35:21 -04:00
Joe Hermaszewski 64417c59f4 nondecreasing export list formatting 2020-08-29 13:26:36 +08:00
Taylor Fausak 7d68b1cc38
Merge pull request #311 from jkachmar/patch-2
Allows aeson-1.5.*
2020-07-21 07:58:20 -04:00
Joe Kachmar 9b8ed90a8f
Allows aeson-1.5.* 2020-07-20 22:44:02 -04:00
Lennart Spitzner 55f84c3294
Merge pull request #293 from scrive/main-module
Expose main function as a module
2020-05-07 00:38:48 +02:00
Soares Chen 2da8bd5e74 Revert change to cabal version 2020-05-06 13:38:48 +02:00
Lennart Spitzner dab4f0d557
Merge pull request #303 from andys8/patch-1
Readme: Supports 8.8
2020-05-06 00:31:38 +02:00
Andy 8c57372bde
Readme: Supports 8.8 2020-05-05 10:46:59 +02:00
Lennart Spitzner 5c64928972 Fix problem of do notation as left argument of an operator 2020-04-21 01:34:46 +02:00
Evan Rutledge Borden 7c1b731f1e First pass at sum types
This is a naive first pass at sum type support. This currently breaks 11
tests, some from comment misplacement, others in more exotic forms that
previously required high levels of context to be correctly laid out. The
solution for comment misplacement is probably trivial, but the highly
contextualized forms may need a bit more alchemy.

```
  1) data type declarations record no matching single line layout
       expected: Right
                 {-# LANGUAGE ScopedTypeVariables #-}
                 -- brittany { lconfig_allowSinglelineRecord: true }
                 data MyRecord = forall a . Show a => Bar
                   { foo :: abittoolongbutnotvery -> abittoolongbutnotvery
                   }

        but got: Right
                 {-# LANGUAGE ScopedTypeVariables #-}
                 -- brittany { lconfig_allowSinglelineRecord: true }
                 data MyRecord = forall a
                 . Show a =>
                   Bar
                     { foo :: abittoolongbutnotvery -> abittoolongbutnotvery
                     }

  2) data type declarations record forall constraint multiline
       expected: Right
                 {-# LANGUAGE ScopedTypeVariables #-}
                 data MyRecord
                   = forall a
                   . LooooooooooooooooooooongConstraint a =>
                     LoooooooooooongConstructor
                       { foo :: abittoolongbutnotvery -> abittoolongbutnotvery
                       }

        but got: Right
                 {-# LANGUAGE ScopedTypeVariables #-}
                 data MyRecord = forall a
                 . LooooooooooooooooooooongConstraint a =>
                   LoooooooooooongConstructor
                     { foo :: abittoolongbutnotvery -> abittoolongbutnotvery
                     }

  3) data type declarations record forall constraint multiline more
       expected: Right
                 {-# LANGUAGE ScopedTypeVariables #-}
                 data MyRecord
                   = forall a b
                   . ( Loooooooooooooooooooooooooooooooong a
                     , Loooooooooooooooooooooooooooooooong b
                     ) =>
                     MyConstructor
                       { a :: a
                       , b :: b
                       }

        but got: Right
                 {-# LANGUAGE ScopedTypeVariables #-}
                 data MyRecord = forall a b
                 . ( Loooooooooooooooooooooooooooooooong a
                   , Loooooooooooooooooooooooooooooooong b
                   ) =>
                   MyConstructor
                     { a :: a
                     , b :: b
                     }

  4) data type declarations plain with forall and constraint
       expected: Right
                 {-# LANGUAGE ScopedTypeVariables #-}
                 data MyStruct
                   = forall a b
                   . ( Loooooooooooooooooooooooooooooooong a
                     , Loooooooooooooooooooooooooooooooong b
                     ) =>
                     MyConstructor (ToBriDocM BriDocNumbered)
                                   (ToBriDocM BriDocNumbered)
                                   (ToBriDocM BriDocNumbered)

        but got: Right
                 {-# LANGUAGE ScopedTypeVariables #-}
                 data MyStruct = forall a b
                 . ( Loooooooooooooooooooooooooooooooong a
                   , Loooooooooooooooooooooooooooooooong b
                   ) =>
                   MyConstructor (ToBriDocM BriDocNumbered)
                                 (ToBriDocM BriDocNumbered)
                                 (ToBriDocM BriDocNumbered)

  5) data type declarations record with many features
       expected: Right
                 {-# LANGUAGE ScopedTypeVariables #-}
                 data MyRecord
                   = forall a b
                   . ( Loooooooooooooooooooooooooooooooong a
                     , Loooooooooooooooooooooooooooooooong b
                     ) =>
                     MyConstructor
                       { foo, foo2
                           :: loooooooooooooooooooooooooooooooong
                           -> loooooooooooooooooooooooooooooooong
                       , bar  :: a
                       , bazz :: b
                       }
                   deriving Show

        but got: Right
                 {-# LANGUAGE ScopedTypeVariables #-}
                 data MyRecord = forall a b
                 . ( Loooooooooooooooooooooooooooooooong a
                   , Loooooooooooooooooooooooooooooooong b
                   ) =>
                   MyConstructor
                     { foo, foo2
                         :: loooooooooooooooooooooooooooooooong
                         -> loooooooooooooooooooooooooooooooong
                     , bar  :: a
                     , bazz :: b
                     }
                   deriving Show

  6) data type declarations single record existential
       expected: Right
                 {-# LANGUAGE ExistentialQuantification #-}
                 data Foo = forall a . Show a => Bar
                   { foo :: a
                   }

        but got: Right
                 {-# LANGUAGE ExistentialQuantification #-}
                 data Foo = forall a
                 . Show a =>
                   Bar
                     { foo :: a
                     }

  7) data type declarations record multiple types existential
       expected: Right
                 {-# LANGUAGE ExistentialQuantification #-}
                 data Foo = forall a b . (Show a, Eq b) => Bar
                   { foo  :: a
                   , bars :: b
                   }

        but got: Right
                 {-# LANGUAGE ExistentialQuantification #-}
                 data Foo = forall a b
                 . (Show a, Eq b) =>
                   Bar
                     { foo  :: a
                     , bars :: b
                     }

  8) data type declarations record newline comment
       expected: Right
                 data MyRecord = MyRecord
                   { a :: Int
                     -- comment
                   , b :: Int
                   }

        but got: Right
                 data MyRecord = MyRecord
                   { a :: Int
                 -- comment
                   , b :: Int
                   }

  9) data type declarations comment before equal sign
       expected: Right
                 {-# LANGUAGE ExistentialQuantification #-}
                 data MyRecord
                   -- test comment
                   = forall a b
                   . ( Loooooooooooooooooooooooooooooooong a
                     , Loooooooooooooooooooooooooooooooong b
                     ) =>
                     MyConstructor a b

        but got: Right
                 {-# LANGUAGE ExistentialQuantification #-}
                 data MyRecord
                   -- test comment
                                = forall a b
                 . ( Loooooooooooooooooooooooooooooooong a
                   , Loooooooooooooooooooooooooooooooong b
                   ) =>
                   MyConstructor a b

  10) data type declarations large record with a comment
       expected: Right
                 data XIILqcacwiuNiu = XIILqcacwiuNiu
                   { oyyFtvbepgbOge_pebzVmuftEijwuj     :: Jgtoyuh HessJvNlo
                   , wloQsiskdoxJop_xatiKrwedOxtu       :: Jgtoyuh [Inotg]
                   , mmmJjcqtemyIyo_ovosDoreKeeoyamvove :: Jgtoyuh Eujo
                   , mbiIatelofxOzr_uluxNngiiMjah       :: Jgtoyuh HessJvNlo
                   , obxIskfcxpkIkb_uuviTuevcSkrgo      :: Jgtoyuh Int
                   , wqrAtuvuecoHwr_ilotNxbuPleo        :: Jgtoyuh Ufaxdeq
                   , lofAfuebdhpLuv_cnekPoyFxmg         :: Jgtoyuh Ufaxdeq
                   , ouoFugtawzvUpk_oupiLzptugy         :: Jgtoyuh Eujo
                   , iqiXjtziwogNsa_uiyvSunaTtgUsf3     :: Jgtoyuh Oaivn
                   , odbIriaqnojUlz_onotoWuunehIpuy     :: Jgtoyuh Eujo
                   , opjUxtkxzkiKse_luqjuZazt
                       :: Jgtoyuh [(Eujo, Int, Int, Int, Int, Int, NELUxro)]
                   -- , jcqRaqznxfhIpa_ywevMezmoYkutuwa        :: Jgtoyuh ()
                   , vayOmuasyphOfd_bcsVljmvt               :: Jgtoyuh Eujo
                   , rifArahilooRax_ufikecqdImsv            :: Jgtoyuh Oaivn
                   , raqKtopcpszDwb_oqocubasZuqjcryoDojGkw  :: Jgtoyuh Oaivn
                   , mluJiilpcijUtt_gaisklifVekfeyagRmfbyzz :: Jgtoyuh Oaivn
                   , oqhPaahjupaSmi_gamwwoovKyxznecvEayluc  :: Jgtoyuh Oaivn
                   , mazFubimwebZpa_itidehDodiDlboz         :: Jgtoyuh Vrep
                   , jeyOcuesexaYoy_vpqn                    :: Jgtoyuh ()
                   }

        but got: Right
                 data XIILqcacwiuNiu = XIILqcacwiuNiu
                   { oyyFtvbepgbOge_pebzVmuftEijwuj     :: Jgtoyuh HessJvNlo
                   , wloQsiskdoxJop_xatiKrwedOxtu       :: Jgtoyuh [Inotg]
                   , mmmJjcqtemyIyo_ovosDoreKeeoyamvove :: Jgtoyuh Eujo
                   , mbiIatelofxOzr_uluxNngiiMjah       :: Jgtoyuh HessJvNlo
                   , obxIskfcxpkIkb_uuviTuevcSkrgo      :: Jgtoyuh Int
                   , wqrAtuvuecoHwr_ilotNxbuPleo        :: Jgtoyuh Ufaxdeq
                   , lofAfuebdhpLuv_cnekPoyFxmg         :: Jgtoyuh Ufaxdeq
                   , ouoFugtawzvUpk_oupiLzptugy         :: Jgtoyuh Eujo
                   , iqiXjtziwogNsa_uiyvSunaTtgUsf3     :: Jgtoyuh Oaivn
                   , odbIriaqnojUlz_onotoWuunehIpuy     :: Jgtoyuh Eujo
                   , opjUxtkxzkiKse_luqjuZazt
                       :: Jgtoyuh [(Eujo, Int, Int, Int, Int, Int, NELUxro)]
                 -- , jcqRaqznxfhIpa_ywevMezmoYkutuwa        :: Jgtoyuh ()
                   , vayOmuasyphOfd_bcsVljmvt               :: Jgtoyuh Eujo
                   , rifArahilooRax_ufikecqdImsv            :: Jgtoyuh Oaivn
                   , raqKtopcpszDwb_oqocubasZuqjcryoDojGkw  :: Jgtoyuh Oaivn
                   , mluJiilpcijUtt_gaisklifVekfeyagRmfbyzz :: Jgtoyuh Oaivn
                   , oqhPaahjupaSmi_gamwwoovKyxznecvEayluc  :: Jgtoyuh Oaivn
                   , mazFubimwebZpa_itidehDodiDlboz         :: Jgtoyuh Vrep
                   , jeyOcuesexaYoy_vpqn                    :: Jgtoyuh ()
                   }

  11) data type declarations records in sum
       expected: Right
                 -- brittany {lconfig_indentPolicy: IndentPolicyLeft }
                 data Foo
                   = Bar
                     { foo :: Int -- hello
                     , bar :: Foo
                     -- how are you
                     }
                   | Baz
                   | Biz
                     { foo :: Int
                     , bar :: Foo
                     }

        but got: Right
                 -- brittany {lconfig_indentPolicy: IndentPolicyLeft }
                 data Foo
                   = Bar
                     { foo :: Int -- hello
                     , bar :: Foo
                 -- how are you
                     }
                   | Baz
                   | Biz
                     { foo :: Int
                     , bar :: Foo
                     }
```
2020-04-10 10:59:00 -05:00
Soares Chen 8778dcf2f4 Create Main module for Brittany 2020-04-06 12:03:46 +00:00
Lennart Spitzner 86c25ff315
Merge pull request #286 from lspitzner/fix-instance-comment
Fix comments in instance/type instances (#282)
2020-03-24 20:38:28 +01:00
Lennart Spitzner 061c39b4e9 Fix a semi-hidden missing indentation bug 2020-03-23 16:52:18 +01:00
Lennart Spitzner df2ee177b2 Fix comments in instance/type instances (#282) 2020-03-23 16:51:30 +01:00
Lennart Spitzner 7b5c0dc4e3
Merge pull request #287 from RaoulHC/pattern-synonyms
Add support for pattern synonyms
2020-03-23 16:50:50 +01:00
Lennart Spitzner ae0e397fac Disable one test-case for ghc-8.0 (unsupported syntax) 2020-03-22 22:44:13 +01:00
Lennart Spitzner 2ce3fb178c Share some more bridoc nodes, clean up code 2020-03-21 22:07:54 +01:00
Lennart Spitzner 3631f6aec3 Add another testcase for bidirectional pattern synonyms 2020-03-21 22:05:21 +01:00
Lennart Spitzner eec946830b Fix failing testcase on bidirectional pattern synonyms 2020-03-21 22:05:21 +01:00
Lennart Spitzner b546b514b0 Add a testcase for PatternSynonym decls (needs fixing) 2020-03-21 22:05:21 +01:00
Lennart Spitzner 2d07900005 Rewrite non-recommended usage of docLines 2020-03-21 22:05:21 +01:00
Lennart Spitzner 9aad31809f Merge branch 'release' 2020-03-15 22:55:29 +01:00
Neil Mitchell 231c2f5e94 Permit extra-1.7 2020-03-15 22:52:36 +01:00
Lennart Spitzner 9236673d66 Fix newtype indent in associated type family (#207) 2020-03-13 01:23:17 +01:00
Raoul Hidalgo Charman dfa3fef56c Add support for pattern synonyms 2020-03-08 19:30:23 +00:00
Lennart Spitzner 4b673d1d9d Fix bug in record layouting causing overflows 2020-02-25 17:55:20 +01:00
Lennart Spitzner a3b501051a Add proper multiline layout for type-level-lists 2020-02-23 23:33:03 +01:00
Lennart Spitzner 38cdd15221 Fix moving comment in export list (haddock header) (#281) 2020-02-13 19:05:05 +01:00
Lennart Spitzner 825ec425d4 Improve comments-affecting-layout behaviour for tuples (#231) 2020-02-13 19:04:49 +01:00
Lennart Spitzner 85d55c3768 Print paths of files that would change with --check-mode 2020-02-07 20:03:56 +01:00
Lennart Spitzner 0fdbd51de0 Revert embarrassing debugging leftover that breaks things badly 2020-02-06 20:28:53 +01:00
Lennart Spitzner 5895f954bd Remove dependency on neat-interpolation 2020-02-04 16:14:38 +01:00
Lennart Spitzner f4cff441e2 Merge branch 'release' 2020-02-04 14:12:44 +01:00