Compare commits

...

354 Commits

Author SHA1 Message Date
Taylor Fausak e03ab8425b
Merge pull request #377 from lspitzner/tfausak-patch-1
Announce end of maintenance
2022-11-11 12:13:28 -06:00
Taylor Fausak 420eac889e
Announce end of maintenance 2022-11-11 09:52:57 -06:00
Taylor Fausak 0aa04af4eb
Version 0.14.0.2 2022-01-13 09:28:26 -05:00
Taylor Fausak 93a43bf28d Revert "Remove `Language.Haskell.` from module names"
This reverts commit 2fe1432631.
2022-01-13 14:16:14 +00:00
Taylor Fausak 29814f919e
Version 0.14.0.1 2022-01-11 08:49:47 -05:00
Taylor Fausak 97da38fab7 Merge remote-tracking branch 'upstream/master' into main 2022-01-11 13:48:58 +00:00
Taylor Fausak b59f885987
Merge pull request #363 from sergv/master
Fix warnings when building with GHC 9.0.2
2022-01-11 07:46:42 -06:00
Sergey Vinokurov 3996efd5eb
Use defaultDynFlags to obtain ghc’s DynFlags
This way brittany can avoid dealing with incompatibilities in DynFlags
structure between ghc versions (e.g. different versions having
different fields).
2022-01-09 20:11:23 +00:00
Taylor Fausak ad88ba3f57
Update Stack resolver
Fixes #361.
2022-01-05 07:48:36 -05:00
Taylor Fausak 46bf450530
Merge pull request #360 from fendor/patch-1
Update README to mention HLS instead of HIE
2021-12-01 15:19:56 -05:00
fendor 6b1e6fa73a
Update README to mention HLS instead of HIE 2021-12-01 20:51:51 +01:00
Taylor Fausak 2fe1432631 Remove `Language.Haskell.` from module names 2021-11-29 12:25:00 +00:00
Taylor Fausak 6151ba5825 Upgrade to ghcup 0.1.17.4 2021-11-29 12:21:18 +00:00
Taylor Fausak 9e12a36a4f Also build on `master` branch 2021-11-29 12:20:51 +00:00
Taylor Fausak ccabed9d7b Use new czipwith from Hackage 2021-11-29 12:18:38 +00:00
Taylor Fausak 7399b75388
Merge pull request #359 from tfausak/gh-238-format-self
Format Brittany with Brittany
2021-11-29 07:14:35 -05:00
Taylor Fausak 7fa2a85b30 Format Brittany with Brittany
Fixes #238.
2021-11-29 02:31:50 +00:00
Taylor Fausak a15eed5f36
Merge pull request #357 from tfausak/main
Support only GHC 9.0
2021-11-28 09:42:35 -05:00
Taylor Fausak 339d2ebf23 Version 0.14.0.0 2021-11-28 14:08:58 +00:00
Taylor Fausak 8f2625dc87 Simplify test suite 2021-11-28 13:24:11 +00:00
Taylor Fausak cddb98b124 Run tests in serial 2021-11-25 14:16:22 +00:00
Taylor Fausak 21e86adf6e Split tests into individual files 2021-11-23 22:41:01 +00:00
Taylor Fausak 89a9f47b72 Ignore warnings when parsing modules 2021-11-21 23:40:15 +00:00
Taylor Fausak ab59e9acc3 Parse modules "purely", without ghc-paths 2021-11-21 22:58:07 +00:00
Taylor Fausak b8532ca631 Fix release job dependency 2021-11-21 14:05:37 +00:00
Taylor Fausak cdc8405b10 Remove mentions of GHC 8.x 2021-11-21 13:59:35 +00:00
Taylor Fausak fa8365a7fa Set up release job 2021-11-21 13:53:46 +00:00
Taylor Fausak 8fadac8b2e Format imports 2021-11-21 13:44:06 +00:00
Taylor Fausak ccd09ba40a Remove obsolete Stack configuration 2021-11-21 13:28:15 +00:00
Taylor Fausak 8d7b46b9e9 Fix handling of comments 2021-11-07 13:01:54 +00:00
Taylor Fausak 4079981b1d Revert "Format Brittany with Brittany"
This reverts commit 4398b5880d.
2021-11-07 12:37:49 +00:00
Taylor Fausak 4398b5880d Format Brittany with Brittany 2021-11-06 22:29:34 +00:00
Taylor Fausak ac81c5ce90 Update Stack config 2021-11-06 21:44:30 +00:00
Taylor Fausak 208240b62f Remvoe old Stack configs 2021-11-06 21:36:35 +00:00
Taylor Fausak fdbbe9803d Try to spend less time compressing binaries 2021-11-06 21:33:44 +00:00
Taylor Fausak 4ee386a323 Remove unnecessary setup script 2021-11-06 21:32:54 +00:00
Taylor Fausak a1cd4c5ed5 Remove Make configuration 2021-11-06 21:32:31 +00:00
Taylor Fausak 51ca8fd5d7 Remove Nix configuration 2021-11-06 21:31:55 +00:00
Taylor Fausak 694ce973f4 Remove Travis CI config 2021-11-06 21:31:23 +00:00
Taylor Fausak 93172bfd21 Add flag for turning warnings into errors 2021-11-06 21:30:05 +00:00
Taylor Fausak e22a647baa Move literate test files 2021-11-06 21:28:23 +00:00
Taylor Fausak 79be0ed200 Move test suite 2021-11-06 21:25:04 +00:00
Taylor Fausak 93ba90e646 Rename test suite 2021-11-06 21:23:49 +00:00
Taylor Fausak 5631e2500f Merge interface tests into literate tests 2021-11-06 21:23:24 +00:00
Taylor Fausak 9a9b67d410 Merge unit tests into literate tests 2021-11-06 21:21:11 +00:00
Taylor Fausak d879125264 Combine unit test modules 2021-11-06 21:17:57 +00:00
Taylor Fausak c2248cb99c Ignore missed specializations 2021-11-06 21:15:03 +00:00
Taylor Fausak 0c720ee032 Remove unnecessary flags 2021-11-06 21:12:57 +00:00
Taylor Fausak 75aed1cb8a Remove unnecessary GHC version parsing 2021-11-06 21:11:27 +00:00
Taylor Fausak 2ab406471b Move library 2021-11-06 21:07:34 +00:00
Taylor Fausak 95017640a8 Move executable 2021-11-06 21:06:23 +00:00
Taylor Fausak 392e5b7569 Fix many HLint warnings 2021-11-06 21:05:10 +00:00
Taylor Fausak 75cf5b83a3 Remove unused tests 2021-11-06 20:40:31 +00:00
Taylor Fausak d03deccba8 Remove unnecessary export lists 2021-11-06 20:38:28 +00:00
Taylor Fausak 69e0f9fedf Expose all modules 2021-11-06 20:34:25 +00:00
Taylor Fausak 33d2aa8790 Use common stanzas in package description 2021-11-06 20:33:43 +00:00
Taylor Fausak 8a4bfe083e Use layout for package description 2021-11-06 20:33:06 +00:00
Taylor Fausak d1968b5de3 Remove redundant language extensions 2021-11-06 18:17:01 +00:00
Taylor Fausak 09f7e1726b Configure HLint 2021-11-06 17:59:26 +00:00
Taylor Fausak 09fabe8d16 Compress executable artifacts 2021-11-06 17:47:27 +00:00
Taylor Fausak 72fd6959f7 Don't enable any language extensions by default 2021-11-06 17:45:56 +00:00
Taylor Fausak 2dced782b1 Make sure record updates are complete 2021-11-06 17:40:55 +00:00
Taylor Fausak c02edecd1e Remove redundant constraints 2021-11-06 17:39:57 +00:00
Taylor Fausak ce0aa4feec Use canonical `Monoid` instances 2021-11-06 17:37:47 +00:00
Taylor Fausak 7ce87381ae Use canonical `Monad` instance 2021-11-06 17:37:19 +00:00
Taylor Fausak bb3a7d0a5b Remove unnecessary `Typeable` instances 2021-11-06 17:36:35 +00:00
Taylor Fausak 325798a02b Remove unused dependencies 2021-11-06 17:35:34 +00:00
Taylor Fausak e3deff448a Switch from `-Wall` to `-Weverything` 2021-11-06 17:35:09 +00:00
Taylor Fausak 32da5defb5 Remove unused imports 2021-11-06 17:27:19 +00:00
Taylor Fausak 1e7a94e72e Inline `prelude.inc` 2021-11-06 17:12:55 +00:00
Taylor Fausak 19a092b862 Remove CPP instances 2021-11-06 17:09:43 +00:00
Taylor Fausak 56ccbc91a8 Add `Paths_brittany` as an automatically generated module 2021-11-06 17:04:46 +00:00
Taylor Fausak d89cf0ad30 Remove CPP 2021-11-06 17:03:42 +00:00
Taylor Fausak 0c33d9a6fa Remove redundant pattern matches 2021-11-06 17:01:11 +00:00
Taylor Fausak c361ba545d Avoid relying on `StarIsType` 2021-11-06 16:57:02 +00:00
Taylor Fausak acdc30c227 Comment out unused definitions 2021-11-06 16:56:22 +00:00
Taylor Fausak eccd2debb0 Replace `Option` with `Maybe` 2021-11-06 16:55:46 +00:00
Taylor Fausak b517eef71e Fix handling of type families 2021-11-06 16:46:24 +00:00
Taylor Fausak 85359163cc Add back EOF handling 2021-11-06 15:22:13 +00:00
Taylor Fausak 8290109e7f Fix handling of EOF 2021-11-06 15:19:38 +00:00
Taylor Fausak 1ad34aedcc Remove unused HLS 2021-11-06 14:50:31 +00:00
Taylor Fausak 42cf56b106 Switch to Purple Yolk 2021-11-04 23:14:13 +00:00
Taylor Fausak bfdb28010a Restore custom `Show` instance for `PPTextWrapper` 2021-11-04 23:05:43 +00:00
Taylor Fausak bd860f9983
Fix type variable name 2021-11-02 08:10:44 -04:00
Taylor Fausak 22361c4ecd Fix getting binders from `HsForAllTy` 2021-11-02 02:17:05 +00:00
Taylor Fausak 0f035faf3c Fix matching of `LastStmt` 2021-11-02 02:16:49 +00:00
Taylor Fausak 515595b432 Append final newline 2021-10-30 16:28:34 +00:00
Taylor Fausak 116930ac2b Get everything building with (only) GHC 9.0 2021-10-30 16:20:13 +00:00
Taylor Fausak 7bd98ffb1c Upgrade dependencies and tighten bounds 2021-10-30 15:02:35 +00:00
Taylor Fausak abba8668f7 Sort dependencies 2021-10-30 14:49:03 +00:00
Taylor Fausak 9940aa4ae5 Get a working build plan 2021-10-30 14:48:37 +00:00
Taylor Fausak ee5be0735b Set up development container 2021-10-30 10:00:46 -04:00
Taylor Fausak 434f9f8e49
Version 0.13.1.2 2021-05-18 08:34:18 -04:00
Taylor Fausak 50f053cc2c
Update ChangeLog.md 2021-05-18 08:33:51 -04:00
Taylor Fausak de6776b08c
Merge pull request #347 from felixonmars/patch-1
Allow hspec 2.8
2021-05-15 07:32:33 -04:00
Felix Yan 7a7ea6c40d
Allow hspec 2.8
All tests are passing.
2021-05-15 06:07:49 +08:00
Taylor Fausak 4d064db674
Version 0.13.1.1 2021-02-26 08:53:28 -05:00
Taylor Fausak 1a9863160b
Update ChangeLog.md 2021-02-26 08:52:58 -05:00
Taylor Fausak 3175a7c2b3
Merge pull request #343 from maralorn/patch-1
Update ghc-exactprint upper bound
2021-02-26 08:50:41 -05:00
maralorn 256a30cdf8
Update ghc-exactprint upper bound 2021-02-26 14:29:00 +01:00
Taylor Fausak 6b4e534840
Merge pull request #334 from ahstro/patch-1
Update ArchLinux installation instructions
2021-01-02 07:58:02 -05:00
Anton Strömkvist 9658653ab9
Update ArchLinux installation instructions
Brittany is in the community repo now, and no longer requires AUR
2021-01-02 09:16:57 +01:00
Taylor Fausak b1bfef5b8a
Merge pull request #333 from felixonmars/patch-1
Allow random 1.2
2020-12-15 13:21:00 -05:00
Felix Yan e8c4855cd3
Allow random 1.2
Builds fine and all tests pass here.
2020-12-16 01:51:33 +08:00
Taylor Fausak a13ad1b9da Version 0.13.1.0 2020-12-11 11:40:48 -05:00
Taylor Fausak cf48251c76
Merge pull request #331 from lspitzner/remove-travis-ci
Remove Travis CI
2020-12-11 11:35:03 -05:00
Taylor Fausak 8d4e03c53e
Remove Travis CI 2020-12-11 10:47:25 -05:00
Taylor Fausak 9e53988b1d
Merge pull request #330 from expipiplus1/imports-sorted
Sorted imports 2
2020-12-11 10:44:32 -05:00
Taylor Fausak d7083e78bd
Merge pull request #329 from expipiplus1/joe-nix
Simplify Nix expressions
2020-12-11 08:08:16 -05:00
Joe Hermaszewski 8a88e10625 Drop CPP for no-longer-supported GHC versions 2020-12-11 17:08:57 +08:00
Joe Hermaszewski 0b0c6d65ca Simplify Nix expressions
This uses `developPackage` from `nixpkgs` to generate the derivation

Also add CI for nix build
2020-12-11 17:03:10 +08:00
Taylor Fausak 1b74b4274c Version 0.13.0.0 2020-12-09 21:56:28 -05:00
Taylor Fausak 6346e2026a
Merge pull request #324 from lspitzner/gh-269-ghc-8.10
Support GHC 8.10
2020-12-09 21:50:24 -05:00
Taylor Fausak 6453e218ed Publish from GHC 8.10.2 2020-12-09 21:30:58 -05:00
Taylor Fausak b34210b739 Update Stack configurations 2020-12-09 21:30:27 -05:00
Taylor Fausak 0a710ab271
Test against 8.10 by default 2020-11-23 08:08:08 -05:00
Taylor Fausak c4b6a81b31
List 8.10 support 2020-11-23 08:07:21 -05:00
Joe Hermaszewski 9efed95d50 Add tests for import sorting 2020-11-20 23:03:59 +08:00
Joe Hermaszewski f67e72e82c Merge remote-tracking branch 'origin/gh-269-ghc-8.10' into imports-sorted 2020-11-20 22:20:52 +08:00
Joe Hermaszewski fc5b1429f4 Merge branch 'gh-269-ghc-8.10' into imports-sorted 2020-11-20 22:18:46 +08:00
Taylor Fausak d00387d156
Remove broken test case 2020-11-20 08:53:08 -05:00
Taylor Fausak 71e7f52014
Remove broken test case 2020-11-20 08:52:28 -05:00
Lennart Spitzner 1e5b8ada4e Fix ghc version compat 2020-11-19 09:00:45 +08:00
Lennart Spitzner 93ea6542cc Fix existing tests for new import layouter behaviour 2020-11-19 09:00:45 +08:00
Lennart Spitzner eb7a4811fd Implement sorting of import statements 2020-11-19 09:00:45 +08:00
Lennart Spitzner 5a65ed2356 Comment out / Explain TODO on unused code 2020-11-19 09:00:45 +08:00
Lennart Spitzner 614bf3424d Minor refactoring 2020-11-19 09:00:45 +08:00
Lennart Spitzner 63de13b0b4 Fix misworded comment 2020-11-19 09:00:45 +08:00
Lennart Spitzner c6ad57e330 Start implementing sort/uniq on imports/exports 2020-11-19 09:00:45 +08:00
Taylor Fausak 7dedb0c17d Test against GHC 8.10 2020-11-15 12:55:50 -05:00
Taylor Fausak e36d9bc465 Drop support for GHC 8.4 2020-11-15 12:55:50 -05:00
Taylor Fausak 259c949211 Drop support for GHC 8.2 2020-11-15 12:55:50 -05:00
Taylor Fausak 096c438b23 Drop support for GHC 8.0 2020-11-15 12:55:50 -05:00
Taylor Fausak 23dace16ed Don't fail fast 2020-11-15 12:55:50 -05:00
Taylor Fausak 045c387ff4 Remove unnecessary configuration
The latest revision of data-tree-print allows base 4.14.
2020-11-15 12:55:50 -05:00
Taylor Fausak cf3bc5daf4 Allow strict 0.4 2020-11-15 12:55:50 -05:00
Luke Lau 1e118a44ca Fix build on GHC 8.8 and below 2020-11-15 12:55:50 -05:00
Ximin Luo adb642353d more GHC 8.10.1 fixes 2020-11-15 12:55:50 -05:00
Javier Neira 9913b45086 Update cabal.project
Only data-tree-print is needed now

Co-authored-by: Luke Lau <luke_lau@icloud.com>
2020-11-15 12:55:50 -05:00
jneira b69a8f983c Adapt to new GHC modules organization 2020-11-15 12:55:50 -05:00
jneira 17d07edb0a Relax upper bounds to include updated packages 2020-11-15 12:55:50 -05:00
jneira 10aec17005 Use allow-newer to build not updated pkgs 2020-11-15 12:55:50 -05: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
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
Lennart Spitzner f80e777163 Allow neat-interpolation-0.4.* 2020-02-04 14:11:45 +01:00
Lennart Spitzner fad9db8fd8 Autoformat Config.hs 2020-01-23 13:56:25 +01:00
Lennart Spitzner 03e2b62c24 Introduce flag to disable formatting per-module
New inline config `-- brittany-disable` that parses but
ignores the current module. Useful if both brittany
and ghc-exactprint bug out for some syntax.
2020-01-23 13:56:25 +01:00
Lennart Spitzner 7fd2bef440
Merge pull request #273 from lspitzner/error-handling
Error handling
2020-01-23 01:17:07 +01:00
Lennart Spitzner 95686c20cd Merge branch 'master' into error-handling 2020-01-22 22:58:40 +01:00
Lennart Spitzner 128dd828c2 Fix newline issue on comments before where 2020-01-11 23:19:04 +01:00
Lennart Spitzner 2b303b2a20 Fix additional indentation bug for let-in 2020-01-10 16:32:18 +01:00
Lennart Spitzner d0256bb0db Make unknown syntax errors non-fatal/Fall back on exactprint 2020-01-03 11:58:53 +01:00
Lennart Spitzner 342cf16c56 Improve error message printing
- Omit unnecessary show-invocation
- Use showOutputable for the error span (location)

before/after:

  "RealSrcSpan SrcSpanPoint \"stdin\" 2 1: parse error (possibly incorrect indentation or mismatched brackets)"
  stdin:2:1: parse error (possibly incorrect indentation or mismatched brackets)
2020-01-03 11:58:53 +01:00
Lennart Spitzner af227a797d Add a few code comments 2019-12-20 01:20:07 +01:00
Lennart Spitzner 6724760f40 Fix non-idempotent newlines with comment + where (#263) 2019-12-20 01:12:25 +01:00
Lennart Spitzner 434854f8f3
Merge pull request #259 from eborden/datadecl
Data declaration for newtype and records
2019-12-09 22:46:03 +01:00
Lennart Spitzner 00c6854887 Fix two minor data-decl layouting issues 2019-12-09 22:35:26 +01:00
Lennart Spitzner a1282c3ac6 Add a testcase for the last commit 2019-12-09 11:22:43 -07:00
Lennart Spitzner 3fbbf3d661 Fix one misplaced comment bug on data decls 2019-12-09 11:22:43 -07:00
Lennart Spitzner 6c3d9c57c5 Comment the single-line record decl config flag out 2019-12-09 11:22:43 -07:00
Lennart Spitzner 5a49277eba Improve data decl layouting
- Fix bug in BackendUtil/lowest level of brittany about
  alignment being ignored after a comment,
- Properly layout large (more than single-line) types in
  record fields and in data decl rhs arguments,
- Properly layout data decl constructors with large "heads"
  (forall, constraints),
- Add a config flag to control single-line layout of record
  definition,
2019-12-09 11:20:28 -07:00
Evan Rutledge Borden 80f370a8e1 Support nullary data types
Add tests for nullary prefix data types and nullary record data types.
2019-12-09 11:17:32 -07:00
Lennart Spitzner 0381b9fe24 Fix record field comment indentation 2019-12-09 11:17:32 -07:00
Lennart Spitzner c367b1017b Fixup src-literatetests/Main formatting 2019-12-09 11:17:32 -07:00
Evan Rutledge Borden 9494d6203a Allow multi line formatting of normal records
Only single line formatting of normal records was being supported. For
records with long names we need multi line formatting. This also needs
to support both multi and left indentation policies.
2019-12-09 11:17:32 -07:00
Lennart Spitzner a23ef696e8 Fix test failure: DerivingStrategies exists since ghc-8.2 2019-12-09 11:17:32 -07:00
Lennart Spitzner 54f34344b3 Implement #min-ghc keyword for test script 2019-12-09 11:17:32 -07:00
Lennart Spitzner 48490a7110 Fix handling of comment before data-decl
`docWrapNodePrior` caused duplication of offset of `data` keyword
and of comments connected to it.
2019-12-09 11:17:31 -07:00
Evan Rutledge Borden ea9d3bb5b3 Add stack lock file for 8.0.2 2019-12-09 11:17:31 -07:00
Evan Rutledge Borden b2f4262749 Isolate deriving via test 2019-12-09 11:17:31 -07:00
Evan Rutledge Borden aeaa043e99 Support building DataDecl with 8.0.2 2019-12-09 11:17:31 -07:00
Evan Rutledge Borden 9971e3905d Support building DataDecl with 8.2.2 2019-12-09 11:17:31 -07:00
Evan Rutledge Borden dee63517ba Include stack lock files 2019-12-09 11:17:31 -07:00
Evan Rutledge Borden 868b8c61e3 Add a Makefile for easy testing many version
The `Makefile` includes `stack test` configurations to support building
versions of `brittany` with supported versions of `ghc`. Each version
uses a separate `.stack-work` directory to allow minimal compilation on
each change.
2019-12-09 11:17:31 -07:00
Lennart Spitzner 2f6967b7b8 Support comments in record data decls 2019-12-09 11:17:31 -07:00
Lennart Spitzner d21ecf89e6 Fix a comment bug in tuple-type layouting 2019-12-09 11:17:31 -07:00
Lennart Spitzner 208a1ceadb Start making datadecls work with ghc-8.4 2019-12-09 11:17:31 -07:00
Evan Rutledge Borden 57ba88a73c Work-in-progress add record declaration layout
Simple records are supports. The tests cover:

- single records
- multi-field types
- columnized alignment
- basic deriving
- deriving strategies
- existential quanitification

A few items block merger

- retaining comments

A few items can be deferred:

- normal types
- sum types
2019-12-09 11:17:31 -07:00
Lennart Spitzner 4f827491da Work-in-progress commit (deriving clause..) 2019-12-09 11:17:31 -07:00
Lennart Spitzner 172866755c Start impl. layouting for datatypes (#12)
Only newtypes work for now; the "interesting" data records
are not touched yet.

Comment insertion not really considered yet; probably needs work.
2019-12-09 11:17:31 -07:00
Lennart Spitzner f8892d41d4 Bump to 0.12.1.1; Update changelog 2019-12-09 13:38:26 +01:00
Lennart Spitzner e24271318d Improve record-expression layouting
- Finish consolidation, clearing a TODO
- Fix two comment placement issues around record wildcards
- Fix regression in brittany-0.12 about layouting large
  (multiline) record field updates
2019-12-05 14:30:50 +01:00
Lennart Spitzner f87c0c64b8 Implement experimental semicolon-into-newlines feature 2019-12-04 13:55:41 +01:00
Lennart Spitzner 77d6d5b553 Fix roundtripping of (~) constraint/type 2019-11-27 22:21:16 +01:00
Lennart Spitzner 41750dc8a8 Add doc chapter on exactprinting, plus minor doc fixups 2019-11-18 11:26:18 +01:00
Lennart Spitzner 974826f98f Fix whitespace regression on forall+constraint type sig 2019-11-08 12:11:35 +01:00
Lennart Spitzner 9d0669d6a6 Fix typo in ChangeLog.md 2019-11-08 12:07:41 +01:00
Lennart Spitzner 38f77f6c5e Update stack.yaml to allow compilation with ghc-8.8 2019-09-29 23:24:29 +02:00
Lennart Spitzner 17055479d3 Try fixing CI, ghc-8.8 seems to use more heap 2019-09-29 23:24:05 +02:00
Lennart Spitzner 89b7655bac Fix support for ghc-8.8 2019-09-29 21:45:46 +02:00
Lennart Spitzner 3482f6a36d Bump semigroups dependency bound 2019-09-29 18:24:13 +02:00
Lennart Spitzner b656b8cc27 Bump to 0.12.1.0; Update changelog 2019-09-29 18:19:48 +02:00
Lennart Spitzner a98d643a62 Disable perf test by default via new cabal flag 2019-09-29 14:08:27 +02:00
Lennart Spitzner 0795a39806 Fix infix matches with more than 2 args, fixes #219 2019-09-19 00:48:59 +02:00
Lennart Spitzner 6879436e67 Fix lambdas with lazy/bang pattern as first argument 2019-09-03 01:10:38 +02:00
Lennart Spitzner 702b993dab Fix prefix operator pattern-match invalid result 2019-09-03 00:23:58 +02:00
Lennart Spitzner 8861f16624 Fix comment handling with let-in 2019-09-02 17:04:44 +02:00
Lennart Spitzner 670b796edb Add ghc-8.8.1 to travis script 2019-09-02 17:04:44 +02:00
Lennart Spitzner 91d6e18aba Adapt to ghc-8.8 (deps are not ready though) 2019-09-02 17:04:44 +02:00
Lennart Spitzner c97f6dd559 Update cabal instructions 2019-09-02 13:58:35 +02:00
Lennart Spitzner f289389879 Fix comment wandering left inside instance decls 2019-08-28 14:48:11 +02:00
Lennart Spitzner 698356a880 Increase the timeout of one of the perf-tests 2019-08-28 14:23:33 +02:00
Lennart Spitzner 4de2862a04 Add commandline flag --no-user-config
Stops brittany from trying to read a user-global config
flag. Together with --config-file, this can be used to pass
one single config to brittany, thereby controlling exactly
and explicit what the inputs of brittany are.
Should be useful for testing stuff that might depend on
config.
2019-08-28 14:23:33 +02:00
Lennart Spitzner 033fdc6517 Apply brittany to Main.hs 2019-08-28 14:23:33 +02:00
Lennart Spitzner bd10c3c4ef Update copyright in commandline notices 2019-08-28 14:23:33 +02:00
Taylor Fausak b769d4aed3
Merge pull request #252 from MazeChaZer/patch-1
README: Fix typo
2019-08-22 08:02:02 -04:00
Jonas Schürmann c36ecd4718
README: Fix typo 2019-08-22 12:53:17 +02:00
Lennart Spitzner 5bf295d082
Merge pull request #247 from pepeiborra/master
Add support for Implicit Params
2019-07-24 00:09:35 +02:00
Lennart Spitzner 6c69388d73
Make errors more descriptive
This is defensive against GHC API guarantees.
2019-07-19 00:12:04 +02:00
pepe iborra a79b5e1a4b Add support for Implicit Params
I don't know what I'm doing, but it type checks

Closes #246
2019-07-14 23:31:11 +01:00
Evan Borden 988d5b4353
Add support for OverloadedLabels
`OverloadedLabels` is a simple enough extension to parse and format. It
is becoming more common with use of `generic-lens`. Since it can be
treated as a `HsVar` its implementation only requires using `docLit`,
along with some marshalling for dealing with `FastString`.
2019-06-23 19:31:05 -05:00
Lennart Spitzner 56f93ba3bb readme: Update paragraph on maintenance/contribution 2019-06-18 15:38:19 +02:00
Lennart Spitzner c818cdae52 Update copyright notice in readme also 2019-06-17 22:39:02 +02:00
Lennart Spitzner b2d8a1ed51 Bump to 0.12.0.0, Update copyright, readme, changelog 2019-06-17 10:54:33 +02:00
Lennart Spitzner 3288ef3bd4 For funs with multiple matches, use the match id as id (fixes #234) 2019-06-16 22:51:18 +02:00
Lennart Spitzner b95bc09a9d Bump upper bound to hspec<2.8 2019-06-12 12:58:08 +02:00
Lennart Spitzner 2b95e747cd Update stack.yaml to allow testing nightly again 2019-06-12 10:44:09 +02:00
Lennart Spitzner 42f566b94a Support QuasiQuotation-splices 2019-06-12 09:17:21 +02:00
Lennart Spitzner 305f98fad7 Update .travis.yml for current ghc versions 2019-06-06 00:34:17 +02:00
Lennart Spitzner 42b9ddaf0f Merge pull request #222 from tchajed/stack-13.14-compat 2019-06-06 00:25:13 +02:00
Lennart Spitzner 3e1938aa7f Merge branch 'master' into stack-13.14-compat
# Conflicts:
#	brittany.cabal
2019-06-05 22:54:18 +02:00
Lennart Spitzner e9a37242ae
Merge pull request #230 from alanz/master
Allow ghc-exactprint-0.6.1
2019-06-05 22:48:29 +02:00
Lennart Spitzner 078f666fd6
Merge pull request #221 from hackeryarn/patch-1
Added Emacs to Editor Integration
2019-06-05 22:46:10 +02:00
Lennart Spitzner 517eda8526 Merge pull request #216 from matt-noonan/master 2019-06-05 22:41:22 +02:00
Lennart Spitzner 4f2673a2eb
Merge pull request #215 from matt-noonan/multiline-app-with-comments
Disable single-line HsApp with argument comments.
2019-06-05 21:06:02 +02:00
Lennart Spitzner f9d70cf546 Refactor CPP slightly, Add test-cases 2019-06-05 21:05:27 +02:00
Lennart Spitzner 09a227fcce Add quick regression-test for fixed issue 2019-06-05 20:12:28 +02:00
Lennart Spitzner 77032326ae
Merge pull request #213 from bsima/nix-build
Add build instructions for nix
2019-06-05 20:07:38 +02:00
Lennart Spitzner 059bb9402e Merge pull request #198 from ruhatch/type-synonyms 2019-06-05 15:56:50 +02:00
Lennart Spitzner ca3c8b6f9e Add one source doc 2019-06-05 15:56:32 +02:00
Lennart Spitzner bd8b743e36 Document terminology "regular comments" 2019-06-05 15:42:47 +02:00
Alan Zimmerman d161648f24 Allow ghc-exactprint-0.6.1 2019-06-02 22:53:00 +02:00
Tej Chajed ffc1e6918c
Add stack configuration for GHC 8.6 2019-05-31 17:00:38 -04:00
Artem Chernyak ff7dca9bb5
Added Emacs to Editor Integration 2019-03-12 21:29:12 -05:00
Matt Noonan 8551600377 Explicitly handle empty HsCase and HsLamCase. 2019-02-04 22:56:46 -05:00
Matt Noonan 6aa537089d Disable single-line HsApp with argument comments. 2019-02-04 15:10:55 -05:00
Ben Sima e67a46f264 Refactor nix expressions
This way, the default.nix file can be imported to other projects. In order to
build brittany, we now need to do `nix build -f release.nix`, which will
pull in the version overrides from shell.nix.
2019-01-29 14:07:08 -08:00
Ben Sima f68fbb3118 Add build instructions for nix 2019-01-26 10:55:29 -08:00
Lennart Spitzner 6c187da8f8 Fix cabal file for doc project 2018-11-30 22:13:02 +01:00
Lennart Spitzner 784e4d0aed Fix prelude.inc handling in .cabal to make new-install work
Hopefully fixes both #162 and #200.
2018-11-30 00:18:54 +01:00
Lennart Spitzner 621e00bf3f Fix indentation (comments) after "if" (Fixes #167) 2018-11-14 14:53:08 +01:00
Rupert Horlick 01e31b4256
Add type fam instance formatting 2018-11-13 17:07:27 -04:00
Lennart Spitzner 1290e8cd27 Bump CI ghc versions (8.4.3->8.4.4, 8.6.1->8.6.2) 2018-11-12 19:00:21 +01:00
Lennart Spitzner 2fb8871d70 Merge branch 'ghc-8.6' 2018-11-12 18:58:16 +01:00
Lennart Spitzner e7d8f59e93 travis-ci: Add ghc-8.6, Clean up a bit 2018-11-04 22:14:02 +01:00
Lennart Spitzner 34735e27ef Add compat with GHC-8.6 API 2018-11-04 22:14:00 +01:00
Lennart Spitzner 9d915232c0 Merge branch 'where-newlines' 2018-11-04 19:23:50 +01:00
Lennart Spitzner 2eb22e730f Add tests for empty lines around where 2018-11-04 18:13:37 +01:00
Lennart Spitzner 522e40c8ed Retain empty lines before "where"
only applies to local "where"s (not module..where)
2018-11-04 18:13:37 +01:00
Lennart Spitzner 268cd333f3
Merge pull request #189 from ruhatch/type-synonyms
Add type synonym formatting
2018-11-04 18:05:29 +01:00
Lennart Spitzner ad5868eb76 Fix spacing bugs, Clean up implemenation
- Normalize spaces on type alias lhs. unnecessary spaces were
  retained previously, e.g.
  "type   (   (   a  :%:   b   ) c   ) = (a , c)"
  had non-optimal output
- Clean up separator usage
- Remove backend hacks (to some degree)
- Minor reformatting and premature optimization
2018-10-27 16:15:28 +02:00
Rupert Horlick e7d8b5f1ab
Fix type synonym comments 2018-10-19 15:55:29 -04:00
Rupert Horlick b249c10054
Deal with parens inside comments on 8.4.3 2018-10-17 17:01:31 -04:00
Rupert Horlick e1b43531a8
Add type synonym formatting 2018-10-16 19:28:30 -04:00
Lennart Spitzner d769f30c15 travis: Prevent duplicate compilation 2018-10-14 18:25:39 +02:00
Lennart Spitzner 9de3564e00 travis: Apply fix to stack and new-build too 2018-10-14 00:56:35 +02:00
Lennart Spitzner 818768cd4b
Merge pull request #187 from ruhatch/master
Add instance formatting, defaulting to ExactPrint in places
2018-10-14 00:46:53 +02:00
Lennart Spitzner 11dc30fbe1 Fix travis setup once more 2018-10-13 23:57:37 +02:00
Lennart Spitzner 38216cdc02 Add longer doc/Refactor stripWhitespace' 2018-10-11 20:14:29 +02:00
Rupert Horlick 66fd44058d
Add instance formatting for simple case 2018-10-10 14:32:58 -04:00
Lennart Spitzner 6dc5561d08
Merge pull request #186 from sergv/unboxed-tuples
Unboxed tuples
2018-09-30 21:19:15 +02:00
Lennart Spitzner 04f441205d Try fix travis new-build test failure with a -j1 2018-09-24 00:09:01 +02:00
Lennart Spitzner 71efa54954 Move tests, minor Refactoring, Add comments 2018-09-23 23:32:05 +02:00
Lennart Spitzner 460bd4dd2b
Merge pull request #185 from 5outh/benjamin/file-name-errors
Append input path name to UnknownNode errors
2018-09-23 22:29:42 +02:00
Sergey Vinokurov 9755db1d05
Unify "(#", "#)" under single name, docParenHashL and docParenHashR 2018-09-18 09:14:20 +01:00
Sergey Vinokurov 6898d3ef44
Lay out unboxed tuples in types 2018-09-18 09:07:15 +01:00
Sergey Vinokurov 281d7a2f81
Lay out unboxed tuples with spaces
This avoids clashes with names like foo#
2018-09-18 09:07:13 +01:00
Sergey Vinokurov 9d7cecaa92
Run tests in prallel 2018-09-17 23:54:56 +01:00
Lennart Spitzner 37e4225c49 Include exact location when printing ErrorUnknownNode 2018-09-18 00:23:23 +02:00
Lennart Spitzner 48482c59a6
Merge pull request #184 from eborden/consolidate-record-expression-layouter
Consolidate record expression layouter
2018-09-17 23:40:47 +02:00
5outh b2795482fa Append input path name to UnknownNode errors 2018-09-17 14:32:20 -04:00
Evan Rutledge Borden 92a1d89983 Consolidate record expression layouter
Both record construction and record layouting have very similar
constructions. These each had their own layouter with slightly different
variations. Variations here lead to subtley different bugs in layout for
nearly identicle syntactic forms.

The record update logic is more advanced and respects `IndentPolicyLeft`.
Instead of keeping these layouters distinct we can consolidate
construction logic into the update logic. This results in a smaller
volume of code and more uniform layouting of syntax for these simlilar
forms.

Record constructors with fields and wildcards are not included in this
consolidation. A TODO has been left to handle this consolidation later.
2018-09-16 15:47:04 -04:00
Lennart Spitzner 932cf70f9b Fix stack yamls for ghc-exactprint bounds 2018-09-13 22:47:25 +02:00
Lennart Spitzner 393258036f Bump bounds to ghc-exactprint-0.5.8 to include pkg-env innoculation 2018-09-13 22:09:12 +02:00
Lennart Spitzner 34e303ae43
Merge pull request #179 from alanz/master
Allow ghc-exactprint 0.5.7.1
2018-09-12 23:25:59 +02:00
Lennart Spitzner 9ae790ede1 Fix .travis script: Prevent duplicated build 2018-09-12 23:22:16 +02:00
Alan Zimmerman 989364093c Allow ghc-exactprint 0.5.7.1 2018-09-12 22:01:43 +02:00
Lennart Spitzner 5e96ae8776
Merge pull request #178 from mightybyte/check-mode
Add check mode for use by test suites
2018-09-11 20:26:49 +02:00
Doug Beardsley 3729a57196 Add check mode for use by test suites
This mode makes no changes to files, but returns 0 (success) when no
changes would be made and 1 (failure) when changes would be made.
2018-09-11 01:25:35 -04:00
Lennart Spitzner 8c5cce5070 Prevent package environment file GHC API stupidities
This fixes the code-path for the commandline interface
(unfortunately not covered by our testsuite).
The other code-path should be covered by the changes in
https://github.com/alanz/ghc-exactprint/pull/68.
2018-08-20 21:19:10 +02:00
Lennart Spitzner 33a4039751
Merge pull request #171 from ChickenProp/fix-type-operator-imports
Fix imports of type operators.
2018-08-19 15:20:06 +02:00
Phil Hazelden a5a24b4220 Fix imports of type operators.
Previously, we could only import a type operator with no subsequent
list, i.e.

    import Foo ( (:.) )

was fine, but

    import Foo ( (:.)(..) )
    import Foo ( (:.)((:.) )
    import Foo ( (:.)(A, b) )

would all break. Brittany would attempt to output them as

    import Foo ( :.(..) )
    import Foo ( :.((:.) )
    import Foo ( :.(A, b) )

I believe the problem was that although `ieName <$> lie` was returning
an `IEWrappedName` with the same contents as used in `layoutWrapped`,
it had different location annotations; and the parentheses are
apparently saved in the location annotations.
2018-08-10 10:01:11 +01:00
Lennart Spitzner 8c5e0ef3b6
Merge pull request #168 from robx/patch-1
Fix a brittany misspelling
2018-08-08 14:12:53 +02:00
Robert c303e45f16
Fix a brittany misspelling 2018-08-06 14:05:10 +02:00
Lennart Spitzner 0aaedb7601
Merge pull request #160 from Tehnix/patch-1
Add note about Atom editor integration in README, fixes #62
2018-07-16 00:31:24 +02:00
Christian Kjær 0c324b19ec
Add note about Atom editor integration in README, fixes #62 2018-07-09 14:29:49 +02:00
Lennart Spitzner 4497fa927f Add a comment about one superfluous docSetParSpacing 2018-07-06 22:57:33 +02:00
Lennart Spitzner ab27825b7b Core layouting algo improvement (non-bottom more effective)
During alt-transform, when gather spacings, previously
we tracked different non-bottom spacings separately even
though they would be treated in the same way during any
future transformations (apart from certain exceptions that
don't practically give better results). Instead we now
merge such spacings into one, giving more space for other
spacings when pruning to the spacings limit.
2018-07-06 22:41:31 +02:00
Lennart Spitzner 3c5670d5cd Fix layouting for OpApps with comments (fixes 159) 2018-07-05 21:31:28 +02:00
Lennart Spitzner 95f42061d2 Fixup for the fix of ExplicitNames/PatternSynonyms for ghc-8.0 2018-07-04 22:42:20 +02:00
Lennart Spitzner d01572ecf4 Switch CI to use ghc-8.4.3 instead of 8.4.1 2018-07-04 22:04:45 +02:00
Lennart Spitzner ab389fe66f Support for -XExplicitNamespaces and -XPatternSynonyms
Properly round-trip export items of the forms "type OPERATOR"
or "pattern SYNONYM"

fixes #158
2018-07-04 21:42:46 +02:00
Lennart Spitzner 0b40dd7c32 Fix deprecation warnings with latest versions of yaml 2018-07-04 21:14:06 +02:00
Lennart Spitzner 4cb3b96f07 Merge branch 'release' 2018-06-20 23:18:21 +02:00
Adam Bergmark 0bcab7c7b3 Allow aeson 1.4.* 2018-06-20 23:14:24 +02:00
Lennart Spitzner b37732d658
Fix README.md installation command 2018-06-20 22:33:46 +02:00
Lennart Spitzner d398fbe7be
Merge pull request #153 from bergmark/aeson
Allow aeson 1.4.*
2018-06-20 22:31:34 +02:00
Adam Bergmark 5ed4612107 Allow aeson 1.4.* 2018-06-18 03:14:39 +02:00
Lennart Spitzner cc0718e964 Add indentation to import-hiding-paragraph 2018-06-04 18:18:44 +02:00
Lennart Spitzner 5816704658 Fix import-hiding-paragraph with policy/=free (fixes #150) 2018-06-04 17:30:50 +02:00
Lennart Spitzner 6725d0e119 Refactor/Auto-format Main, Brittany.Internal 2018-06-04 17:10:10 +02:00
Lennart Spitzner 57c48f64c1 Apply inline config to module header (fixes #151) 2018-06-04 16:57:07 +02:00
Lennart Spitzner bdee27cb59 Add spaces around record braces (single-line) (fixes #126) 2018-05-25 17:57:54 +02:00
Lennart Spitzner ef7b0fcc70 Add test for #144 2018-05-16 21:25:40 +02:00
Lennart Spitzner f75127b3a5 Make non-bottom-spacing affect sameline, too (fixes #144) 2018-05-16 21:19:36 +02:00
Lennart Spitzner 1cab9be7ed Merge branch 'release' 2018-05-10 17:55:03 +02:00
Lennart Spitzner ac0a5bd7c7
Merge pull request #141 from leonschoorl/fix-readme-link
Fix link to README.md
2018-05-07 13:53:26 +02:00
Leon Schoorl 82b59299cb Fix link to README.md 2018-05-07 11:59:40 +02:00
632 changed files with 12875 additions and 12879 deletions

30
.devcontainer/Dockerfile Normal file
View File

@ -0,0 +1,30 @@
ARG UBUNTU_TAG=20.04
FROM ubuntu:"$UBUNTU_TAG"
ENV LANG=C.UTF-8
RUN \
apt-get update && \
apt-get install --assume-yes curl gcc git libgmp-dev libtinfo-dev make sudo
ARG GHCUP_VERSION=0.1.17.4
RUN \
curl --output /usr/local/bin/ghcup "https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION" && \
chmod +x /usr/local/bin/ghcup && \
ghcup --version
ARG USER_NAME=haskell
RUN \
useradd --create-home --shell "$( which bash )" "$USER_NAME" && \
echo "$USER_NAME ALL=(ALL) NOPASSWD: ALL" | tee "/etc/sudoers.d/$USER_NAME"
USER "$USER_NAME"
ENV PATH="/home/$USER_NAME/.cabal/bin:/home/$USER_NAME/.ghcup/bin:$PATH"
ARG GHC_VERSION=9.0.1
RUN \
ghcup install ghc "$GHC_VERSION" --set && \
ghc --version
ARG CABAL_VERSION=3.6.2.0
RUN \
ghcup install cabal "$CABAL_VERSION" --set && \
cabal --version

View File

@ -0,0 +1,6 @@
{
"build": {
"dockerfile": "Dockerfile"
},
"postCreateCommand": "cabal update"
}

105
.github/workflows/ci.yaml vendored Normal file
View File

@ -0,0 +1,105 @@
name: CI
on:
pull_request:
branches:
- main
- master
push:
branches:
- main
- master
release:
types:
- created
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- { os: macos-11, ghc: 9.0.1, cabal: 3.6.2.0 }
- { os: ubuntu-20.04, ghc: 9.0.1, cabal: 3.6.2.0 }
- { os: windows-2019, ghc: 9.0.1, cabal: 3.6.2.0, ext: .exe }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: mkdir artifact
- run: mkdir artifact/${{ matrix.os }}
- id: setup-haskell
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- run: cabal configure --enable-tests --flags pedantic --jobs
- run: cabal freeze
- run: cat cabal.project.freeze
- uses: actions/cache@v2
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-
${{ matrix.os }}-${{ matrix.ghc }}-
- run: cabal build
- run: cabal install --installdir artifact/${{ matrix.os }} --install-method copy
- run: cabal test --test-show-details direct
- run: cabal check
- run: cabal sdist --output-dir artifact/${{ matrix.os }}
- uses: svenstaro/upx-action@v2
with:
file: artifact/${{ matrix.os }}/brittany${{ matrix.ext }}
- uses: actions/upload-artifact@v2
with:
path: artifact
name: brittany-${{ github.sha }}
release:
needs: build
if: github.event_name == 'release'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: brittany-${{ github.sha }}
path: artifact
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_content_type: application/octet-stream
asset_name: brittany-${{ github.event.release.tag_name }}-ubuntu
asset_path: artifact/ubuntu-20.04/brittany
upload_url: ${{ github.event.release.upload_url }}
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_content_type: application/octet-stream
asset_name: brittany-${{ github.event.release.tag_name }}-macos
asset_path: artifact/macos-11/brittany
upload_url: ${{ github.event.release.upload_url }}
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_content_type: application/octet-stream
asset_name: brittany-${{ github.event.release.tag_name }}-windows.exe
asset_path: artifact/windows-2019/brittany.exe
upload_url: ${{ github.event.release.upload_url }}
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_content_type: application/gzip
asset_name: brittany-${{ github.event.release.tag_name }}.tar.gz
asset_path: artifact/ubuntu-20.04/brittany-${{ github.event.release.tag_name }}.tar.gz
upload_url: ${{ github.event.release.upload_url }}
- run: cabal upload --publish --username '${{ secrets.HACKAGE_USERNAME }}' --password '${{ secrets.HACKAGE_PASSWORD }}' artifact/ubuntu-20.04/brittany-${{ github.event.release.tag_name }}.tar.gz

5
.gitignore vendored
View File

@ -8,7 +8,8 @@ dist/
dist-newstyle/
local/
.cabal-sandbox/
.stack-work/
cabal.sandbox.config
cabal.project.local
cabal.project.local*
cabal.project.freeze
.ghc.environment.*
result

View File

@ -5,20 +5,12 @@
# This file contains a template configuration file, which is typically
# placed as .hlint.yaml in the root of your project
# Specify additional command line arguments
- arguments:
[ "--cpp-include=srcinc"
, "--language=GADTs"
, "--language=LambdaCase"
, "--language=MultiWayIf"
, "--language=KindSignatures"
, "--cross"
, "--threads=0"
]
- ignore: {name: "Use camelCase"}
- ignore: {name: "Redundant as"}
- ignore: { name: 'Use :' }
- ignore: { name: Eta reduce }
- ignore: { name: Move brackets to avoid $ }
- ignore: { name: Redundant $ }
- ignore: { name: Redundant bracket }
- ignore: { name: Use newtype instead of data }
- ignore: {name: "Redundant do"}
- ignore: {name: "Redundant return"}
- ignore: {name: "Redundant guard", whithin: "lrdrNameToTextAnn"}
- ignore: {name: "Use camelCase"}

View File

@ -1,298 +0,0 @@
# Use new container infrastructure to enable caching
sudo: false
# Do not choose a language; we provide our own build tools.
language: generic
# Caching so the next build will be fast too.
cache:
directories:
- $HOME/.cabsnap
- $HOME/.cabal/packages
- $HOME/.stack
- $HOME/.cabal/store
# alternatively:
#- $HOME/.stack/bin
#- $HOME/.stack/precompiled
#- $HOME/.stack/programs
#- $HOME/.stack/setup-exe-cache
#- $HOME/.stack/snapshots
before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
# remove files that are regenerated by 'cabal update'
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
# The different configurations we want to test. We have
# - BUILD=cabal which uses cabal-install(<2.0)
# - BUILD=canew which uses cabal-install 2.0 "new-build"
# - BUILD=stack which uses Stack.
#
# We set the compiler values here to tell Travis to use a different
# cache file per set of arguments.
#
# If you need to have different apt packages for each combination in the
# matrix, you can use a line such as:
# addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
matrix:
include:
# We grab the appropriate GHC and cabal-install versions from hvr's PPA. See:
# https://github.com/hvr/multi-ghc-travis
#- env: BUILD=cabal GHCVER=7.0.4 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
# compiler: ": #GHC 7.0.4"
# addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
#- env: BUILD=cabal GHCVER=7.2.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
# compiler: ": #GHC 7.2.2"
# addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
#- env: BUILD=cabal GHCVER=7.4.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
# compiler: ": #GHC 7.4.2"
# addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
#- env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
# compiler: ": #GHC 7.6.3"
# addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
#- env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18 HAPPYVER=1.19.5 ALEXVER=3.1.7
# compiler: ": #GHC 7.8.4"
# addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
#- env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22 HAPPYVER=1.19.5 ALEXVER=3.1.7
# compiler: ": #GHC 7.10.3"
# addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
##### OSX test via stack #####
# Build on macOS in addition to Linux
- env: BUILD=stack ARGS="--stack-yaml stack-8.2.2.yaml"
compiler: ": #stack 8.2.2 osx"
os: osx
##### CABAL #####
- env: BUILD=cabal GHCVER=8.0.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
compiler: ": #cabal 8.0.2"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
- env: BUILD=cabal GHCVER=8.2.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
compiler: ": #cabal 8.2.2"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
- env: BUILD=cabal GHCVER=8.4.1 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
compiler: ": #cabal 8.4.1"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.4.1,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
# Build with the newest GHC and cabal-install. This is an accepted failure,
# see below.
#- env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
# compiler: ": #GHC HEAD"
# addons: {apt: {packages: [cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
##### CABAL DIST CHECK
- env: BUILD=cabaldist GHCVER=8.2.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
compiler: ": #cabal 8.2.2 dist"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
##### CANEW #####
- env: BUILD=canew GHCVER=8.2.2 CABALVER=2.0 HAPPYVER=1.19.5 ALEXVER=3.1.7
compiler: ": #cabal new 8.2.2"
addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
##### STACK #####
# The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
# variable, such as using --stack-yaml to point to a different file.
- env: BUILD=stack ARGS=""
compiler: ": #stack default"
addons: {apt: {packages: [libgmp-dev]}}
#- env: BUILD=stack ARGS="--resolver lts-2"
# compiler: ": #stack 7.8.4"
# addons: {apt: {packages: [libgmp-dev]}}
#- env: BUILD=stack ARGS="--resolver lts-3"
# compiler: ": #stack 7.10.2"
# addons: {apt: {packages: [libgmp-dev]}}
#- env: BUILD=stack ARGS="--resolver lts-6"
# compiler: ": #stack 7.10.3"
# addons: {apt: {packages: [libgmp-dev]}}
#- env: BUILD=stack ARGS="--resolver lts-7"
# compiler: ": #stack 8.0.1"
# addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack ARGS="--stack-yaml stack-8.0.2.yaml"
compiler: ": #stack 8.0.2"
addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack ARGS="--stack-yaml stack-8.2.2.yaml"
compiler: ": #stack 8.2.2"
addons: {apt: {packages: [libgmp-dev]}}
# Nightly builds are allowed to fail
- env: BUILD=stack ARGS="--resolver nightly"
compiler: ": #stack nightly"
addons: {apt: {packages: [libgmp-dev]}}
# Travis includes an macOS which is incompatible with GHC 7.8.4
#- env: BUILD=stack ARGS="--resolver lts-2"
# compiler: ": #stack 7.8.4 osx"
# os: osx
#- env: BUILD=stack ARGS="--resolver lts-3"
# compiler: ": #stack 7.10.2 osx"
# os: osx
#- env: BUILD=stack ARGS="--resolver lts-6"
# compiler: ": #stack 7.10.3 osx"
# os: osx
#- env: BUILD=stack ARGS="--resolver lts-7"
# compiler: ": #stack 8.0.1 osx"
# os: osx
#- env: BUILD=stack ARGS="--resolver lts-8"
# compiler: ": #stack 8.0.2 osx"
# os: osx
#- env: BUILD=stack ARGS="--resolver nightly"
# compiler: ": #stack nightly osx"
# os: osx
allow_failures:
#- env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
- env: BUILD=stack ARGS="--resolver nightly"
- env: BUILD=stack ARGS=""
before_install:
# Using compiler above sets CC to an invalid value, so unset it
- unset CC
# We want to always allow newer versions of packages when building on GHC HEAD
- CABALARGS=""
- if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi
# Download and unpack the stack executable
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:/opt/alex/$ALEXVER/bin:/opt/happy/$HAPPYVER/bin:$HOME/.cabal/bin:$PATH
- mkdir -p ~/.local/bin
- |
if [ `uname` = "Darwin" ]
then
travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
else
travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
fi
# Use the more reliable S3 mirror of Hackage
#mkdir -p $HOME/.cabal
#echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config
#echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config
#if [ "$CABALVER" != "1.16" ]
#then
# echo 'jobs: $ncpus' >> $HOME/.cabal/config
#fi
- PKGNAME='brittany'
- JOBS='1'
- |
function better_wait() {
date
time "$@" & # send the long living command to background!
set +x
MINUTES=0
LIMIT=30
while kill -0 $! >/dev/null 2>&1; do
echo -n -e " \b" # never leave evidences!
if [ $MINUTES == $LIMIT ]; then
break;
fi
MINUTES=$((MINUTES+1))
sleep 60
done
wait $!
set -x
}
install:
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- if [ -f configure.ac ]; then autoreconf -i; fi
- |
set -ex
case "$BUILD" in
stack)
stack -j$JOBS --no-terminal --install-ghc $ARGS test --bench --only-dependencies
;;
cabal*)
cabal --version
echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
then
zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >$HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
fi
travis_retry cabal update -v
sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
# check whether current requested install-plan matches cached package-db snapshot
if diff -u $HOME/.cabsnap/installplan.txt installplan.txt;
then
echo "cabal build-cache HIT";
rm -rfv .ghc;
cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
else
echo "cabal build-cache MISS";
rm -rf $HOME/.cabsnap;
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
cabal install -j$JOBS --only-dependencies --enable-tests --enable-benchmarks --ghc-options="-j1 +RTS -M500M -RTS";
fi
# snapshot package-db on cache miss
if [ ! -d $HOME/.cabsnap ];
then
echo "snapshotting package-db to build-cache";
mkdir $HOME/.cabsnap;
cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
fi
;;
canew)
cabal --version
travis_retry cabal update -v
echo 'packages: .' > cabal.project
echo 'package brittany' > cabal.project.local
echo ' ghc-options: -Werror' >> cabal.project.local
rm -f cabal.project.freeze
cabal new-build -j$JOBS --enable-test --enable-benchmarks --dep
cabal new-build -j$JOBS --disable-tests --disable-benchmarks --dep
;;
esac
set +ex
script:
- |
set -ex
case "$BUILD" in
stack)
better_wait stack -j$JOBS --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps --ghc-options="-j1 +RTS -M500M -RTS -Werror"
;;
cabal)
if [ -f configure.ac ]; then autoreconf -i; fi
cabal configure --enable-tests --enable-benchmarks -v # -v2 provides useful information for debugging
better_wait cabal build -j$JOBS --ghc-options="-j1 +RTS -M500M -RTS -Werror" # this builds all libraries and executables (including tests/benchmarks)
cabal test
;;
cabaldist)
# cabal check
cabal sdist # tests that a source-distribution can be generated
# Check that the resulting source distribution can be built & installed.
# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
# `cabal install --force-reinstalls dist/*-*.tar.gz`
SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
(cd dist && better_wait cabal install -j$JOBS --force-reinstalls "$SRC_TGZ" --ghc-options="-j1 +RTS -M500M -RTS")
;;
canew)
better_wait cabal new-build -j$JOBS --disable-tests --disable-benchmarks
better_wait cabal new-build -j$JOBS --enable-tests --enable-benchmarks
cabal new-test --ghc-options="-j1 +RTS -M500M -RTS"
;;
esac
set +ex

5
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"recommendations": [
"taylorfausak.purple-yolk"
]
}

6
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"purple-yolk.brittany.command": "cabal exec -- brittany --write-mode inplace",
"purple-yolk.ghci.command": "cabal repl --repl-options -ddump-json",
"purple-yolk.hlint.command": "false",
"purple-yolk.hlint.onSave": false
}

View File

@ -1,5 +1,118 @@
# Revision history for brittany
## 0.14.0.0 -- November 2021
* #357: Added support for GHC 9.0. Dropped support for all other versions of GHC.
* ab59e9acc3069551ac4132321b285d000f5f5691: Removed runtime dependency on `ghc-paths`.
* fa8365a7fa9372043d5a1018f2f7669ce3853edd: Started providing pre-built binaries for Linux, MacOS, and Windows.
* Many other changes to Brittany's internals and exposed Haskell interface, but (hopefully) no changes to its command-line interface.
## 0.13.1.2 -- May 2021
* #347: Allowed hspec 2.8. Thanks @felixonmars!
## 0.13.1.1 -- February 2021
* #333: Allowed random 1.2. Thanks @felixonmars!
* #334: Updated Arch install instructions. Thanks @ahstro!
* #343: Allowed ghc-exactprint 0.6.4. Thanks @maralorn!
## 0.13.1.0 -- December 2020
* #330: Started sorting imports. Thanks @expipiplus1!
## 0.13.0.0 -- December 2020
* #324: Added support for GHC 8.10.
* Dropped support for GHC 8.4, 8.2, and 8.0.
* Thanks @jneira, @bubba, @infinity0, and @expipiplus1!
## 0.12.2.0 -- November 2020
* #207: Fix newtype indent in associated type family.
* #231: Improve comments-affecting-layout behaviour for tuples.
* #259: Data declaration for newtype and records. Thanks @eborden!
* #263: Fix non-idempotent newlines with comment + where.
* #273: Error handling.
* #281: Fix moving comment in export list (haddock header).
* #286: Fix comments in instance/type instances.
* #287: Add support for pattern synonyms. Thanks @RaoulHC!
* #293: Expose main function as a module. Thanks @soareschen!
* #303: Readme: Supports 8.8. Thanks @andys8!
* #311: Allows aeson-1.5.*. Thanks @jkachmar!
* #313: Nondecreasing export list formatting. Thanks @expipiplus1!
## 0.12.1.1 -- December 2019
* Bugfixes:
- Fix layouting regression of record update for many/large fields
- Fix whitespace regression on ExplicitForall notation
(`foo :: forall a . Show a => a -> a`, note the double space)
introduced in 0.12. (#264)
- Fix roundtripping of type equality constraint
`f :: ((~) a b) => a -> b` (#267)
* One experimental feature addition: Turning brace notation semicolons into
newlines when formatting (see #270)
## 0.12.1.0 -- September 2019
* Support ghc-8.8
* Support for OverloadedLabels extension
(thanks to Evan Rutledge Borden @eborden)
* Support for Implicit Params extension (thanks to pepe iborra @pepeiborra)
* Add flag `--no-user-config` to enable only using manually passed config
* Disable the performance test suite by default to prevent spurious failures
on certain CI setups. The github/travis brittany CI still has all tests
enabled. See the `brittany-test-perf` flag in the cabal file.
* Bugfixes:
- Fix one wandering-comment bug for let-in expressions
- Fix invalid result for prefix operator pattern matches
- Fix lambda expression with laziness/strictness annotation
- Fix parenthesis handling for infix pattern matches with 3+ arguments
* Changes to layouting behaviour:
- For pattern matching and data/instance definitions, the usage of
parenthesis is now "normalized", i.e. superfluous parens are removed by
brittany.
## 0.12.0.0 -- June 2019
* Support for ghc-8.6 (basic support, not necessarily all new syntactic
extensions)
* Support -XExplicitNamespaces and -XPatternSynonyms
* Allow a --dry-run sort of operation via flag "-c/--check-mode"
(thanks to Doug Beardsley @mightybyte)
* Include file name in errors about unsupported syntax nodes (thanks to @5outh)
* Partially implement layouting class instances: Layouts children, but
falls back on ghc-exactprint for the instance head
(thanks to Rupert Horlick @ruhatch)
* Implement layouting for type synonyms (thanks to Rupert Horlick @ruhatch)
* Support -XMagicHash, -XUnboxedTuples (thanks to Sergey Vinokurov @sergv)
* Support -XQuasiQuotes (no formatting applied to the splices; they are simply
retained without causing the dreaded "Unknown construct: HsSpliceE{}")
- `lconfig_allowHangingQuasiQuotes` controls whether multi-line
QuasiQuotes are allowed to start at the end of the current line, or
whether they are always placed in new lines.
* Bugfixes:
- Fix rare-case alignment bug with IndentPolicyMultiple (#144)
- Make inline layout config apply to module header (#151)
- Fix unaligned import-hiding layout (#150)
- Fix idempotence violation for comments around if-then-else (#167)
- Fix comments having an effect on far-away parent node's layout (#159)
- Fix imports of type operators ("symbolic data types")
(thanks to Phil Hazelden @ChickenProp)
- Work around GHC and cabal-install misfeature ".ghc.environment files"
that could break brittany in unexpected and hard-to-understand ways
- Stop removing empty lines before `where` keyword in a couple of cases
- Fix functions with mixing prefix/infix style causing error (#234)
* Changes to layout:
- Align usage of spaces for record update vs record construction (#126)
- More indentation to import-hiding-paragraph (follow-up to #150 fix)
- Record construction and update now are layouted in the same way
(thanks to Evan Rutledge Borden @eborden)
- Stop allowing single-line layout when there are comments between
arguments (#214) (thanks to @matt-noonan)
* Various build-instructions and editor integrations
## 0.11.0.0 -- May 2018
* Support for ghc-8.4
@ -19,13 +132,13 @@
multiline-comments are supported too, although
the specification must still be a single line. E.g.
> "{- brittany --columns 50 -}"
CONFIG is either:
1) one or more flags in the form of what brittany accepts
on the commandline, e.g. "-- columns 50", or
on the commandline, e.g. "--columns 50", or
2) one or more specifications in the form of what brittany
accepts in its config files for the layouting config
(a one-line yaml document), e.g. "{ lconfig_cols: 50 }"

106
README.md
View File

@ -1,4 +1,11 @@
# brittany [![Hackage version](https://img.shields.io/hackage/v/brittany.svg?label=Hackage)](https://hackage.haskell.org/package/brittany) [![Stackage version](https://www.stackage.org/package/brittany/badge/lts?label=Stackage)](https://www.stackage.org/package/brittany) [![Build Status](https://secure.travis-ci.org/lspitzner/brittany.svg?branch=master)](http://travis-ci.org/lspitzner/brittany)
# brittany [![Hackage version](https://img.shields.io/hackage/v/brittany.svg?label=Hackage)](https://hackage.haskell.org/package/brittany) [![Stackage version](https://www.stackage.org/package/brittany/badge/lts?label=Stackage)](https://www.stackage.org/package/brittany) [![Build Status](https://secure.travis-ci.org/lspitzner/brittany.svg?branch=master)](http://travis-ci.org/lspitzner/brittany)
:warning:
This project is effectively unmaintained!
I ([@tfausak](https://github.com/tfausak)) would recommend switching to another formatter.
At time of writing (2022-11-11), I would suggest [Ormolu](https://github.com/tweag/ormolu).
Or if you prefer some configuration, I would suggest [Fourmolu](https://github.com/fourmolu/fourmolu).
haskell source code formatter
![Output sample](https://github.com/lspitzner/brittany/raw/master/brittany-sample.gif)
@ -13,7 +20,7 @@ This project's goals roughly are to:
(but excluding `-XCPP` which is too hard);
- Retain newlines and comments unmodified;
- Be clever about using the available horizontal space while not overflowing
the column maximum if it cannot be avoided;
the column maximum unless it cannot be avoided;
- Be clever about aligning things horizontally (this can be turned off
completely however);
- Have linear complexity in the size of the input.
@ -31,7 +38,7 @@ require fixing:
other module elements (data-decls, classes, instances, etc.)
are not transformed in any way; this extends to e.g. **bindings inside class
instance definitions** - they **won't be touched** (yet).
- By using `ghc-exactprint` as the parser, brittany supports full GHC
- By using `ghc-exactprint` as the parser, brittany supports full GHC
including extensions, but **some of the less common syntactic elements
(even of 2010 haskell) are not handled**.
- **There are some known issues regarding handling of in-source comments.**
@ -48,7 +55,7 @@ log the size of the input, but _not_ the full input/output of requests.)
# Other usage notes
- Supports GHC versions `8.0`, `8.2` and `8.4`.
- Supports GHC version `9.0.x`.
- included in stackage with lts>=10.0 (or nightlies dating to >=2017-11-15)
- config (file) documentation is lacking.
- some config values can not be configured via commandline yet.
@ -58,41 +65,43 @@ log the size of the input, but _not_ the full input/output of requests.)
# Installation
- via `cabal` "old-build"
- via `stack`
~~~~.sh
# optionally:
# mkdir brittany
# cd brittany
# cabal sandbox init
cabal install brittany --bindir=$HOME/.cabal/bin # -w $PATH_TO_GHC_8_0
stack install brittany # --resolver lts-16.31
~~~~
- via `cabal new-build`
If you use an lts that includes brittany this should just work; otherwise
you may want to clone the repo and try again.
- via `cabal`
Due to constant changes to the cabal UI, I have given up on making sure
these instructions work before releases. Please do not expect these
instructions to be up-to-date; they may produce incomprehensible error
messages, they may be broken otherwise, they may work now but break with
the next cabal release. Thanks for your understanding, and feel free to
open issues for any problems you encounter. -- lennart
If you are using cabal-3.0, using
`cabal install brittany --installdir=$HOME/.cabal/bin`
might work. Keep in mind that cabal merely puts a symlink to the "store"
into the installdir, so you have to re-install if you ever clean your
store. On cabal-2.4, try `cabal v2-install brittany`. On cabal-2.2 or
earlier you might be succesful using
```cabal new-build exe:brittany; cp `find dist-newstyle/ -name brittany -type f | xargs -x ls -t | head -n1` $HOME/.cabal/bin/```.
Alternatively, you can also use the v1-approach with sandboxes as
`cabal v1-sandbox init; cabal v1-install brittany --bindir=$HOME/.cabal/bin`.
(TODO: These instructions are more confusing than helpful. I am inclined
to just remove them.)
- on ArchLinux:
~~~~.sh
cabal unpack brittany
cd brittany-0.11.0.0
# cabal new-configure -w $PATH_TO_GHC_8_0
cabal new-build exe:brittany
# and it should be safe to just copy the executable, e.g.
cp `./find dist-newstyle/build/ -type f -name brittany` $HOME/.cabal/bin/
pacman -S haskell-brittany
~~~~
- via `stack` using a sufficiently recent stackage snapshot (dated to >= 2017-11-15)
~~~~.sh
stack install brittany # --resolver lts-10.0
~~~~
(earlier ltss did not include `brittany` yet, but the repo should contain a
`stack.yaml` that works with ghc-8.0.)
- on ArchLinux via [the britanny AUR package](https://aur.archlinux.org/packages/brittany/)
using `aura`:
~~~~.sh
aura -A brittany
~~~~
# Development tips
# Editor Integration
@ -102,26 +111,30 @@ log the size of the input, but _not_ the full input/output of requests.)
#### VSCode
[This extension](https://marketplace.visualstudio.com/items?itemName=MaxGabriel.brittany)
connects commandline `brittany` to VSCode formatting API. Thanks to @MaxGabriel.
#### Via HIE
[haskell-ide-engine](https://github.com/haskell/haskell-ide-engine)
#### Via HLS
[haskell-language-server](https://github.com/haskell/haskell-language-server)
includes a `brittany` plugin that directly uses the brittany library.
Relevant for any editors that properly support the language-server-protocol.
#### Neovim / Vim 8
The [Neoformat](https://github.com/sbdchd/neoformat) plugin comes with support for
brittany built in.
#### Atom
[Atom Beautify](https://atom.io/packages/atom-beautify) supports brittany as a formatter for Haskell. Since the default formatter is set to hindent, you will need to change this setting to brittany, after installing the extension.
#### Emacs
[format-all](https://github.com/lassik/emacs-format-all-the-code) support brittany as the default formatter for Haskell.
# Usage
- Default mode of operation: Transform a single module, from `stdin` to `stdout`.
Can pass one or multiple files as input, and there is a flag to override them
in place instead of using `stdout` (since 0.9.0.0). So:
~~~~ .sh
brittany # stdin -> stdout
brittany mysource.hs # ./mysource.hs -> stdout
brittany --write-mode=inplace *.hs # apply formatting to all ./*.hs inplace
~~~~
- For stdin/stdout usage it makes sense to enable certain syntactic extensions
by default, i.e. to add something like this to your
`~/.config/brittany/config.yaml` (execute `brittany` once to create default):
@ -145,21 +158,30 @@ log the size of the input, but _not_ the full input/output of requests.)
# Feature Requests, Contribution, Documentation
This currently is a one-person project in the sense that 90% of the code is
written by one person. And (unfortunately) it is not my job to keep improving
this project. Please forgive that as a consequence my time to invest on new
features is rather limited.
For a long time this project has had a single maintainer, and as a consequence
there have been some mildly large delays for reacting to feature requests
and even PRs.
Nonetheless I consider it "in active development" :)
Sorry about that.
One way of speeding things up is to make your own contributions. There is
The good news is that this project is getting sponsored by PRODA LTD, and two
previous contributors, Evan Borden and Taylor Fausak, have agreed on helping
with organisational aspects. Thanks!
Still, this project has a long queue of very sensible feature requests, so it
may take some time until new ones get our attention. But with the help of
the co-maintainers, at least the reaction-times on PRs and the frequency
of releases should improve significantly.
If you are interested in making your own contributions, there is
a good amount of high-level documentation at
[the documentation index](doc/implementation/index.md)
# License
Copyright (C) 2016-2018 Lennart Spitzner
Copyright (C) 2016-2019 Lennart Spitzner\
Copyright (C) 2019 PRODA LTD
This program is free software: you can redistribute it and/or modify
it under the terms of the

View File

@ -1,2 +0,0 @@
import Distribution.Simple
main = defaultMain

View File

@ -1,374 +1,149 @@
cabal-version: 2.2
name: brittany
version: 0.11.0.0
version: 0.14.0.2
synopsis: Haskell source code formatter
description: {
description:
See <https://github.com/lspitzner/brittany/blob/master/README.md the README>.
.
If you are interested in the implementation, have a look at <https://github.com/lspitzner/brittany/blob/master/doc/implementation/theory.md this document>;
.
The implementation is documented in more detail <https://github.com/lspitzner/brittany/blob/master/doc/implementation/index.md here>.
}
license: AGPL-3
license: AGPL-3.0-only
license-file: LICENSE
author: Lennart Spitzner
maintainer: Lennart Spitzner <hexagoxel@hexagoxel.de>
copyright: Copyright (C) 2016-2018 Lennart Spitzner
copyright: Copyright (C) 2016-2019 Lennart Spitzner
Copyright (C) 2019 PRODA LTD
category: Language
build-type: Simple
cabal-version: 1.18
homepage: https://github.com/lspitzner/brittany/
bug-reports: https://github.com/lspitzner/brittany/issues
extra-doc-files: {
extra-doc-files:
ChangeLog.md
README.md
doc/implementation/*.md
}
extra-source-files: {
src-literatetests/*.blt
}
extra-source-files:
data/brittany.yaml
data/*.hs
source-repository head {
source-repository head
type: git
location: https://github.com/lspitzner/brittany.git
}
flag brittany-dev-lib
description: set buildable false for anything but lib
flag pedantic
default: False
description: Enables @-Werror@, which turns warnings into errors.
manual: True
library {
default-language:
Haskell2010
hs-source-dirs:
src
install-includes: {
srcinc/prelude.inc
}
exposed-modules: {
common library
build-depends:
, aeson ^>= 2.0.1
, base ^>= 4.15.0
, butcher ^>= 1.3.3
, bytestring ^>= 0.10.12
, cmdargs ^>= 0.10.21
, containers ^>= 0.6.4
, czipwith ^>= 1.0.1
, data-tree-print ^>= 0.1.0
, deepseq ^>= 1.4.5
, directory ^>= 1.3.6
, extra ^>= 1.7.10
, filepath ^>= 1.4.2
, ghc ^>= 9.0.1
, ghc-boot ^>= 9.0.1
, ghc-boot-th ^>= 9.0.1
, ghc-exactprint ^>= 0.6.4
, monad-memo ^>= 0.5.3
, mtl ^>= 2.2.2
, multistate ^>= 0.8.0
, pretty ^>= 1.1.3
, random ^>= 1.2.1
, safe ^>= 0.3.19
, semigroups ^>= 0.19.2
, strict ^>= 0.4.0
, syb ^>= 0.7.2
, text ^>= 1.2.5
, transformers ^>= 0.5.6
, uniplate ^>= 1.6.13
, yaml ^>= 0.11.7
default-language: Haskell2010
ghc-options:
-Weverything
-Wno-all-missed-specialisations
-Wno-incomplete-uni-patterns
-Wno-missing-deriving-strategies
-Wno-missing-export-lists
-Wno-missing-import-lists
-Wno-missing-local-signatures
-Wno-missing-safe-haskell-mode
-Wno-monomorphism-restriction
-Wno-prepositive-qualified-module
-Wno-safe
-Wno-unsafe
if flag(pedantic)
ghc-options: -Werror
common executable
import: library
build-depends: brittany
ghc-options:
-rtsopts
-threaded
-Wno-implicit-prelude
-Wno-unused-packages
library
import: library
autogen-modules: Paths_brittany
hs-source-dirs: source/library
exposed-modules:
Language.Haskell.Brittany
Language.Haskell.Brittany.Internal
Language.Haskell.Brittany.Internal.Prelude
Language.Haskell.Brittany.Internal.PreludeUtils
Language.Haskell.Brittany.Internal.Types
Language.Haskell.Brittany.Internal.Utils
Language.Haskell.Brittany.Internal.Backend
Language.Haskell.Brittany.Internal.BackendUtils
Language.Haskell.Brittany.Internal.Config
Language.Haskell.Brittany.Internal.Config.Types
Language.Haskell.Brittany.Internal.Config.Types.Instances
Language.Haskell.Brittany.Internal.Obfuscation
Paths_brittany
}
other-modules: {
Language.Haskell.Brittany.Internal.LayouterBasics
Language.Haskell.Brittany.Internal.Backend
Language.Haskell.Brittany.Internal.BackendUtils
Language.Haskell.Brittany.Internal.ExactPrintUtils
Language.Haskell.Brittany.Internal.Layouters.Type
Language.Haskell.Brittany.Internal.LayouterBasics
Language.Haskell.Brittany.Internal.Layouters.DataDecl
Language.Haskell.Brittany.Internal.Layouters.Decl
Language.Haskell.Brittany.Internal.Layouters.Expr
Language.Haskell.Brittany.Internal.Layouters.Stmt
Language.Haskell.Brittany.Internal.Layouters.Pattern
Language.Haskell.Brittany.Internal.Layouters.IE
Language.Haskell.Brittany.Internal.Layouters.Import
Language.Haskell.Brittany.Internal.Layouters.Module
Language.Haskell.Brittany.Internal.Layouters.Pattern
Language.Haskell.Brittany.Internal.Layouters.Stmt
Language.Haskell.Brittany.Internal.Layouters.Type
Language.Haskell.Brittany.Internal.Obfuscation
Language.Haskell.Brittany.Internal.ParseModule
Language.Haskell.Brittany.Internal.Prelude
Language.Haskell.Brittany.Internal.PreludeUtils
Language.Haskell.Brittany.Internal.Transformations.Alt
Language.Haskell.Brittany.Internal.Transformations.Floating
Language.Haskell.Brittany.Internal.Transformations.Par
Language.Haskell.Brittany.Internal.Transformations.Columns
Language.Haskell.Brittany.Internal.Transformations.Floating
Language.Haskell.Brittany.Internal.Transformations.Indent
}
ghc-options: {
-Wall
-fno-warn-unused-imports
-fno-warn-redundant-constraints
}
build-depends:
{ base >=4.9 && <4.12
, ghc >=8.0.1 && <8.5
, ghc-paths >=0.1.0.9 && <0.2
, ghc-exactprint >=0.5.6.0 && <0.5.7
, transformers >=0.5.2.0 && <0.6
, containers >=0.5.7.1 && <0.6
, mtl >=2.2.1 && <2.3
, text >=1.2 && <1.3
, multistate >=0.7.1.1 && <0.9
, syb >=0.6 && <0.8
, neat-interpolation >=0.3.2 && <0.4
, data-tree-print
, pretty >=1.1.3.3 && <1.2
, bytestring >=0.10.8.1 && <0.11
, directory >=1.2.6.2 && <1.4
, butcher >=1.3.1 && <1.4
, yaml >=0.8.18 && <0.9
, aeson >=1.0.1.0 && <1.4
, extra >=1.4.10 && <1.7
, uniplate >=1.6.12 && <1.7
, strict >=0.3.2 && <0.4
, monad-memo >=0.4.1 && <0.5
, unsafe >=0.0 && <0.1
, safe >=0.3.9 && <0.4
, deepseq >=1.4.2.0 && <1.5
, semigroups >=0.18.2 && <0.19
, cmdargs >=0.10.14 && <0.11
, czipwith >=1.0.1.0 && <1.1
, ghc-boot-th >=8.0.1 && <8.5
, filepath >=1.4.1.0 && <1.5
, random >= 1.1 && <1.2
}
default-extensions: {
CPP
NoImplicitPrelude
GADTs
FlexibleContexts
FlexibleInstances
ScopedTypeVariables
MonadComprehensions
LambdaCase
MultiWayIf
KindSignatures
}
include-dirs:
srcinc
}
Language.Haskell.Brittany.Internal.Transformations.Par
Language.Haskell.Brittany.Internal.Types
Language.Haskell.Brittany.Internal.Utils
Language.Haskell.Brittany.Main
Paths_brittany
executable brittany
if flag(brittany-dev-lib) {
buildable: False
} else {
buildable: True
}
main-is: Main.hs
other-modules: {
Paths_brittany
}
-- other-extensions:
import: executable
hs-source-dirs: source/executable
main-is: Main.hs
test-suite brittany-test-suite
import: executable
build-depends:
{ brittany
, base
, ghc
, ghc-paths
, ghc-exactprint
, transformers
, containers
, mtl
, text
, multistate
, syb
, neat-interpolation
, data-tree-print
, pretty
, bytestring
, directory
, butcher
, yaml
, aeson
, extra
, uniplate
, strict
, monad-memo
, unsafe
, safe
, deepseq
, semigroups
, cmdargs
, czipwith
, ghc-boot-th
, filepath >=1.4.1.0 && <1.5
}
hs-source-dirs: src-brittany
default-language: Haskell2010
default-extensions: {
CPP
NoImplicitPrelude
GADTs
FlexibleContexts
FlexibleInstances
ScopedTypeVariables
MonadComprehensions
LambdaCase
MultiWayIf
KindSignatures
}
ghc-options: {
-Wall
-fno-spec-constr
-fno-warn-unused-imports
-fno-warn-redundant-constraints
-rtsopts
-with-rtsopts "-M2G"
}
test-suite unittests
if flag(brittany-dev-lib) {
buildable: False
} else {
buildable: True
}
type: exitcode-stdio-1.0
default-language: Haskell2010
build-depends:
{ brittany
, base
, ghc
, ghc-paths
, ghc-exactprint
, transformers
, containers
, mtl
, text
, multistate
, syb
, neat-interpolation
, data-tree-print
, pretty
, bytestring
, directory
, butcher
, yaml
, aeson
, extra
, uniplate
, strict
, monad-memo
, unsafe
, safe
, deepseq
, semigroups
, cmdargs
, czipwith
, ghc-boot-th
, hspec >=2.4.1 && <2.6
}
main-is: TestMain.hs
other-modules: TestUtils
AsymptoticPerfTests
hs-source-dirs: src-unittests
default-extensions: {
CPP
NoImplicitPrelude
GADTs
FlexibleContexts
FlexibleInstances
ScopedTypeVariables
MonadComprehensions
LambdaCase
MultiWayIf
KindSignatures
}
ghc-options: {
-Wall
-fno-warn-unused-imports
-rtsopts
-with-rtsopts "-M2G"
}
test-suite littests
if flag(brittany-dev-lib) {
buildable: False
} else {
buildable: True
}
type: exitcode-stdio-1.0
default-language: Haskell2010
build-depends:
{ brittany
, base
, ghc
, ghc-paths
, ghc-exactprint
, transformers
, containers
, mtl
, text
, multistate
, syb
, neat-interpolation
, data-tree-print
, pretty
, bytestring
, directory
, butcher
, yaml
, aeson
, extra
, uniplate
, strict
, monad-memo
, unsafe
, safe
, deepseq
, semigroups
, cmdargs
, czipwith
, ghc-boot-th
, hspec >=2.4.1 && <2.6
, filepath
, parsec >=3.1.11 && <3.2
}
main-is: Main.hs
other-modules:
hs-source-dirs: src-literatetests
default-extensions: {
CPP
NoImplicitPrelude
GADTs
FlexibleContexts
FlexibleInstances
ScopedTypeVariables
MonadComprehensions
LambdaCase
MultiWayIf
KindSignatures
}
ghc-options: {
-Wall
-fno-warn-unused-imports
-rtsopts
-with-rtsopts "-M2G"
}
test-suite libinterfacetests
if flag(brittany-dev-lib) {
buildable: False
} else {
buildable: True
}
type: exitcode-stdio-1.0
default-language: Haskell2010
build-depends:
{ brittany
, base
, text
, transformers
, hspec >=2.4.1 && <2.6
}
main-is: Main.hs
other-modules:
hs-source-dirs: src-libinterfacetests
default-extensions: {
FlexibleContexts
FlexibleInstances
ScopedTypeVariables
MonadComprehensions
LambdaCase
MultiWayIf
KindSignatures
}
ghc-options: {
-Wall
-fno-warn-unused-imports
-rtsopts
-with-rtsopts "-M2G"
}
, hspec ^>= 2.8.3
hs-source-dirs: source/test-suite
main-is: Main.hs
type: exitcode-stdio-1.0

4
brittany.yaml Normal file
View File

@ -0,0 +1,4 @@
conf_layout:
lconfig_columnAlignMode:
tag: ColumnAlignModeDisabled
lconfig_indentPolicy: IndentPolicyLeft

9
cabal.project Normal file
View File

@ -0,0 +1,9 @@
packages: .
allow-newer:
-- https://github.com/lspitzner/butcher/issues/7
, butcher:base
-- https://github.com/lspitzner/data-tree-print/pull/2
, data-tree-print:base
-- https://github.com/lspitzner/multistate/pull/8
, multistate:base

1
data/Test1.hs Normal file
View File

@ -0,0 +1 @@
func :: a -> a

3
data/Test10.hs Normal file
View File

@ -0,0 +1,3 @@
func
:: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
-> (lakjsdlkjasldkj -> lakjsdlkjasldkj)

1
data/Test100.hs Normal file
View File

@ -0,0 +1 @@
func = klajsdas klajsdas klajsdas

3
data/Test101.hs Normal file
View File

@ -0,0 +1,3 @@
func = lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd

3
data/Test102.hs Normal file
View File

@ -0,0 +1,3 @@
func = lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd lakjsdlajsdljas
lakjsdlajsdljas
lakjsdlajsdljas

1
data/Test103.hs Normal file
View File

@ -0,0 +1 @@
func = (1 +)

1
data/Test104.hs Normal file
View File

@ -0,0 +1 @@
func = (+ 1)

1
data/Test105.hs Normal file
View File

@ -0,0 +1 @@
func = (1 `abc`)

1
data/Test106.hs Normal file
View File

@ -0,0 +1 @@
func = (`abc` 1)

1
data/Test107.hs Normal file
View File

@ -0,0 +1 @@
func = (abc, def)

1
data/Test108.hs Normal file
View File

@ -0,0 +1 @@
func = (abc, )

1
data/Test109.hs Normal file
View File

@ -0,0 +1 @@
func = (, abc)

3
data/Test11.hs Normal file
View File

@ -0,0 +1,3 @@
func
:: (lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd -> lakjsdlkjasldkj)
-> lakjsdlkjasldkj

6
data/Test110.hs Normal file
View File

@ -0,0 +1,6 @@
myTupleSection =
( verylaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaargefirstelement
,
, verylaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaargethirdelement
,
)

4
data/Test111.hs Normal file
View File

@ -0,0 +1,4 @@
func =
( lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
, lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
)

6
data/Test112.hs Normal file
View File

@ -0,0 +1,6 @@
foo = if True
then
-- iiiiii
"a "
else
"b "

5
data/Test113.hs Normal file
View File

@ -0,0 +1,5 @@
func = if cond
then pure 42
else do
-- test
abc

3
data/Test114.hs Normal file
View File

@ -0,0 +1,3 @@
func = case x of
False -> False
True -> True

7
data/Test115.hs Normal file
View File

@ -0,0 +1,7 @@
func =
case
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
of
False -> False
True -> True

7
data/Test116.hs Normal file
View File

@ -0,0 +1,7 @@
func = do
case
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
of
False -> False
True -> True

1
data/Test117.hs Normal file
View File

@ -0,0 +1 @@
func = case x of {}

5
data/Test118.hs Normal file
View File

@ -0,0 +1,5 @@
func =
case
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
of {}

5
data/Test119.hs Normal file
View File

@ -0,0 +1,5 @@
func = do
case
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
of {}

5
data/Test12.hs Normal file
View File

@ -0,0 +1,5 @@
func
:: ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
)
-> lakjsdlkjasldkj

3
data/Test120.hs Normal file
View File

@ -0,0 +1,3 @@
func = do
stmt
stmt

3
data/Test121.hs Normal file
View File

@ -0,0 +1,3 @@
func = do
x <- stmt
stmt x

3
data/Test122.hs Normal file
View File

@ -0,0 +1,3 @@
func = do
let x = 13
stmt x

7
data/Test123.hs Normal file
View File

@ -0,0 +1,7 @@
func =
foooooo
$ [ case
foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
of
_ -> True
]

4
data/Test124.hs Normal file
View File

@ -0,0 +1,4 @@
testMethod foo bar baz qux =
let x = undefined foo bar baz qux qux baz bar :: String
-- some comment explaining the in expression
in undefined foo x :: String

4
data/Test125.hs Normal file
View File

@ -0,0 +1,4 @@
testMethod foo bar baz qux =
let x = undefined :: String
-- some comment explaining the in expression
in undefined :: String

3
data/Test126.hs Normal file
View File

@ -0,0 +1,3 @@
testMethod foo bar baz qux =
-- some comment explaining the in expression
let x = undefined :: String in undefined :: String

6
data/Test127.hs Normal file
View File

@ -0,0 +1,6 @@
foo foo bar baz qux =
let a = 1
b = 2
c = 3
-- some comment explaining the in expression
in undefined :: String

6
data/Test128.hs Normal file
View File

@ -0,0 +1,6 @@
func =
foo
$ [ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
]
++ [ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc]

1
data/Test129.hs Normal file
View File

@ -0,0 +1 @@
module Main where

5
data/Test13.hs Normal file
View File

@ -0,0 +1,5 @@
func
:: ( ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
)
)

1
data/Test130.hs Normal file
View File

@ -0,0 +1 @@
module Main () where

1
data/Test131.hs Normal file
View File

@ -0,0 +1 @@
module Main (main) where

1
data/Test132.hs Normal file
View File

@ -0,0 +1 @@
module Main (main, test1, test2) where

12
data/Test133.hs Normal file
View File

@ -0,0 +1,12 @@
module Main
( main
, test1
, test2
, test3
, test4
, test5
, test6
, test7
, test8
, test9
) where

12
data/Test134.hs Normal file
View File

@ -0,0 +1,12 @@
module Main
( main
-- main
, test1
, test2
-- Test 3
, test3
, test4
-- Test 5
, test5
-- Test 6
) where

1
data/Test135.hs Normal file
View File

@ -0,0 +1 @@
module Main (Test(..)) where

1
data/Test136.hs Normal file
View File

@ -0,0 +1 @@
module Main (module Main) where

1
data/Test137.hs Normal file
View File

@ -0,0 +1 @@
module Main (Test(Test, a, b)) where

6
data/Test138.hs Normal file
View File

@ -0,0 +1,6 @@
-- comment1
module Main
( Test(Test, a, b)
, foo -- comment2
) -- comment3
where

1
data/Test139.hs Normal file
View File

@ -0,0 +1 @@
module Main (Test()) where

1
data/Test14.hs Normal file
View File

@ -0,0 +1 @@
func :: asd -> Either a b

1
data/Test140.hs Normal file
View File

@ -0,0 +1 @@
-- Intentionally left empty

1
data/Test141.hs Normal file
View File

@ -0,0 +1 @@
import Data.List

1
data/Test142.hs Normal file
View File

@ -0,0 +1 @@
import Data.List as L

1
data/Test143.hs Normal file
View File

@ -0,0 +1 @@
import qualified Data.List

1
data/Test144.hs Normal file
View File

@ -0,0 +1 @@
import qualified Data.List as L

1
data/Test145.hs Normal file
View File

@ -0,0 +1 @@
import safe Data.List as L

1
data/Test146.hs Normal file
View File

@ -0,0 +1 @@
import {-# SOURCE #-} Data.List ( )

1
data/Test147.hs Normal file
View File

@ -0,0 +1 @@
import safe qualified Data.List

1
data/Test148.hs Normal file
View File

@ -0,0 +1 @@
import {-# SOURCE #-} safe qualified Data.List

1
data/Test149.hs Normal file
View File

@ -0,0 +1 @@
import qualified "base" Data.List

5
data/Test15.hs Normal file
View File

@ -0,0 +1,5 @@
func
:: asd
-> Either
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd

3
data/Test150.hs Normal file
View File

@ -0,0 +1,3 @@
import {-# SOURCE #-} safe qualified "base" Data.List as L
import {-# SOURCE #-} safe qualified "base" Data.List ( )
import {-# SOURCE #-} safe qualified Data.List hiding ( )

1
data/Test151.hs Normal file
View File

@ -0,0 +1 @@
import qualified Data.List ( )

1
data/Test152.hs Normal file
View File

@ -0,0 +1 @@
import Data.List ( nub )

4
data/Test153.hs Normal file
View File

@ -0,0 +1,4 @@
import Data.List ( foldl'
, indexElem
, nub
)

14
data/Test154.hs Normal file
View File

@ -0,0 +1,14 @@
import Test ( Long
, anymore
, fit
, items
, line
, list
, not
, onA
, quite
, single
, that
, will
, with
)

11
data/Test155.hs Normal file
View File

@ -0,0 +1,11 @@
import Test ( (+)
, (:!)(..)
, (:*)((:.), T7, t7)
, (:.)
, T
, T2()
, T3(..)
, T4(T4)
, T5(T5, t5)
, T6((<|>))
)

3
data/Test156.hs Normal file
View File

@ -0,0 +1,3 @@
import Test hiding ( )
import Test as T
hiding ( )

13
data/Test157.hs Normal file
View File

@ -0,0 +1,13 @@
import Prelude as X
hiding ( head
, init
, last
, maximum
, minimum
, pred
, read
, readFile
, succ
, tail
, undefined
)

3
data/Test158.hs Normal file
View File

@ -0,0 +1,3 @@
import TestJustAbitToLongModuleNameLikeThisOneIs
( )
import TestJustShortEnoughModuleNameLikeThisOne ( )

3
data/Test159.hs Normal file
View File

@ -0,0 +1,3 @@
import TestJustAbitToLongModuleNameLikeThisOneI
as T
import TestJustShortEnoughModuleNameLikeThisOn as T

6
data/Test16.hs Normal file
View File

@ -0,0 +1,6 @@
func
:: asd
-> Trither
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd

3
data/Test160.hs Normal file
View File

@ -0,0 +1,3 @@
import TestJustAbitToLongModuleNameLikeTh
hiding ( )
import TestJustShortEnoughModuleNameLike hiding ( )

10
data/Test161.hs Normal file
View File

@ -0,0 +1,10 @@
import MoreThanSufficientlyLongModuleNameWithSome
( compact
, fit
, inA
, items
, layout
, not
, that
, will
)

11
data/Test162.hs Normal file
View File

@ -0,0 +1,11 @@
import TestJustAbitToLongModuleNameLikeTh
hiding ( abc
, def
, ghci
, jklm
)
import TestJustShortEnoughModuleNameLike hiding ( abc
, def
, ghci
, jklm
)

9
data/Test163.hs Normal file
View File

@ -0,0 +1,9 @@
import {-# SOURCE #-} safe qualified "qualifier" A hiding ( )
import {-# SOURCE #-} safe qualified "qualifiers" A
hiding ( )
import {-# SOURCE #-} safe qualified "qualifiers" AlsoAf as T
import {-# SOURCE #-} safe qualified "qualifiers" AlsoAff ( )
import {-# SOURCE #-} safe qualified "qualifiers" AlsoAff
as T
import {-# SOURCE #-} safe qualified "qualifiers" AlsoAffe
( )

7
data/Test164.hs Normal file
View File

@ -0,0 +1,7 @@
-- Test
import Data.List ( nub ) -- Test
{- Test -}
import qualified Data.List as L
( foldl' ) {- Test -}
-- Test
import Test ( test )

4
data/Test165.hs Normal file
View File

@ -0,0 +1,4 @@
import Test ( abc
, def
-- comment
)

3
data/Test166.hs Normal file
View File

@ -0,0 +1,3 @@
import Test ( abc
-- comment
)

8
data/Test167.hs Normal file
View File

@ -0,0 +1,8 @@
import Test ( abc
-- comment
, def
, ghi
{- comment -}
, jkl
-- comment
)

2
data/Test168.hs Normal file
View File

@ -0,0 +1,2 @@
import Test ( -- comment
)

8
data/Test169.hs Normal file
View File

@ -0,0 +1,8 @@
import Test ( longbindingNameThatoverflowsColum
)
import Test ( Long
( List
, Of
, Things
)
)

6
data/Test17.hs Normal file
View File

@ -0,0 +1,6 @@
func
:: Trither
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
-> asd

18
data/Test170.hs Normal file
View File

@ -0,0 +1,18 @@
import Test ( Thing
( -- Comments
)
)
import Test ( Thing
( Item
-- and Comment
)
)
import Test ( Thing
( With
-- Comments
, and
-- also
, items
-- !
)
)

2
data/Test171.hs Normal file
View File

@ -0,0 +1,2 @@
import VeryLongModuleNameThatCouldEvenCauseAnEmptyBindingListToExpandIntoMultipleLine
( )

26
data/Test172.hs Normal file
View File

@ -0,0 +1,26 @@
{-# LANGUAGE BangPatterns #-}
{-
- Test module
-}
module Test
( test1
-- ^ test
, test2
-- | test
, test3
, test4
, test5
, test6
, test7
, test8
, test9
, test10
-- Test 10
) where
-- Test
import Data.List ( nub ) -- Test
{- Test -}
import qualified Data.List as L
( foldl' ) {- Test -}
-- Test
import Test ( test )

2
data/Test173.hs Normal file
View File

@ -0,0 +1,2 @@
import Aaa
import Baa

5
data/Test174.hs Normal file
View File

@ -0,0 +1,5 @@
import Zaa
import Zab
import Aaa
import Baa

2
data/Test175.hs Normal file
View File

@ -0,0 +1,2 @@
import Boo
import qualified Zoo

3
data/Test176.hs Normal file
View File

@ -0,0 +1,3 @@
import Boo ( a )
import Boo ( b )

Some files were not shown because too many files have changed in this diff Show More