Hello community,

here is the log from the commit of package ghc-yaml for openSUSE:Factory 
checked in at 2019-06-30 10:21:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-yaml (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-yaml.new.4615 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-yaml"

Sun Jun 30 10:21:52 2019 rev:30 rq:712508 version:0.11.1.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-yaml/ghc-yaml.changes        2018-10-25 
08:19:41.539982456 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-yaml.new.4615/ghc-yaml.changes      
2019-06-30 10:21:54.111657531 +0200
@@ -1,0 +2,9 @@
+Sat Jun 29 02:01:17 UTC 2019 - psim...@suse.com
+
+- Update yaml to version 0.11.1.0.
+  ## 0.11.1.0
+
+  * Better error messages in the `Data.Yaml.Config` module 
[#168](https://github.com/snoyberg/yaml/issues/168)
+  * Add `LoadSettingsException` exception and remove error printing from 
`loadYamlSettings` [#172](https://github.com/snoyberg/yaml/pull/172)
+
+-------------------------------------------------------------------

Old:
----
  yaml-0.11.0.0.tar.gz

New:
----
  yaml-0.11.1.0.tar.gz

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

Other differences:
------------------
++++++ ghc-yaml.spec ++++++
--- /var/tmp/diff_new_pack.YrCj5R/_old  2019-06-30 10:21:56.539661302 +0200
+++ /var/tmp/diff_new_pack.YrCj5R/_new  2019-06-30 10:21:56.567661346 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-yaml
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %global pkg_name yaml
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        0.11.0.0
+Version:        0.11.1.0
 Release:        0
 Summary:        Support for parsing and rendering YAML documents
 License:        BSD-3-Clause

++++++ yaml-0.11.0.0.tar.gz -> yaml-0.11.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yaml-0.11.0.0/ChangeLog.md 
new/yaml-0.11.1.0/ChangeLog.md
--- old/yaml-0.11.0.0/ChangeLog.md      2018-10-12 08:00:28.000000000 +0200
+++ new/yaml-0.11.1.0/ChangeLog.md      2019-06-28 03:50:21.000000000 +0200
@@ -1,5 +1,10 @@
 # ChangeLog for yaml
 
+## 0.11.1.0
+
+* Better error messages in the `Data.Yaml.Config` module 
[#168](https://github.com/snoyberg/yaml/issues/168)
+* Add `LoadSettingsException` exception and remove error printing from 
`loadYamlSettings` [#172](https://github.com/snoyberg/yaml/pull/172)
+
 ## 0.11.0.0
 
 * Split out the `libyaml` and `Text.Libyaml` code into its own package. 
[#145](https://github.com/snoyberg/yaml/issues/145)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yaml-0.11.0.0/src/Data/Yaml/Config.hs 
new/yaml-0.11.1.0/src/Data/Yaml/Config.hs
--- old/yaml-0.11.0.0/src/Data/Yaml/Config.hs   2018-10-12 08:00:28.000000000 
+0200
+++ new/yaml-0.11.1.0/src/Data/Yaml/Config.hs   2019-06-26 15:22:21.000000000 
+0200
@@ -180,9 +180,7 @@
     runValues <- forM runTimeFiles $ \fp -> do
         eres <- YI.decodeFileEither fp
         case eres of
-            Left e -> do
-                putStrLn $ "loadYamlSettings: Could not parse file as YAML: " 
++ fp
-                throwIO e
+            Left e -> throwIO (Y.LoadSettingsException fp e)
             Right value -> return value
 
     value' <-
@@ -197,9 +195,9 @@
             UseCustomEnv env     -> return $ applyEnvValue   False env    
value'
             RequireCustomEnv env -> return $ applyEnvValue   True  env    
value'
 
-    case fromJSON value of
-        Error s -> error $ "Could not convert to expected type: " ++ s
-        Success settings -> return settings
+    case Y.parseEither parseJSON value of
+        Left s -> error $ "Could not convert to expected type: " ++ s
+        Right settings -> return settings
 
 -- | Same as @loadYamlSettings@, but get the list of runtime config files from
 -- the command line arguments.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yaml-0.11.0.0/src/Data/Yaml/Internal.hs 
new/yaml-0.11.1.0/src/Data/Yaml/Internal.hs
--- old/yaml-0.11.0.0/src/Data/Yaml/Internal.hs 2018-10-12 08:00:28.000000000 
+0200
+++ new/yaml-0.11.1.0/src/Data/Yaml/Internal.hs 2019-06-26 15:22:21.000000000 
+0200
@@ -62,6 +62,7 @@
                     | OtherParseException SomeException
                     | NonStringKeyAlias Y.AnchorName Value
                     | CyclicIncludes
+                    | LoadSettingsException FilePath ParseException
     deriving (Show, Typeable)
 
 instance Exception ParseException where
@@ -113,6 +114,7 @@
     , "  Value: " ++ show value
     ]
   CyclicIncludes -> "Cyclic includes"
+  LoadSettingsException fp exc -> "Could not parse file as YAML: " ++ fp ++ 
"\n" ++ prettyPrintParseException exc
 
 defineAnchor :: Value -> String -> ReaderT JSONPath (ConduitM e o Parse) ()
 defineAnchor value name = modify (modifyAnchors $ Map.insert name value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yaml-0.11.0.0/test/Data/YamlSpec.hs 
new/yaml-0.11.1.0/test/Data/YamlSpec.hs
--- old/yaml-0.11.0.0/test/Data/YamlSpec.hs     2018-10-12 08:00:28.000000000 
+0200
+++ new/yaml-0.11.1.0/test/Data/YamlSpec.hs     2019-02-12 09:48:15.000000000 
+0100
@@ -8,6 +8,7 @@
 module Data.YamlSpec (main, spec) where
 
 import qualified Text.Libyaml as Y
+import qualified Data.ByteString as BS
 import qualified Data.ByteString.Char8 as B8
 import Data.Int (Int64)
 
@@ -55,6 +56,13 @@
   actual <- D.decodeThrow bs
   actual `shouldBe` expected
 
+testEncodeWith :: Y.FormatOptions -> [Y.Event] -> IO BS.ByteString
+testEncodeWith opts es = runConduitRes (CL.sourceList events .| Y.encodeWith 
opts)
+  where
+    events =
+      [Y.EventStreamStart, Y.EventDocumentStart] ++ es ++
+      [Y.EventDocumentEnd, Y.EventStreamEnd]
+
 main :: IO ()
 main = hspec spec
 
@@ -205,6 +213,103 @@
       go "12.3015e+02" (1230.15 :: Scientific)
       go "1230.15" (1230.15 :: Scientific)
 
+    describe "Text.Libyaml with default tag rendering" $ do
+      let enc = testEncodeWith Y.defaultFormatOptions
+      it "elides custom sequence tags" $
+        enc taggedSequence `shouldReturn` "[]\n"
+      it "elides custom mapping tags" $
+        enc taggedMapping `shouldReturn` "{}\n"
+      it "elides default sequence tags" $
+        enc defaultTaggedSequence `shouldReturn` "[]\n"
+      it "elides default mapping tags" $
+        enc defaultTaggedMapping `shouldReturn` "{}\n"
+      it "handles NoTag on sequences" $
+        enc untaggedSequence `shouldReturn` "[]\n"
+      it "handles NoTag on mappings" $
+        enc untaggedMapping `shouldReturn` "{}\n"
+      it "handles mixed tag usages but elides all mapping and sequence tags" $
+        enc mixedTagSampleA `shouldReturn` "- {}\n"
+      it "in combination of tags, anchors and styles, outputs only the scalar 
tags" $
+        enc mixedTagSampleB `shouldReturn` "&a\n&b !<bar> foo: &c [&d !!null 
'']\n"
+      it "outputs tags when double quoted" $
+        enc [Y.EventScalar "foo" Y.StrTag Y.DoubleQuoted Nothing] 
`shouldReturn` "!!str \"foo\"\n"
+      it "outputs tags when single quoted" $
+        enc [Y.EventScalar "foo" Y.StrTag Y.SingleQuoted Nothing] 
`shouldReturn` "!!str 'foo'\n"
+      it "outputs tags on literal text" $
+        enc [Y.EventScalar "foo" Y.StrTag Y.Literal Nothing] `shouldReturn` 
"!!str |-\n  foo\n"
+      it "outputs tags on folded text" $
+        enc [Y.EventScalar "foo" Y.StrTag Y.Folded Nothing] `shouldReturn` 
"!!str >-\n  foo\n"
+    describe "Text.Libyaml with all tags on" $ do
+      let enc = testEncodeWith $ Y.setTagRendering Y.renderAllTags 
Y.defaultFormatOptions
+      it "will output custom sequence tags" $
+        enc taggedSequence `shouldReturn` "!foo []\n"
+      it "will output custom mapping tags" $
+        enc taggedMapping `shouldReturn` "!foo {}\n"
+      it "will output default sequence tags" $
+        enc defaultTaggedSequence `shouldReturn` "!!seq []\n"
+      it "will output default mapping tags" $
+        enc defaultTaggedMapping `shouldReturn` "!!map {}\n"
+      it "handles NoTag on sequences" $
+        enc untaggedSequence `shouldReturn` "[]\n"
+      it "handles NoTag on mappings" $
+        enc untaggedMapping `shouldReturn` "{}\n"
+      it "handles mixed tag usages outputting all mapping and sequence tags" $
+        enc mixedTagSampleA `shouldReturn` "- !foo {}\n"
+      it "in combination of tags, anchors and styles, outputs all the tags" $
+        enc mixedTagSampleB `shouldReturn` "&a\n&b !<bar> foo: &c !baz [&d 
!!null '']\n"
+      it "outputs plain tags" $
+        enc [Y.EventScalar "foo" Y.StrTag Y.Plain Nothing] `shouldReturn` 
"!!str foo\n"
+      it "respects PlainNoTag tags" $
+        enc [Y.EventScalar "foo" Y.StrTag Y.PlainNoTag Nothing] `shouldReturn` 
"foo\n"
+    describe "Text.Libyaml with uri tags on" $ do
+      let enc = testEncodeWith $ Y.setTagRendering Y.renderUriTags 
Y.defaultFormatOptions
+      it "will output custom sequence tags" $
+        enc taggedSequence `shouldReturn` "!foo []\n"
+      it "will output custom mapping tags" $
+        enc taggedMapping `shouldReturn` "!foo {}\n"
+      it "will output default sequence tags" $
+        enc defaultTaggedSequence `shouldReturn` "[]\n"
+      it "will output default mapping tags" $
+        enc defaultTaggedMapping `shouldReturn` "{}\n"
+      it "handles NoTag on sequences" $
+        enc untaggedSequence `shouldReturn` "[]\n"
+      it "handles NoTag on mappings" $
+        enc untaggedMapping `shouldReturn` "{}\n"
+      it "handles mixed tag usages outputting all mapping and sequence tags" $
+        enc mixedTagSampleA `shouldReturn` "- !foo {}\n"
+      it "in combination of tags, anchors and styles, outputs all the tags" $
+        enc mixedTagSampleB `shouldReturn` "&a\n&b !<bar> foo: &c !baz [&d 
'']\n"
+    describe "Text.Libyaml with tags off" $ do
+      let enc = testEncodeWith $ Y.setTagRendering Y.renderNoTags 
Y.defaultFormatOptions
+      it "outputs plain tags" $
+        enc [Y.EventScalar "foo" Y.StrTag Y.Plain Nothing] `shouldReturn` 
"foo\n"
+      it "respects PlainNoTag tags" $
+        enc [Y.EventScalar "foo" Y.StrTag Y.PlainNoTag Nothing] `shouldReturn` 
"foo\n"
+      it "elides tags when double quoted" $
+        enc [Y.EventScalar "foo" Y.StrTag Y.DoubleQuoted Nothing] 
`shouldReturn` "\"foo\"\n"
+      it "elides tags when single quoted" $
+        enc [Y.EventScalar "foo" Y.StrTag Y.SingleQuoted Nothing] 
`shouldReturn` "'foo'\n"
+      it "elides tags on literal text" $
+        enc [Y.EventScalar "foo" Y.StrTag Y.Literal Nothing] `shouldReturn` 
"|-\n  foo\n"
+      it "elides tags on folded text" $
+        enc [Y.EventScalar "foo" Y.StrTag Y.Folded Nothing] `shouldReturn` 
">-\n  foo\n"
+    describe "Text.Libyaml with only UriTags set to render " $ do
+      let enc =
+            testEncodeWith $
+            Y.setTagRendering Y.renderUriTags $ Y.defaultFormatOptions
+      it "outputs only UriTags" $
+        enc
+          [ Y.EventSequenceStart Y.NoTag Y.FlowSequence Nothing
+          , Y.EventScalar "foo" Y.StrTag Y.DoubleQuoted Nothing
+          , Y.EventScalar "99" Y.IntTag Y.Plain Nothing
+          , Y.EventScalar "99.99" Y.FloatTag Y.Plain Nothing
+          , Y.EventScalar "bar" Y.NoTag Y.Plain Nothing
+          , Y.EventScalar "foo" (Y.UriTag "!foo") Y.DoubleQuoted Nothing
+          , Y.EventScalar "foo" (Y.UriTag "!foo") Y.Plain Nothing
+          , Y.EventSequenceEnd
+          ] `shouldReturn`
+        "[\"foo\", 99, 99.99, bar, !foo \"foo\", !foo foo]\n"
+
 specialStrings :: [T.Text]
 specialStrings =
     [ "fo\"o"
@@ -622,3 +727,50 @@
     D.encodeFile fp val
     res <- D.decodeFileEither fp
     either (Left . show) Right res `shouldBe` Right val
+
+
+taggedSequence :: [Y.Event]
+taggedSequence =
+  [ Y.EventSequenceStart (Y.UriTag "!foo") Y.FlowSequence Nothing
+  , Y.EventSequenceEnd
+  ]
+
+taggedMapping :: [Y.Event]
+taggedMapping =
+  [ Y.EventMappingStart (Y.UriTag "!foo") Y.FlowMapping Nothing
+  , Y.EventMappingEnd
+  ]
+
+defaultTaggedSequence :: [Y.Event]
+defaultTaggedSequence =
+  [Y.EventSequenceStart Y.SeqTag Y.FlowSequence Nothing, Y.EventSequenceEnd]
+
+defaultTaggedMapping :: [Y.Event]
+defaultTaggedMapping =
+  [Y.EventMappingStart Y.MapTag Y.FlowMapping Nothing, Y.EventMappingEnd]
+
+untaggedSequence :: [Y.Event]
+untaggedSequence =
+  [Y.EventSequenceStart Y.NoTag Y.FlowSequence Nothing, Y.EventSequenceEnd]
+
+untaggedMapping :: [Y.Event]
+untaggedMapping =
+  [Y.EventMappingStart Y.NoTag Y.FlowMapping Nothing, Y.EventMappingEnd]
+
+mixedTagSampleA :: [Y.Event]
+mixedTagSampleA =
+  [ Y.EventSequenceStart Y.NoTag Y.BlockSequence Nothing
+  , Y.EventMappingStart (Y.UriTag "!foo") Y.FlowMapping Nothing
+  , Y.EventMappingEnd
+  , Y.EventSequenceEnd
+  ]
+
+mixedTagSampleB :: [Y.Event]
+mixedTagSampleB =
+  [ Y.EventMappingStart Y.NoTag Y.BlockMapping (Just "a")
+  , Y.EventScalar "foo" (Y.UriTag "bar") Y.Plain (Just "b")
+  , Y.EventSequenceStart (Y.UriTag "!baz") Y.FlowSequence (Just "c")
+  , Y.EventScalar "" Y.NullTag Y.Plain (Just "d")
+  , Y.EventSequenceEnd
+  , Y.EventMappingEnd
+  ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yaml-0.11.0.0/yaml.cabal new/yaml-0.11.1.0/yaml.cabal
--- old/yaml-0.11.0.0/yaml.cabal        2018-10-12 08:00:36.000000000 +0200
+++ new/yaml-0.11.1.0/yaml.cabal        2019-06-26 15:23:29.000000000 +0200
@@ -1,13 +1,13 @@
 cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.30.0.
+-- This file has been generated from package.yaml by hpack version 0.31.2.
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: 44126ede97b8c2576f72b255726cbc3a06a12e3547a02cceca6e02c4933029cc
+-- hash: 3a4f2b1c1a7a978d5810ea6223b95b1c51f38f60610704c35e28f8bc667081ba
 
 name:           yaml
-version:        0.11.0.0
+version:        0.11.1.0
 synopsis:       Support for parsing and rendering YAML documents.
 description:    README and API documentation are available at 
<https://www.stackage.org/package/yaml>
 category:       Data


Reply via email to