packages feed

ormolu 0.1.3.0 → 0.1.3.1

raw patch · 4 files changed

+32/−5 lines, 4 files

Files

CHANGELOG.md view
@@ -1,3 +1,8 @@+## Ormolu 0.1.3.1++* Fixed a problem with multiline record updates using the record dot+  preprocessor. [Issue 658](https://github.com/tweag/ormolu/issues/658).+ ## Ormolu 0.1.3.0  * Ormolu no longer overwrites already formatted files. [PR@@ -6,7 +11,7 @@ * Now a space is guaranteed before ticked promoted types. [Issue   631](https://github.com/tweag/ormolu/issues/631). -* Formatting of single-line explicitly bidirectional pattern synonyms+* Made formatting of single-line explicitly bidirectional pattern synonyms   idempotent. [Issue 630](https://github.com/tweag/ormolu/issues/630).  ## Ormolu 0.1.2.0
ormolu.cabal view
@@ -1,10 +1,10 @@ cabal-version:   1.18 name:            ormolu-version:         0.1.3.0+version:         0.1.3.1 license:         BSD3 license-file:    LICENSE.md maintainer:      Mark Karpov <mark.karpov@tweag.io>-tested-with:     ghc ==8.6.5 ghc ==8.8.4 ghc ==8.10.1+tested-with:     ghc ==8.6.5 ghc ==8.8.4 ghc ==8.10.2 homepage:        https://github.com/tweag/ormolu bug-reports:     https://github.com/tweag/ormolu/issues synopsis:        A formatter for Haskell source code@@ -173,7 +173,7 @@         filepath >=1.2 && <1.5,         hspec >=2.0 && <3.0,         ormolu -any,-        path >=0.6 && <0.8,+        path >=0.6 && <0.9,         path-io >=1.4.2 && <2.0,         text >=0.2 && <1.3 
src/Ormolu/Printer/Combinators.hs view
@@ -44,6 +44,7 @@     backticks,     banana,     braces,+    recordDotBraces,     brackets,     parens,     parensHash,@@ -219,6 +220,23 @@ -- | Surround given entity by curly braces @{@ and  @}@. braces :: BracketStyle -> R () -> R () braces = brackets_ False "{" "}"++-- | Surround record update fields which use RecordDot plugin entity by+-- curly braces @{@ and @}@.+--+-- @since 0.1.3.1+recordDotBraces :: R () -> R ()+recordDotBraces m = sitcc (vlayout singleLine multiLine)+  where+    singleLine = do+      txt "{"+      m+      txt "}"+    multiLine = do+      txt "{"+      sitcc m+      newline+      txt "}"  -- | Surround given entity by square brackets @[@ and @]@. brackets :: BracketStyle -> R () -> R ()
src/Ormolu/Printer/Meat/Declaration/Value.hs view
@@ -745,7 +745,11 @@                 Unambiguous _ n -> n                 XAmbiguousFieldOcc x -> noExtCon x             }-    inci . braces N $+        updBraces =+          if useRecordDot' && isPluginForm+            then recordDotBraces+            else inci . braces N+    updBraces $       sep         commaDel         (sitcc . located' (p_hsRecField . updName))