1
1
mirror of https://github.com/tweag/ormolu.git synced 2024-09-11 13:16:13 +03:00
Commit Graph

195 Commits

Author SHA1 Message Date
Mark Karpov
6cf491c5ca Prioritize fixity overrides and module re-exports from command line 2024-02-01 21:31:13 +01:00
Brandon Chinn
9b3a78f0fd Improve comment placement in if-then-else blocks 2024-01-27 19:36:42 +01:00
Alexander Esgen
74887f0013 Don't error on JavaScriptFFI language pragma 2024-01-10 21:51:15 +01:00
Mark Karpov
fb5fcb3336
Version bump (0.7.3.0) 2023-10-24 20:52:07 +02:00
Alexander Esgen
fc0221cb04 ghc-lib-parser 9.8 2023-10-19 15:43:23 +02:00
Mark Karpov
0de3717538
Version bump (0.7.2.0) 2023-09-06 17:31:21 +02:00
Alexander Esgen
122bcd41bb Fix AST diffing for empty Haddock comments in data decls 2023-09-06 14:28:13 +02:00
Alexander Esgen
367c6b0107 Fix interaction of operators starting with # and UnboxedSums 2023-09-04 17:15:10 +02:00
Alexander Esgen
62e2cf1e32 Move changelog entry for #1048 to correct section 2023-08-23 21:54:06 +02:00
Alexander Esgen
f94567aa2d Put "this" PackageImports at the end 2023-08-18 20:22:49 +02:00
Alexander Esgen
02ceaa2928 Preserve necessary braces for final function arguments 2023-08-01 11:09:11 +02:00
Mark Karpov
4e0fef3f50 Erase lines affected by CPP before attempting to parse pragmas and imports 2023-06-07 12:01:38 +02:00
Mark Karpov
9fabd8cfe1 Support explicit package names in module re-exports in .ormolu
Support explicit mention of target package name in module re-exports. Even
if the exported package is not specified as a direct dependency of the
component being formatted it will be taken into account correctly.
2023-06-05 21:36:24 +02:00
Mark Karpov
a9bb00758e Instruct Ormolu about a common hspec re-export 2023-05-24 23:53:17 +02:00
Brandon Chinn
01cb1e84e2 Pretty print exception in displayException 2023-05-23 09:41:34 +02:00
Brandon Chinn
17ae060c19 Use defaultDependencies when cabal file does not mention file 2023-05-22 10:37:17 +02:00
Mark Karpov
bc4a00b4a1
Version bump (0.7.0.0) 2023-05-17 21:59:53 +02:00
Mark Karpov
83509ebd1a Locate .ormolu file independently of .cabal files 2023-05-17 21:22:01 +02:00
Alexander Esgen
35647fbe62 Format \cases with multi-line multiple patterns correctly 2023-05-17 21:11:30 +02:00
Mark Karpov
8f2bc36705 Allow to specify module re-exports in .ormolu files
It turns out that gaining knowledge of all module re-exports in the
ecosystem is tricky because the Hoogle database does not contain this
information, so one would need to download all 14+k packages from Hackage
and parse their source code. We've decided that perhaps hardcoding some
common re-exports and otherwise giving the users a way to make Ormolu aware
of arbitrary important re-exports is a satisfactory solution for now.

Co-authored-by: amesgen <alexander.esgen@tweag.io>
2023-05-15 20:43:41 +02:00
Mark Karpov
badafc0452 Implement a more precise inference of fixity information 2023-04-24 14:39:33 +02:00
Alexander Esgen
db1ebbba2f Don't let comments escape from empty export lists 2023-04-24 13:54:41 +02:00
Alexander Esgen
683e2a2043 Support DatatypeContexts 2023-04-24 10:32:41 +02:00
Alexander Esgen
2ee0dab98d Improve consistency when formatting certain applicands 2023-04-12 17:21:02 +02:00
Mark Karpov
82563b43f6
Version bump (0.6.0.1) 2023-04-04 18:24:44 +02:00
Alexander Esgen
edc68d1099 Fix false positives in AST diffing related to UnicodeSyntax 2023-04-04 16:57:20 +02:00
Mark Karpov
319541950e
Version bump (0.6.0.0) 2023-04-03 15:51:26 +02:00
Julio César
310f90062c Provide more context on Cabal file parsing errors
When ormolu fails to parse the Cabal file the user doesn't know what is the
actual error as only the cabal filepath is reported. This makes the necessary
changes to actually show what errors the cabal file parser encountered.

Before:
  Parsing this .cabal file failed:
    /path/to/file.cabal

After:
  Parsing this .cabal file failed:
    /path/to/file.cabal:0:0: Unsupported cabal-version 3.8. See https://github.com/haskell/cabal/issues/4899.

Note: Removing the `Eq` instance on `OrmoluException` was the easy way to not
  having to implement an orphan `Eq` instance on `PError`. This does not have
  any impact elsewhere as we're actually not making use of the `Eq` instance
  on this exception type.
2023-03-31 21:11:12 +02:00
Alexander Esgen
9a8481320b ghc-lib-parser 9.6 2023-03-31 20:25:54 +02:00
Alexander Esgen
8aee5c0df3 Insert space before char literals in ticked promoted constructs 2023-03-21 19:29:26 +01:00
Mark Karpov
13f11d0eb3 Format haddocks attached to arguments of data constructors with pipe 2023-02-25 18:44:43 +01:00
Mark Karpov
1b39d94d0c
Version bump (0.5.3.0) 2023-01-26 14:30:23 +01:00
Mark Karpov
c81320d8a1 Expose a more complete API from the Ormolu module
Co-authored-by: amesgen <alexander.esgen@tweag.io>
2023-01-25 20:27:25 +01:00
Alexander Esgen
f0b8690ae1 Use Text as formatting input 2023-01-23 18:30:21 +01:00
Mark Karpov
a4a9f4500b Normalize parentheses in constraints 2023-01-20 18:49:14 +01:00
Mark Karpov
9e4f22e14c Accept CRLF line endings in .ormolu files 2023-01-17 21:14:23 +01:00
Alexander Esgen
708de707ad Stop making empty lets move comments 2023-01-06 17:34:05 +01:00
Mark Karpov
b64a5fd793 Default fixity to infixl 9 2023-01-05 14:04:46 +01:00
Mark Karpov
b545930ca8 Eliminate the fixity-th cabal flag
The flag caused problems on GHC 9.4 and generally was a magnet for bugs, see
https://github.com/tweag/ormolu/issues/941 and
https://github.com/tweag/ormolu/issues/927. We are going to try to use
file-embed unconditionally and make parsing more efficient instead.

Co-authored-by: amesgen <alexander.esgen@tweag.io>
2023-01-03 16:33:02 +01:00
Mark Karpov
1ec862c4e8
Version bump (0.5.1.0) 2022-11-14 17:30:07 +01:00
Alexander Esgen
54642a7966 Switch to ghc-lib-parser-9.4 2022-11-09 19:43:22 +01:00
Brandon Chinn
1e68677e7d Fix an inconsistency in formatting of types in GADT declarations 2022-11-08 20:29:03 +01:00
Alexander Esgen
7bb7f7e47e Handle UnicodeSyntax variants more consistently 2022-11-08 19:38:56 +01:00
Alexander Esgen
570b3175a2 Support type applications in patterns 2022-11-02 16:49:16 +01:00
Alexander Esgen
8aef990d6c Fix formatting of SCC pragmas in do blocks 2022-09-30 17:42:03 +02:00
Alexander Esgen
ef18690191 Put extension packs like GHC2021 at the beginning 2022-09-22 21:03:32 +02:00
Matthew Healy
00618737a4
Sort imports by package qualifier if present (#916)
This fixes #905 by sorting imports first by package qualifier,
if any are included, and then by module name. Imports without
package qualifiers are always sorted before those with.
2022-08-16 17:19:29 +02:00
Mark Karpov
f80f4ec20d
Version bump (0.5.0.1) 2022-08-05 16:26:26 +02:00
Alexander Esgen
3bd79c0869 Cache .cabal file parsing and processing 2022-08-05 16:25:29 +02:00
Mark Karpov
5baf431ebb Indent comments in closed type familiy declarations 2022-08-02 18:59:08 +02:00