Hello community,

here is the log from the commit of package ghc-aeson-pretty for 
openSUSE:Factory checked in at 2017-07-05 23:57:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-aeson-pretty (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-aeson-pretty.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-aeson-pretty"

Wed Jul  5 23:57:59 2017 rev:5 rq:506797 version:0.8.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-aeson-pretty/ghc-aeson-pretty.changes        
2017-06-22 10:36:48.367963572 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-aeson-pretty.new/ghc-aeson-pretty.changes   
2017-07-05 23:58:00.327891686 +0200
@@ -1,0 +2,5 @@
+Mon Jun 19 20:53:33 UTC 2017 - [email protected]
+
+- Update to version 0.8.5.
+
+-------------------------------------------------------------------

Old:
----
  aeson-pretty-0.8.4.tar.gz

New:
----
  aeson-pretty-0.8.5.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-aeson-pretty.spec ++++++
--- /var/tmp/diff_new_pack.reyGzm/_old  2017-07-05 23:58:01.055789148 +0200
+++ /var/tmp/diff_new_pack.reyGzm/_new  2017-07-05 23:58:01.059788584 +0200
@@ -18,7 +18,7 @@
 
 %global pkg_name aeson-pretty
 Name:           ghc-%{pkg_name}
-Version:        0.8.4
+Version:        0.8.5
 Release:        0
 Summary:        JSON pretty-printing library and command-line tool
 License:        BSD-3-Clause

++++++ aeson-pretty-0.8.4.tar.gz -> aeson-pretty-0.8.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aeson-pretty-0.8.4/Data/Aeson/Encode/Pretty.hs 
new/aeson-pretty-0.8.5/Data/Aeson/Encode/Pretty.hs
--- old/aeson-pretty-0.8.4/Data/Aeson/Encode/Pretty.hs  2017-05-28 
09:59:59.000000000 +0200
+++ new/aeson-pretty-0.8.5/Data/Aeson/Encode/Pretty.hs  2017-06-14 
11:54:24.000000000 +0200
@@ -105,6 +105,8 @@
     , confCompare :: Text -> Text -> Ordering
       -- ^ Function used to sort keys in objects
     , confNumFormat :: NumberFormat
+    , confTrailingNewline :: Bool
+      -- ^ Whether to add a trailing newline to the output
     }
 
 -- |Sort keys by their order of appearance in the argument list.
@@ -118,12 +120,12 @@
 
 
 -- |The default configuration: indent by four spaces per level of nesting, do
---  not sort objects by key.
+--  not sort objects by key, do not add trailing newline.
 --
---  > defConfig = Config { confIndent = Spaces 4, confCompare = mempty, 
confNumFormat = Generic }
+--  > defConfig = Config { confIndent = Spaces 4, confCompare = mempty, 
confNumFormat = Generic, confTrailingNewline = False }
 defConfig :: Config
 defConfig =
-  Config {confIndent = Spaces 4, confCompare = mempty, confNumFormat = Generic}
+  Config {confIndent = Spaces 4, confCompare = mempty, confNumFormat = 
Generic, confTrailingNewline = False}
 
 -- |A drop-in replacement for aeson's 'Aeson.encode' function, producing
 --  JSON-ByteStrings for human readers.
@@ -147,7 +149,7 @@
 -- |A variant of 'encodeToTextBuilder' that takes an additional configuration
 --  parameter.
 encodePrettyToTextBuilder' :: ToJSON a => Config -> a -> Builder
-encodePrettyToTextBuilder' Config{..} = fromValue st . toJSON
+encodePrettyToTextBuilder' Config{..} x = fromValue st (toJSON x) <> trail
   where
     st      = PState 0 indent newline itemSep kvSep confNumFormat sortFn
     indent  = case confIndent of
@@ -161,10 +163,11 @@
                 Spaces 0 -> ":"
                 _        -> ": "
     sortFn  = sortBy (confCompare `on` fst)
+    trail   = if confTrailingNewline then "\n" else ""
 
 
 fromValue :: PState -> Value -> Builder
-fromValue st@PState{..} = go
+fromValue st@PState{..} val = go val
   where
     go (Array v)  = fromCompound st ("[","]") fromValue (V.toList v)
     go (Object m) = fromCompound st ("{","}") fromPair (pSort (H.toList m))
@@ -186,7 +189,7 @@
     items' = mconcat . intersperse (pItemSep <> pNewline) $
                 map (\item -> fromIndent st' <> fromItem st' item)
                     items
-    st' = st { pLevel = pLevel + 1 }
+    st' = st { pLevel = pLevel + 1}
 
 fromPair :: PState -> (Text, Value) -> Builder
 fromPair st (k,v) =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aeson-pretty-0.8.4/aeson-pretty.cabal 
new/aeson-pretty-0.8.5/aeson-pretty.cabal
--- old/aeson-pretty-0.8.4/aeson-pretty.cabal   2017-05-28 10:00:32.000000000 
+0200
+++ new/aeson-pretty-0.8.5/aeson-pretty.cabal   2017-06-14 11:54:42.000000000 
+0200
@@ -1,5 +1,5 @@
 name:           aeson-pretty
-version:        0.8.4
+version:        0.8.5
 license:        BSD3
 license-file:   LICENSE
 category:       Text, Web, JSON, Pretty Printer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aeson-pretty-0.8.4/cli-tool/Main.hs 
new/aeson-pretty-0.8.5/cli-tool/Main.hs
--- old/aeson-pretty-0.8.4/cli-tool/Main.hs     2016-06-30 20:43:17.000000000 
+0200
+++ new/aeson-pretty-0.8.5/cli-tool/Main.hs     2017-06-14 11:51:36.000000000 
+0200
@@ -44,9 +44,10 @@
 main :: IO ()
 main = do
     Opts{..} <- cmdArgs opts
-    let conf = Config { confIndent    = Spaces indent
-                      , confCompare   = if sort then compare else mempty
-                      , confNumFormat = Generic
+    let conf = Config { confIndent          = Spaces indent
+                      , confCompare         = if sort then compare else mempty
+                      , confNumFormat       = Generic
+                      , confTrailingNewline = False
                       }
         enc = if compact then encode else encodePretty' conf
     interact $ unlines . map enc . values


Reply via email to