openSUSE Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
August 2017
- 1 participants
- 2097 discussions
Hello community,
here is the log from the commit of package stylish-haskell for openSUSE:Factory checked in at 2017-08-31 21:03:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/stylish-haskell (Old)
and /work/SRC/openSUSE:Factory/.stylish-haskell.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "stylish-haskell"
Thu Aug 31 21:03:09 2017 rev:3 rq:513574 version:0.8.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/stylish-haskell/stylish-haskell.changes 2017-03-24 02:16:53.464504389 +0100
+++ /work/SRC/openSUSE:Factory/.stylish-haskell.new/stylish-haskell.changes 2017-08-31 21:03:11.158744948 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:07:44 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.8.1.0.
+
+-------------------------------------------------------------------
Old:
----
stylish-haskell-0.7.1.0.tar.gz
New:
----
stylish-haskell-0.8.1.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ stylish-haskell.spec ++++++
--- /var/tmp/diff_new_pack.wEGzvl/_old 2017-08-31 21:03:12.110611209 +0200
+++ /var/tmp/diff_new_pack.wEGzvl/_new 2017-08-31 21:03:12.146606152 +0200
@@ -19,7 +19,7 @@
%global pkg_name stylish-haskell
%bcond_with tests
Name: %{pkg_name}
-Version: 0.7.1.0
+Version: 0.8.1.0
Release: 0
Summary: Haskell code prettifier
License: BSD-3-Clause
++++++ stylish-haskell-0.7.1.0.tar.gz -> stylish-haskell-0.8.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stylish-haskell-0.7.1.0/CHANGELOG new/stylish-haskell-0.8.1.0/CHANGELOG
--- old/stylish-haskell-0.7.1.0/CHANGELOG 2017-01-24 13:53:59.000000000 +0100
+++ new/stylish-haskell-0.8.1.0/CHANGELOG 2017-06-19 14:23:15.000000000 +0200
@@ -1,5 +1,24 @@
# CHANGELOG
+- 0.8.1.0 (2017-06-19)
+ * Add `pad_module_names` option (by Yuriy Syrovetskiy)
+ * Add `space_surround` option to import styling (by Linus Arver)
+ * Bump `optparse-applicative` to 0.14
+
+- 0.8.0.0
+ * Remove `MagicHash` from whitelisted language extensions, since it was
+ causing parsing errors (by Artyom Kazak)
+ * Don't leave a `#-}` hanging on the next line when `language_pragmas`
+ is set to `compact` and the `#-}` doesn't fit into character limit
+ (by Artyom Kazak)
+ * Deduplicate import specs (i.e. `import Foo (a, a, b)` becomes
+ `import Foo (a, b)`) (by Artyom Kazak)
+ * Take package imports into account when prettifying imports
+ (by Artyom Kazak)
+ * Bump `aeson` to 1.2
+ * Bump `syb` to 0.7
+ * Bump `HUnit` to 1.6
+
- 0.7.1.0
* Keep `safe` and `{-# SOURCE #-}` import annotations (by Moritz Drexl)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stylish-haskell-0.7.1.0/data/stylish-haskell.yaml new/stylish-haskell-0.8.1.0/data/stylish-haskell.yaml
--- old/stylish-haskell-0.7.1.0/data/stylish-haskell.yaml 2017-01-24 13:53:59.000000000 +0100
+++ new/stylish-haskell-0.8.1.0/data/stylish-haskell.yaml 2017-06-19 14:23:15.000000000 +0200
@@ -41,7 +41,7 @@
# Default: global.
align: global
- # Folowing options affect only import list alignment.
+ # The following options affect only import list alignment.
#
# List align has following options:
#
@@ -64,6 +64,25 @@
# Default: after_alias
list_align: after_alias
+ # Right-pad the module names to align imports in a group:
+ #
+ # - true: a little more readable
+ #
+ # > import qualified Data.List as List (concat, foldl, foldr,
+ # > init, last, length)
+ # > import qualified Data.List.Extra as List (concat, foldl, foldr,
+ # > init, last, length)
+ #
+ # - false: diff-safe
+ #
+ # > import qualified Data.List as List (concat, foldl, foldr, init,
+ # > last, length)
+ # > import qualified Data.List.Extra as List (concat, foldl, foldr,
+ # > init, last, length)
+ #
+ # Default: true
+ pad_module_names: true
+
# Long list align style takes effect when import is too long. This is
# determined by 'columns' setting.
#
@@ -75,7 +94,7 @@
# short enough to fit to single line. Otherwise it'll be multiline.
#
# - multiline: One line per import list entry.
- # Type with contructor list acts like single import.
+ # Type with constructor list acts like single import.
#
# > import qualified Data.Map as M
# > ( empty
@@ -109,7 +128,7 @@
# Useful for 'file' and 'group' align settings.
list_padding: 4
- # Separate lists option affects formating of import list for type
+ # Separate lists option affects formatting of import list for type
# or class. The only difference is single space between type and list
# of constructors, selectors and class functions.
#
@@ -126,6 +145,22 @@
# Default: true
separate_lists: true
+ # Space surround option affects formatting of import lists on a single
+ # line. The only difference is single space after the initial
+ # parenthesis and a single space before the terminal parenthesis.
+ #
+ # - true: There is single space associated with the enclosing
+ # parenthesis.
+ #
+ # > import Data.Foo ( foo )
+ #
+ # - false: There is no space associated with the enclosing parenthesis
+ #
+ # > import Data.Foo (foo)
+ #
+ # Default: false
+ space_surround: false
+
# Language pragmas
- language_pragmas:
# We can generate different styles of language pragma lists.
@@ -142,7 +177,7 @@
# Align affects alignment of closing pragma brackets.
#
- # - true: Brackets are aligned in same collumn.
+ # - true: Brackets are aligned in same column.
#
# - false: Brackets are not aligned together. There is only one space
# between actual import and closing bracket.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stylish-haskell-0.7.1.0/lib/Language/Haskell/Stylish/Config.hs new/stylish-haskell-0.8.1.0/lib/Language/Haskell/Stylish/Config.hs
--- old/stylish-haskell-0.7.1.0/lib/Language/Haskell/Stylish/Config.hs 2017-01-24 13:53:59.000000000 +0100
+++ new/stylish-haskell-0.8.1.0/lib/Language/Haskell/Stylish/Config.hs 2017-06-19 14:23:15.000000000 +0200
@@ -184,13 +184,15 @@
<*> (Imports.Options
<$> (o A..:? "align" >>= parseEnum aligns (def Imports.importAlign))
<*> (o A..:? "list_align" >>= parseEnum listAligns (def Imports.listAlign))
+ <*> (o A..:? "pad_module_names" A..!= def Imports.padModuleNames)
<*> (o A..:? "long_list_align"
>>= parseEnum longListAligns (def Imports.longListAlign))
-- Note that padding has to be at least 1. Default is 4.
<*> (o A..:? "empty_list_align"
>>= parseEnum emptyListAligns (def Imports.emptyListAlign))
<*> o A..:? "list_padding" A..!= (def Imports.listPadding)
- <*> o A..:? "separate_lists" A..!= (def Imports.separateLists))
+ <*> o A..:? "separate_lists" A..!= (def Imports.separateLists)
+ <*> o A..:? "space_surround" A..!= (def Imports.spaceSurround))
where
def f = f Imports.defaultOptions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stylish-haskell-0.7.1.0/lib/Language/Haskell/Stylish/Parse.hs new/stylish-haskell-0.8.1.0/lib/Language/Haskell/Stylish/Parse.hs
--- old/stylish-haskell-0.7.1.0/lib/Language/Haskell/Stylish/Parse.hs 2017-01-24 13:53:59.000000000 +0100
+++ new/stylish-haskell-0.8.1.0/lib/Language/Haskell/Stylish/Parse.hs 2017-06-19 14:23:15.000000000 +0200
@@ -24,7 +24,6 @@
[ H.GADTs
, H.HereDocuments
, H.KindSignatures
- , H.MagicHash
, H.NewQualifiedOperators
, H.PatternGuards
, H.StandaloneDeriving
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stylish-haskell-0.7.1.0/lib/Language/Haskell/Stylish/Step/Imports.hs new/stylish-haskell-0.8.1.0/lib/Language/Haskell/Stylish/Step/Imports.hs
--- old/stylish-haskell-0.7.1.0/lib/Language/Haskell/Stylish/Step/Imports.hs 2017-01-24 13:53:59.000000000 +0100
+++ new/stylish-haskell-0.8.1.0/lib/Language/Haskell/Stylish/Step/Imports.hs 2017-06-19 14:23:15.000000000 +0200
@@ -1,5 +1,5 @@
-{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
--------------------------------------------------------------------------------
module Language.Haskell.Stylish.Step.Imports
( Options (..)
@@ -16,13 +16,16 @@
--------------------------------------------------------------------------------
import Control.Arrow ((&&&))
import Control.Monad (void)
+import qualified Data.Aeson as A
+import qualified Data.Aeson.Types as A
import Data.Char (toLower)
import Data.List (intercalate, sortBy)
+import qualified Data.Map as M
import Data.Maybe (isJust, maybeToList)
+import Data.Monoid ((<>))
import Data.Ord (comparing)
+import qualified Data.Set as S
import qualified Language.Haskell.Exts as H
-import qualified Data.Aeson as A
-import qualified Data.Aeson.Types as A
--------------------------------------------------------------------------------
@@ -35,20 +38,24 @@
data Options = Options
{ importAlign :: ImportAlign
, listAlign :: ListAlign
+ , padModuleNames :: Bool
, longListAlign :: LongListAlign
, emptyListAlign :: EmptyListAlign
, listPadding :: ListPadding
, separateLists :: Bool
+ , spaceSurround :: Bool
} deriving (Eq, Show)
defaultOptions :: Options
defaultOptions = Options
{ importAlign = Global
, listAlign = AfterAlias
+ , padModuleNames = True
, longListAlign = Inline
, emptyListAlign = Inherit
, listPadding = LPConstant 4
, separateLists = True
+ , spaceSurround = False
}
data ListPadding
@@ -81,6 +88,16 @@
| Multiline
deriving (Eq, Show)
+
+--------------------------------------------------------------------------------
+
+modifyImportSpecs :: ([H.ImportSpec l] -> [H.ImportSpec l])
+ -> H.ImportDecl l -> H.ImportDecl l
+modifyImportSpecs f imp = imp {H.importSpecs = f' <$> H.importSpecs imp}
+ where
+ f' (H.ImportSpecList l h specs) = H.ImportSpecList l h (f specs)
+
+
--------------------------------------------------------------------------------
imports :: H.Module l -> [H.ImportDecl l]
imports (H.Module _ _ _ is _) = is
@@ -91,16 +108,94 @@
importName :: H.ImportDecl l -> String
importName i = let (H.ModuleName _ n) = H.importModule i in n
+importPackage :: H.ImportDecl l -> Maybe String
+importPackage i = H.importPkg i
+
+
+--------------------------------------------------------------------------------
+-- | A "compound import name" is import's name and package (if present). For
+-- instance, if you have an import @Foo.Bar@ from package @foobar@, the full
+-- name will be @"foobar" Foo.Bar@.
+compoundImportName :: H.ImportDecl l -> String
+compoundImportName i =
+ case importPackage i of
+ Nothing -> importName i
+ Just pkg -> show pkg ++ " " ++ importName i
+
--------------------------------------------------------------------------------
longestImport :: [H.ImportDecl l] -> Int
-longestImport = maximum . map (length . importName)
+longestImport = maximum . map (length . compoundImportName)
--------------------------------------------------------------------------------
-- | Compare imports for ordering
compareImports :: H.ImportDecl l -> H.ImportDecl l -> Ordering
-compareImports = comparing (map toLower . importName &&& H.importQualified)
+compareImports =
+ comparing (map toLower . importName &&&
+ fmap (map toLower) . importPackage &&&
+ H.importQualified)
+
+
+--------------------------------------------------------------------------------
+-- | Remove (or merge) duplicated import specs.
+--
+-- * When something is mentioned twice, it's removed: @A, A@ -> A
+-- * More general forms take priority: @A, A(..)@ -> @A(..)@
+-- * Sometimes we have to combine imports: @A(x), A(y)@ -> @A(x, y)@
+--
+-- Import specs are always sorted by subsequent steps so we don't have to care
+-- about preserving order.
+deduplicateImportSpecs :: Ord l => H.ImportDecl l -> H.ImportDecl l
+deduplicateImportSpecs =
+ modifyImportSpecs $
+ map recomposeImportSpec .
+ M.toList . M.fromListWith (<>) .
+ map decomposeImportSpec
+
+-- | What we are importing (variable, class, etc)
+data ImportEntity l
+ -- | A variable
+ = ImportVar l (H.Name l)
+ -- | Something that can be imported partially
+ | ImportClassOrData l (H.Name l)
+ -- | Something else ('H.IAbs')
+ | ImportOther l (H.Namespace l) (H.Name l)
+ deriving (Eq, Ord)
+
+-- | What we are importing from an 'ImportClassOrData'
+data ImportPortion l
+ = ImportSome [H.CName l] -- ^ @A(x, y, z)@
+ | ImportAll -- ^ @A(..)@
+
+instance Ord l => Monoid (ImportPortion l) where
+ mempty = ImportSome []
+ mappend (ImportSome a) (ImportSome b) = ImportSome (setUnion a b)
+ mappend _ _ = ImportAll
+
+-- | O(n log n) union.
+setUnion :: Ord a => [a] -> [a] -> [a]
+setUnion a b = S.toList (S.fromList a `S.union` S.fromList b)
+
+decomposeImportSpec :: H.ImportSpec l -> (ImportEntity l, ImportPortion l)
+decomposeImportSpec x = case x of
+ -- I checked and it looks like namespace's 'l' is always equal to x's 'l'
+ H.IAbs l space n -> case space of
+ H.NoNamespace _ -> (ImportClassOrData l n, ImportSome [])
+ H.TypeNamespace _ -> (ImportOther l space n, ImportSome [])
+ H.PatternNamespace _ -> (ImportOther l space n, ImportSome [])
+ H.IVar l n -> (ImportVar l n, ImportSome [])
+ H.IThingAll l n -> (ImportClassOrData l n, ImportAll)
+ H.IThingWith l n names -> (ImportClassOrData l n, ImportSome names)
+
+recomposeImportSpec :: (ImportEntity l, ImportPortion l) -> H.ImportSpec l
+recomposeImportSpec (e, p) = case e of
+ ImportClassOrData l n -> case p of
+ ImportSome [] -> H.IAbs l (H.NoNamespace l) n
+ ImportSome names -> H.IThingWith l n names
+ ImportAll -> H.IThingAll l n
+ ImportVar l n -> H.IVar l n
+ ImportOther l space n -> H.IAbs l space n
--------------------------------------------------------------------------------
@@ -119,10 +214,7 @@
--------------------------------------------------------------------------------
-- | Sort the input spec list inside an 'H.ImportDecl'
sortImportSpecs :: H.ImportDecl l -> H.ImportDecl l
-sortImportSpecs imp = imp {H.importSpecs = sort' <$> H.importSpecs imp}
- where
- sort' (H.ImportSpecList l h specs) = H.ImportSpecList l h $
- sortBy compareImportSpecs specs
+sortImportSpecs = modifyImportSpecs (sortBy compareImportSpecs)
--------------------------------------------------------------------------------
@@ -186,27 +278,27 @@
| otherwise = shortWrap
emptyWrap = case emptyListAlign of
- Inherit -> inlineWrap
+ Inherit -> inlineWrap
RightAfter -> [paddedNoSpecBase ++ " ()"]
inlineWrap = inlineWrapper
$ mapSpecs
$ withInit (++ ",")
- . withHead ("(" ++)
- . withLast (++ ")")
+ . withHead (("(" ++ maybeSpace) ++)
+ . withLast (++ (maybeSpace ++ ")"))
inlineWrapper = case listAlign of
NewLine -> (paddedNoSpecBase :) . wrapRest columns listPadding'
WithAlias -> wrap columns paddedBase (inlineBaseLength + 1)
-- Add 1 extra space to ensure same padding as in original code.
- AfterAlias -> withTail (' ' :)
+ AfterAlias -> withTail ((' ' : maybeSpace) ++)
. wrap columns paddedBase (afterAliasBaseLength + 1)
inlineWithBreakWrap = paddedNoSpecBase : wrapRest columns listPadding'
( mapSpecs
$ withInit (++ ",")
- . withHead ("(" ++)
- . withLast (++ ")"))
+ . withHead (("(" ++ maybeSpace) ++)
+ . withLast (++ (maybeSpace ++ ")")))
inlineToMultilineWrap
| length inlineWithBreakWrap > 2
@@ -221,9 +313,9 @@
. withTail (", " ++))
++ [")"])
- paddedBase = base $ padImport $ importName imp
+ paddedBase = base $ padImport $ compoundImportName imp
- paddedNoSpecBase = base $ padImportNoSpec $ importName imp
+ paddedNoSpecBase = base $ padImportNoSpec $ compoundImportName imp
padImport = if hasExtras && padName
then padRight longest
@@ -233,12 +325,11 @@
then padRight longest
else id
- base' baseName importAs hasHiding' = unwords $ concat $ filter (not . null)
+ base' baseName importAs hasHiding' = unwords $ concat $
[ ["import"]
, source
, safe
, qualified
- , show <$> maybeToList (H.importPkg imp)
, [baseName]
, importAs
, hasHiding'
@@ -248,9 +339,10 @@
["as " ++ as | H.ModuleName _ as <- maybeToList $ H.importAs imp]
["hiding" | hasHiding]
- inlineBaseLength = length $ base' (padImport $ importName imp) [] []
+ inlineBaseLength = length $
+ base' (padImport $ compoundImportName imp) [] []
- afterAliasBaseLength = length $ base' (padImport $ importName imp)
+ afterAliasBaseLength = length $ base' (padImport $ compoundImportName imp)
["as " ++ as | H.ModuleName _ as <- maybeToList $ H.importAs imp] []
(hasHiding, importSpecs) = case H.importSpecs imp of
@@ -282,6 +374,10 @@
Just [] -> ["()"] -- Instance only imports
Just is -> f $ map (prettyImportSpec separateLists) is
+ maybeSpace = case spaceSurround of
+ True -> " "
+ False -> ""
+
--------------------------------------------------------------------------------
prettyImportGroup :: Int -> Options -> Bool -> Int
@@ -292,12 +388,13 @@
sortBy compareImports imps
where
align' = importAlign align
+ padModuleNames' = padModuleNames align
longest' = case align' of
Group -> longestImport imps
_ -> longest
- padName = align' /= None
+ padName = align' /= None && padModuleNames'
padQual = case align' of
Global -> True
@@ -320,7 +417,8 @@
]
ls
where
- imps = map sortImportSpecs $ imports $ fmap linesFromSrcSpan module'
+ imps = map (sortImportSpecs . deduplicateImportSpecs) $
+ imports $ fmap linesFromSrcSpan module'
longest = longestImport imps
groups = groupAdjacent [(H.ann i, i) | i <- imps]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stylish-haskell-0.7.1.0/lib/Language/Haskell/Stylish/Step/LanguagePragmas.hs new/stylish-haskell-0.8.1.0/lib/Language/Haskell/Stylish/Step/LanguagePragmas.hs
--- old/stylish-haskell-0.7.1.0/lib/Language/Haskell/Stylish/Step/LanguagePragmas.hs 2017-01-24 13:53:59.000000000 +0100
+++ new/stylish-haskell-0.8.1.0/lib/Language/Haskell/Stylish/Step/LanguagePragmas.hs 2017-06-19 14:23:15.000000000 +0200
@@ -56,7 +56,7 @@
--------------------------------------------------------------------------------
compactPragmas :: Int -> [String] -> Lines
compactPragmas columns pragmas' = wrap columns "{-# LANGUAGE" 13 $
- map (++ ",") (init pragmas') ++ [last pragmas', "#-}"]
+ map (++ ",") (init pragmas') ++ [last pragmas' ++ " #-}"]
--------------------------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stylish-haskell-0.7.1.0/stylish-haskell.cabal new/stylish-haskell-0.8.1.0/stylish-haskell.cabal
--- old/stylish-haskell-0.7.1.0/stylish-haskell.cabal 2017-01-24 13:53:59.000000000 +0100
+++ new/stylish-haskell-0.8.1.0/stylish-haskell.cabal 2017-06-19 14:23:15.000000000 +0200
@@ -1,5 +1,5 @@
Name: stylish-haskell
-Version: 0.7.1.0
+Version: 0.8.1.0
Synopsis: Haskell code prettifier
Homepage: https://github.com/jaspervdj/stylish-haskell
License: BSD3
@@ -49,7 +49,7 @@
Paths_stylish_haskell
Build-depends:
- aeson >= 0.6 && < 1.2,
+ aeson >= 0.6 && < 1.3,
base >= 4.8 && < 5,
bytestring >= 0.9 && < 0.11,
containers >= 0.3 && < 0.6,
@@ -57,7 +57,7 @@
filepath >= 1.1 && < 1.5,
haskell-src-exts >= 1.18 && < 1.20,
mtl >= 2.0 && < 2.3,
- syb >= 0.3 && < 0.7,
+ syb >= 0.3 && < 0.8,
yaml >= 0.7 && < 0.9
Executable stylish-haskell
@@ -68,9 +68,9 @@
Build-depends:
stylish-haskell,
strict >= 0.3 && < 0.4,
- optparse-applicative >= 0.12 && < 0.14,
+ optparse-applicative >= 0.12 && < 0.15,
-- Copied from regular dependencies...
- aeson >= 0.6 && < 1.2,
+ aeson >= 0.6 && < 1.3,
base >= 4.8 && < 5,
bytestring >= 0.9 && < 0.11,
containers >= 0.3 && < 0.6,
@@ -78,7 +78,7 @@
filepath >= 1.1 && < 1.5,
haskell-src-exts >= 1.18 && < 1.20,
mtl >= 2.0 && < 2.3,
- syb >= 0.3 && < 0.7,
+ syb >= 0.3 && < 0.8,
yaml >= 0.7 && < 0.9
Test-suite stylish-haskell-tests
@@ -112,11 +112,11 @@
Language.Haskell.Stylish.Verbose
Build-depends:
- HUnit >= 1.2 && < 1.6,
+ HUnit >= 1.2 && < 1.7,
test-framework >= 0.4 && < 0.9,
test-framework-hunit >= 0.2 && < 0.4,
-- Copied from regular dependencies...
- aeson >= 0.6 && < 1.2,
+ aeson >= 0.6 && < 1.3,
base >= 4.8 && < 5,
bytestring >= 0.9 && < 0.11,
containers >= 0.3 && < 0.6,
@@ -124,7 +124,7 @@
filepath >= 1.1 && < 1.5,
haskell-src-exts >= 1.18 && < 1.20,
mtl >= 2.0 && < 2.3,
- syb >= 0.3 && < 0.7,
+ syb >= 0.3 && < 0.8,
yaml >= 0.7 && < 0.9
Source-repository head
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stylish-haskell-0.7.1.0/tests/Language/Haskell/Stylish/Parse/Tests.hs new/stylish-haskell-0.8.1.0/tests/Language/Haskell/Stylish/Parse/Tests.hs
--- old/stylish-haskell-0.7.1.0/tests/Language/Haskell/Stylish/Parse/Tests.hs 2017-01-24 13:53:59.000000000 +0100
+++ new/stylish-haskell-0.8.1.0/tests/Language/Haskell/Stylish/Parse/Tests.hs 2017-06-19 14:23:15.000000000 +0200
@@ -27,6 +27,7 @@
, testCase "StandalonDeriving extension" testStandaloneDeriving
, testCase "UnicodeSyntax extension" testUnicodeSyntax
, testCase "XmlSyntax regression" testXmlSyntaxRegression
+ , testCase "MagicHash regression" testMagicHashRegression
]
--------------------------------------------------------------------------------
@@ -120,6 +121,11 @@
[ "smaller a b = a <b"
]
+testMagicHashRegression :: Assertion
+testMagicHashRegression = assert $ isRight $ parseModule [] Nothing $ unlines
+ [ "xs = \"foo\"#|1#|'a'#|bar#|Nil"
+ ]
+
--------------------------------------------------------------------------------
isRight :: Either a b -> Bool
isRight (Right _) = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stylish-haskell-0.7.1.0/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs new/stylish-haskell-0.8.1.0/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs
--- old/stylish-haskell-0.7.1.0/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs 2017-01-24 13:53:59.000000000 +0100
+++ new/stylish-haskell-0.8.1.0/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs 2017-06-19 14:23:15.000000000 +0200
@@ -47,6 +47,11 @@
, testCase "case 19d" case19c
, testCase "case 19d" case19d
, testCase "case 20" case20
+ , testCase "case 21" case21
+ , testCase "case 22" case22
+ , testCase "case 23" case23
+ , testCase "case 24" case24
+ , testCase "case 25" case25
]
@@ -186,7 +191,7 @@
--------------------------------------------------------------------------------
case08 :: Assertion
case08 = expected
- @=? testStep (step 80 $ Options Global WithAlias Inline Inherit (LPConstant 4) True) input
+ @=? testStep (step 80 $ Options Global WithAlias True Inline Inherit (LPConstant 4) True False) input
where
expected = unlines
[ "module Herp where"
@@ -209,7 +214,7 @@
--------------------------------------------------------------------------------
case09 :: Assertion
case09 = expected
- @=? testStep (step 80 $ Options Global WithAlias Multiline Inherit (LPConstant 4) True) input
+ @=? testStep (step 80 $ Options Global WithAlias True Multiline Inherit (LPConstant 4) True False) input
where
expected = unlines
[ "module Herp where"
@@ -243,7 +248,7 @@
--------------------------------------------------------------------------------
case10 :: Assertion
case10 = expected
- @=? testStep (step 40 $ Options Group WithAlias Multiline Inherit (LPConstant 4) True) input
+ @=? testStep (step 40 $ Options Group WithAlias True Multiline Inherit (LPConstant 4) True False) input
where
expected = unlines
[ "module Herp where"
@@ -282,7 +287,7 @@
--------------------------------------------------------------------------------
case11 :: Assertion
case11 = expected
- @=? testStep (step 80 $ Options Group NewLine Inline Inherit (LPConstant 4) True) input
+ @=? testStep (step 80 $ Options Group NewLine True Inline Inherit (LPConstant 4) True False) input
where
expected = unlines
[ "module Herp where"
@@ -310,7 +315,7 @@
--------------------------------------------------------------------------------
case12 :: Assertion
case12 = expected
- @=? testStep (step 80 $ Options Group NewLine Inline Inherit (LPConstant 2) True) input'
+ @=? testStep (step 80 $ Options Group NewLine True Inline Inherit (LPConstant 2) True False) input'
where
input' = unlines
[ "import Data.List (map)"
@@ -325,7 +330,7 @@
--------------------------------------------------------------------------------
case13 :: Assertion
case13 = expected
- @=? testStep (step 80 $ Options None WithAlias InlineWithBreak Inherit (LPConstant 4) True) input'
+ @=? testStep (step 80 $ Options None WithAlias True InlineWithBreak Inherit (LPConstant 4) True False) input'
where
input' = unlines
[ "import qualified Data.List as List (concat, foldl, foldr, head, init,"
@@ -343,7 +348,7 @@
case14 :: Assertion
case14 = expected
@=? testStep
- (step 80 $ Options None WithAlias InlineWithBreak Inherit (LPConstant 10) True) expected
+ (step 80 $ Options None WithAlias True InlineWithBreak Inherit (LPConstant 10) True False) expected
where
expected = unlines
[ "import qualified Data.List as List (concat, map, null, reverse, tail, (++))"
@@ -353,7 +358,7 @@
--------------------------------------------------------------------------------
case15 :: Assertion
case15 = expected
- @=? testStep (step 80 $ Options None AfterAlias Multiline Inherit (LPConstant 4) True) input'
+ @=? testStep (step 80 $ Options None AfterAlias True Multiline Inherit (LPConstant 4) True False) input'
where
expected = unlines
[ "import Data.Acid (AcidState)"
@@ -379,7 +384,7 @@
--------------------------------------------------------------------------------
case16 :: Assertion
case16 = expected
- @=? testStep (step 80 $ Options None AfterAlias Multiline Inherit (LPConstant 4) False) input'
+ @=? testStep (step 80 $ Options None AfterAlias True Multiline Inherit (LPConstant 4) False False) input'
where
expected = unlines
[ "import Data.Acid (AcidState)"
@@ -403,7 +408,7 @@
--------------------------------------------------------------------------------
case17 :: Assertion
case17 = expected
- @=? testStep (step 80 $ Options None AfterAlias Multiline Inherit (LPConstant 4) True) input'
+ @=? testStep (step 80 $ Options None AfterAlias True Multiline Inherit (LPConstant 4) True False) input'
where
expected = unlines
[ "import Control.Applicative (Applicative (pure, (<*>)))"
@@ -421,7 +426,7 @@
--------------------------------------------------------------------------------
case18 :: Assertion
case18 = expected @=? testStep
- (step 40 $ Options None AfterAlias InlineToMultiline Inherit (LPConstant 4) True) input'
+ (step 40 $ Options None AfterAlias True InlineToMultiline Inherit (LPConstant 4) True False) input'
where
expected = unlines
----------------------------------------
@@ -448,7 +453,7 @@
--------------------------------------------------------------------------------
case19 :: Assertion
case19 = expected @=? testStep
- (step 40 $ Options Global NewLine InlineWithBreak RightAfter (LPConstant 17) True) case19input
+ (step 40 $ Options Global NewLine True InlineWithBreak RightAfter (LPConstant 17) True False) case19input
where
expected = unlines
----------------------------------------
@@ -463,7 +468,7 @@
case19b :: Assertion
case19b = expected @=? testStep
- (step 40 $ Options File NewLine InlineWithBreak RightAfter (LPConstant 17) True) case19input
+ (step 40 $ Options File NewLine True InlineWithBreak RightAfter (LPConstant 17) True False) case19input
where
expected = unlines
----------------------------------------
@@ -478,7 +483,7 @@
case19c :: Assertion
case19c = expected @=? testStep
- (step 40 $ Options File NewLine InlineWithBreak RightAfter LPModuleName True) case19input
+ (step 40 $ Options File NewLine True InlineWithBreak RightAfter LPModuleName True False) case19input
where
expected = unlines
----------------------------------------
@@ -493,7 +498,7 @@
case19d :: Assertion
case19d = expected @=? testStep
- (step 40 $ Options Global NewLine InlineWithBreak RightAfter LPModuleName True) case19input
+ (step 40 $ Options Global NewLine True InlineWithBreak RightAfter LPModuleName True False) case19input
where
expected = unlines
----------------------------------------
@@ -531,3 +536,130 @@
, "import qualified Data.Map as Map"
, "import Data.Set (empty)"
]
+
+--------------------------------------------------------------------------------
+case21 :: Assertion
+case21 = expected
+ @=? testStep (step 80 defaultOptions) input'
+ where
+ expected = unlines
+ [ "{-# LANGUAGE ExplicitNamespaces #-}"
+ , "import X1 (A, B, C)"
+ , "import X2 (A, B, C)"
+ , "import X3 (A (..))"
+ , "import X4 (A (..))"
+ , "import X5 (A (..))"
+ , "import X6 (A (a, b, c), B (m, n, o))"
+ , "import X7 (a, b, c)"
+ , "import X8 (type (+), (+))"
+ , "import X9 hiding (x, y, z)"
+ ]
+ input' = unlines
+ [ "{-# LANGUAGE ExplicitNamespaces #-}"
+ , "import X1 (A, B, A, C, A, B, A)"
+ , "import X2 (C(), B(), A())"
+ , "import X3 (A(..))"
+ , "import X4 (A, A(..))"
+ , "import X5 (A(..), A(x))"
+ , "import X6 (A(a,b), B(m,n), A(c), B(o))"
+ , "import X7 (a, b, a, c)"
+ , "import X8 (type (+), (+))"
+ , "import X9 hiding (x, y, z, x)"
+ ]
+
+--------------------------------------------------------------------------------
+case22 :: Assertion
+case22 = expected
+ @=? testStep (step 80 defaultOptions) input'
+ where
+ expected = unlines
+ [ "{-# LANGUAGE PackageImports #-}"
+ , "import A"
+ , "import \"blah\" A"
+ , "import \"foo\" A"
+ , "import qualified \"foo\" A as X"
+ , "import \"foo\" B (shortName, someLongName, someLongerName,"
+ , " theLongestNameYet)"
+ ]
+ input' = unlines
+ [ "{-# LANGUAGE PackageImports #-}"
+ , "import A"
+ , "import \"foo\" A"
+ , "import \"blah\" A"
+ , "import qualified \"foo\" A as X"
+ -- this import fits into 80 chats without "foo",
+ -- but doesn't fit when "foo" is included into the calculation
+ , "import \"foo\" B (someLongName, someLongerName, " ++
+ "theLongestNameYet, shortName)"
+ ]
+
+--------------------------------------------------------------------------------
+case23 :: Assertion
+case23 = expected
+ @=? testStep (step 40 $ Options None AfterAlias False Inline Inherit (LPConstant 4) True True) input'
+ where
+ expected = unlines
+ [ "import Data.Acid ( AcidState )"
+ , "import Data.Default.Class ( Default (def) )"
+ , ""
+ , "import Data.Monoid ( (<>) )"
+ , ""
+ , "import Data.ALongName.Foo ( Boo, Foo,"
+ , " Goo )"
+ ]
+
+ input' = unlines
+ [ "import Data.Acid (AcidState)"
+ , "import Data.Default.Class (Default(def))"
+ , ""
+ , "import Data.Monoid ((<>) )"
+ , ""
+ , "import Data.ALongName.Foo (Foo, Goo, Boo)"
+ ]
+
+--------------------------------------------------------------------------------
+case24 :: Assertion
+case24 = expected
+ @=? testStep (step 40 $ Options None AfterAlias False InlineWithBreak Inherit (LPConstant 4) True True) input'
+ where
+ expected = unlines
+ [ "import Data.Acid ( AcidState )"
+ , "import Data.Default.Class"
+ , " ( Default (def) )"
+ , ""
+ , "import Data.ALongName.Foo"
+ , " ( BooReallyLong, FooReallyLong,"
+ , " GooReallyLong )"
+ ]
+
+ input' = unlines
+ [ "import Data.Acid (AcidState)"
+ , "import Data.Default.Class (Default(def))"
+ , ""
+ , "import Data.ALongName.Foo (FooReallyLong, " ++
+ "GooReallyLong, BooReallyLong)"
+ ]
+
+--------------------------------------------------------------------------------
+case25 :: Assertion
+case25 = expected
+ @=? testStep (step 80 $ Options Group AfterAlias False Multiline Inherit (LPConstant 4) False False) input'
+ where
+ expected = unlines
+ [ "import Data.Acid (AcidState)"
+ , "import Data.Default.Class (Default(def))"
+ , ""
+ , "import Data.Maybe (Maybe(Just, Nothing))"
+ , "import qualified Data.Maybe.Extra (Maybe(Just, Nothing))"
+ , ""
+ , "import Data.Foo (Foo(Bar, Foo), Goo(Goo))"
+ ]
+ input' = unlines
+ [ "import Data.Acid (AcidState)"
+ , "import Data.Default.Class (Default(def))"
+ , ""
+ , "import Data.Maybe (Maybe (Just, Nothing))"
+ , "import qualified Data.Maybe.Extra (Maybe(Just, Nothing))"
+ , ""
+ , "import Data.Foo (Foo (Foo,Bar), Goo(Goo))"
+ ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stylish-haskell-0.7.1.0/tests/Language/Haskell/Stylish/Step/LanguagePragmas/Tests.hs new/stylish-haskell-0.8.1.0/tests/Language/Haskell/Stylish/Step/LanguagePragmas/Tests.hs
--- old/stylish-haskell-0.7.1.0/tests/Language/Haskell/Stylish/Step/LanguagePragmas/Tests.hs 2017-01-24 13:53:59.000000000 +0100
+++ new/stylish-haskell-0.8.1.0/tests/Language/Haskell/Stylish/Step/LanguagePragmas/Tests.hs 2017-06-19 14:23:15.000000000 +0200
@@ -26,6 +26,8 @@
, testCase "case 06" case06
, testCase "case 07" case07
, testCase "case 08" case08
+ , testCase "case 09" case09
+ , testCase "case 10" case10
]
@@ -167,3 +169,31 @@
"TemplateHaskell #-}"
, "{-# LANGUAGE TypeOperators, ViewPatterns #-}"
]
+
+
+--------------------------------------------------------------------------------
+case09 :: Assertion
+case09 = expected @=? testStep (step 80 Compact True False) input
+ where
+ input = unlines
+ [ "{-# LANGUAGE DefaultSignatures, FlexibleInstances, LambdaCase, " ++
+ "TypeApplications"
+ , " #-}"
+ ]
+ expected = unlines
+ [ "{-# LANGUAGE DefaultSignatures, FlexibleInstances, LambdaCase,"
+ , " TypeApplications #-}"
+ ]
+
+--------------------------------------------------------------------------------
+case10 :: Assertion
+case10 = expected @=? testStep (step 80 Compact True False) input
+ where
+ input = unlines
+ [ "{-# LANGUAGE NondecreasingIndentation, ScopedTypeVariables,"
+ , " TypeApplications #-}"
+ ]
+ expected = unlines
+ [ "{-# LANGUAGE NondecreasingIndentation, ScopedTypeVariables, " ++
+ "TypeApplications #-}"
+ ]
1
0
Hello community,
here is the log from the commit of package stack for openSUSE:Factory checked in at 2017-08-31 21:03:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/stack (Old)
and /work/SRC/openSUSE:Factory/.stack.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "stack"
Thu Aug 31 21:03:07 2017 rev:10 rq:513573 version:1.5.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/stack/stack.changes 2017-05-16 14:38:53.087990688 +0200
+++ /work/SRC/openSUSE:Factory/.stack.new/stack.changes 2017-08-31 21:03:08.983050637 +0200
@@ -1,0 +2,5 @@
+Wed Jul 26 03:02:15 UTC 2017 - psimons(a)suse.com
+
+- Update to version 1.5.0 revision 1.
+
+-------------------------------------------------------------------
Old:
----
stack-1.4.0.tar.gz
New:
----
stack-1.5.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ stack.spec ++++++
--- /var/tmp/diff_new_pack.n6jC5U/_old 2017-08-31 21:03:10.254871944 +0200
+++ /var/tmp/diff_new_pack.n6jC5U/_new 2017-08-31 21:03:10.262870821 +0200
@@ -19,14 +19,14 @@
%global pkg_name stack
%bcond_with tests
Name: %{pkg_name}
-Version: 1.4.0
+Version: 1.5.0
Release: 0
Summary: The Haskell Tool Stack
License: BSD-3-Clause
Group: Development/Languages/Other
Url: https://hackage.haskell.org/package/%{name}
Source0: https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.t…
-Source1: https://hackage.haskell.org/package/%{name}-%{version}/revision/4.cabal#/%{…
+Source1: https://hackage.haskell.org/package/%{name}-%{version}/revision/1.cabal#/%{…
BuildRequires: chrpath
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-aeson-devel
@@ -48,6 +48,7 @@
BuildRequires: ghc-cryptonite-devel
BuildRequires: ghc-deepseq-devel
BuildRequires: ghc-directory-devel
+BuildRequires: ghc-echo-devel
BuildRequires: ghc-either-devel
BuildRequires: ghc-errors-devel
BuildRequires: ghc-exceptions-devel
@@ -62,7 +63,6 @@
BuildRequires: ghc-hackage-security-devel
BuildRequires: ghc-hashable-devel
BuildRequires: ghc-hastache-devel
-BuildRequires: ghc-hit-devel
BuildRequires: ghc-hpack-devel
BuildRequires: ghc-hpc-devel
BuildRequires: ghc-http-client-devel
@@ -74,6 +74,7 @@
BuildRequires: ghc-memory-devel
BuildRequires: ghc-microlens-devel
BuildRequires: ghc-microlens-mtl-devel
+BuildRequires: ghc-mintty-devel
BuildRequires: ghc-monad-control-devel
BuildRequires: ghc-monad-logger-devel
BuildRequires: ghc-monad-unlift-devel
@@ -100,6 +101,7 @@
BuildRequires: ghc-semigroups-devel
BuildRequires: ghc-split-devel
BuildRequires: ghc-stm-devel
+BuildRequires: ghc-store-core-devel
BuildRequires: ghc-store-devel
BuildRequires: ghc-streaming-commons-devel
BuildRequires: ghc-tar-devel
++++++ stack-1.4.0.tar.gz -> stack-1.5.0.tar.gz ++++++
++++ 9058 lines of diff (skipped)
++++++ stack.cabal ++++++
--- /var/tmp/diff_new_pack.n6jC5U/_old 2017-08-31 21:03:10.878784283 +0200
+++ /var/tmp/diff_new_pack.n6jC5U/_new 2017-08-31 21:03:10.882783722 +0200
@@ -1,6 +1,6 @@
-x-revision: 4
name: stack
-version: 1.4.0
+version: 1.5.0
+x-revision: 1
cabal-version: >=1.10
build-type: Custom
license: BSD3
@@ -59,7 +59,7 @@
if os(windows)
build-depends:
- Win32 >=2.3.1.0 && <2.4
+ Win32 >=2.3.1.1 && <2.4
cpp-options: -DWINDOWS
else
build-depends:
@@ -82,6 +82,7 @@
Options.Applicative.Args
Options.Applicative.Builder.Extra
Options.Applicative.Complicated
+ Path.CheckInstall
Path.Extra
Path.Find
Paths_stack
@@ -123,6 +124,7 @@
Stack.Options.BuildParser
Stack.Options.CleanParser
Stack.Options.ConfigParser
+ Stack.Options.Completion
Stack.Options.DockerParser
Stack.Options.DotParser
Stack.Options.ExecParser
@@ -138,6 +140,7 @@
Stack.Options.PackageParser
Stack.Options.ResolverParser
Stack.Options.ScriptParser
+ Stack.Options.SDistParser
Stack.Options.SolverParser
Stack.Options.TestParser
Stack.Options.Utils
@@ -177,6 +180,7 @@
Stack.Types.Resolver
Stack.Types.Sig
Stack.Types.StackT
+ Stack.Types.StringError
Stack.Types.TemplateName
Stack.Types.Version
Stack.Upgrade
@@ -203,11 +207,12 @@
conduit >=1.2.8 && <1.3,
conduit-extra >=1.1.14 && <1.2,
containers >=0.5.5.1 && <0.6,
- cryptonite >=0.19 && <0.22,
+ cryptonite >=0.19 && <0.24,
cryptonite-conduit >=0.1 && <0.3,
directory >=1.2.1.0 && <1.4,
+ echo >=0.1.3 && <0.2,
either >=4.4.1.1 && <4.5,
- errors >=2.1.2 && <2.2,
+ errors >=2.1.3 && <2.3,
exceptions >=0.8.0.2 && <0.9,
extra >=1.4.10 && <1.6,
fast-logger >=2.3.1 && <2.5,
@@ -215,19 +220,20 @@
filepath >=1.3.0.2 && <1.5,
fsnotify >=0.2.1 && <0.3,
generic-deriving >=1.10.5 && <1.12,
+ ghc-prim >=0.4.0.0 && <0.6,
hackage-security >=0.5.2.2 && <0.6,
hashable >=1.2.3.2 && <1.3,
- hit >=0.6.3 && <0.7,
hpc >=0.6.0.2 && <0.7,
http-client >=0.5.3.3 && <0.6,
http-client-tls >=0.3.4 && <0.4,
http-conduit >=2.2.3 && <2.3,
http-types >=0.8.6 && <0.10,
- lifted-async >=0.9.0 && <0.10,
- lifted-base >=0.2.3.8 && <0.3,
+ lifted-async >=0.9.1.1 && <0.10,
+ lifted-base >=0.2.3.11 && <0.3,
memory >=0.13 && <0.15,
microlens >=0.3.0.0 && <0.5,
microlens-mtl >=0.1.10.0 && <0.2,
+ mintty >=0.1.1 && <0.2,
monad-control >=1.0.1.0 && <1.1,
monad-logger >=0.3.13.1 && <0.4,
monad-unlift >=0.2.0 && <0.3,
@@ -237,7 +243,7 @@
optparse-applicative ==0.13.*,
path >=0.5.8 && <0.6,
path-io >=1.1.0 && <2.0.0,
- persistent >=2.1.2 && <2.7,
+ persistent >=2.1.2 && <2.8,
persistent-sqlite >=2.1.4 && <2.5.0.1 || >2.5.0.1 && <2.7,
persistent-template >=2.1.1 && <2.6,
pretty >=1.1.1.1 && <1.2,
@@ -246,9 +252,9 @@
resourcet >=1.1.4.1 && <1.2,
retry >=0.6 && <0.8,
safe ==0.3.*,
- safe-exceptions >=0.1.4.0 && <0.2,
+ safe-exceptions >=0.1.5.0 && <0.2,
semigroups >=0.5 && <0.19,
- split >=0.2.3.1 && <0.3,
+ split >=0.2.3.2 && <0.3,
stm >=2.4.4 && <2.5,
streaming-commons >=0.1.10.0 && <0.2,
tar >=0.5.0.3 && <0.6,
@@ -256,7 +262,7 @@
temporary >=1.2.0.3 && <1.3,
text >=1.2.0.4 && <1.3,
text-binary >=0.2.1.1 && <0.3,
- text-metrics >=0.1 && <0.3,
+ text-metrics >=0.1 && <0.4,
time >=1.4.2 && <1.7,
tls >=1.3.8 && <1.4,
transformers >=0.3.0.0 && <0.6,
@@ -265,15 +271,16 @@
unix-compat >=0.4.1.4 && <0.5,
unordered-containers >=0.2.5.1 && <0.3,
vector >=0.10.12.3 && <0.13,
- vector-binary-instances >=0.2.3.2 && <0.3,
+ vector-binary-instances >=0.2.3.5 && <0.3,
yaml >=0.8.20 && <0.9,
zlib >=0.5.4.2 && <0.7,
deepseq ==1.4.*,
hastache >=0.6.1 && <0.7,
project-template ==0.2.*,
zip-archive >=0.2.3.7 && <0.4,
- hpack >=0.17.0 && <0.18,
- store >=0.2.1.0 && <0.4,
+ hpack >=0.17.0 && <0.19,
+ store >=0.4.1 && <0.5,
+ store-core ==0.4.*,
annotated-wl-pprint >=0.7.0 && <0.8,
file-embed >=0.0.10 && <0.1
default-language: Haskell2010
@@ -289,12 +296,12 @@
if os(windows)
build-depends:
- Win32 >=2.3.1.0 && <2.4
+ Win32 >=2.3.1.1 && <2.4
cpp-options: -DWINDOWS
if !flag(disable-git-info)
build-depends:
- gitrev >=1.1 && <1.3,
+ gitrev >=1.1 && <1.4,
optparse-simple >=0.0.3 && <0.1
cpp-options: -DUSE_GIT_INFO
@@ -311,9 +318,9 @@
either >=4.4.1.1 && <4.5,
filelock >=0.1.0.1 && <0.2,
filepath >=1.3.0.2 && <1.5,
- hpack >=0.17.0 && <0.18,
+ hpack >=0.17.0 && <0.19,
http-client >=0.5.3.3 && <0.6,
- lifted-base >=0.2.3.8 && <0.3,
+ lifted-base >=0.2.3.11 && <0.3,
microlens >=0.3.0.0 && <0.5,
monad-control >=1.0.1.0 && <1.1,
monad-logger >=0.3.13.1 && <0.4,
@@ -321,8 +328,8 @@
optparse-applicative ==0.13.*,
path >=0.5.8 && <0.6,
path-io >=1.1.0 && <2.0.0,
- split >=0.2.3.1 && <0.3,
- stack >=1.4.0 && <1.5,
+ split >=0.2.3.2 && <0.3,
+ stack,
text >=1.2.0.4 && <1.3,
transformers >=0.3.0.0 && <0.6
default-language: Haskell2010
@@ -343,34 +350,34 @@
attoparsec >=0.13.1.0 && <0.14,
base >=4.7 && <5,
conduit >=1.2.8 && <1.3,
- conduit-extra >=1.1.14 && <1.2,
+ conduit-extra >=1.1.16 && <1.2,
containers >=0.5.5.1 && <0.6,
- cryptonite >=0.19 && <0.22,
+ cryptonite >=0.19 && <0.24,
directory >=1.2.1.0 && <1.4,
exceptions >=0.8.3 && <0.9,
- filepath >=1.4.0.0 && <1.5,
+ filepath >=1.3.0.2 && <1.5,
hspec >=2.2 && <2.5,
- hashable >=1.2.4.0 && <1.3,
+ hashable >=1.2.3.2 && <1.3,
http-client-tls >=0.3.4 && <0.4,
http-conduit >=2.2.3 && <2.3,
- monad-logger >=0.3.20.1 && <0.4,
+ monad-logger >=0.3.24 && <0.4,
neat-interpolation ==0.3.*,
optparse-applicative ==0.13.*,
path >=0.5.8 && <0.6,
path-io >=1.1.0 && <2.0.0,
- resourcet >=1.1.8.1 && <1.2,
+ resourcet >=1.1.9 && <1.2,
retry >=0.6 && <0.8,
- stack >=1.4.0 && <1.5,
- temporary >=1.2.0.4 && <1.3,
+ stack,
+ temporary >=1.2.0.3 && <1.3,
text >=1.2.2.1 && <1.3,
transformers >=0.3.0.0 && <0.6,
mono-traversable >=0.10.2 && <1.1,
th-reify-many >=0.1.6 && <0.2,
smallcheck >=1.1.1 && <1.2,
- bytestring >=0.10.6.0 && <0.11,
- store >=0.2.1.0 && <0.4,
+ bytestring >=0.10.4.0 && <0.11,
+ store >=0.4.1 && <0.5,
vector >=0.10.12.3 && <0.13,
- unordered-containers >=0.2.7.1 && <0.3,
+ unordered-containers >=0.2.8.0 && <0.3,
template-haskell >=2.9.0.0 && <2.12,
yaml >=0.8.20 && <0.9
default-language: Haskell2010
@@ -400,7 +407,7 @@
type: exitcode-stdio-1.0
main-is: IntegrationSpec.hs
build-depends:
- async >=2.1.0 && <2.2,
+ async >=2.1.1.1 && <2.2,
base >=4.7 && <5,
bytestring >=0.10.4.0 && <0.11,
conduit >=1.2.8 && <1.3,
@@ -410,8 +417,8 @@
filepath >=1.3.0.2 && <1.5,
hspec >=2.2 && <2.5,
process >=1.2.0.0 && <1.5,
- resourcet >=1.1.8.1 && <1.2,
- temporary >=1.2.0.4 && <1.3,
+ resourcet >=1.1.9 && <1.2,
+ temporary >=1.2.0.3 && <1.3,
text >=1.2.2.1 && <1.3,
transformers >=0.3.0.0 && <0.6,
unix-compat >=0.4.1.4 && <0.5
@@ -420,3 +427,8 @@
other-modules:
StackTest
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates
+
+custom-setup
+ setup-depends: base
+ , Cabal
+ , filepath
1
0
Hello community,
here is the log from the commit of package hspec-discover for openSUSE:Factory checked in at 2017-08-31 21:03:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hspec-discover (Old)
and /work/SRC/openSUSE:Factory/.hspec-discover.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hspec-discover"
Thu Aug 31 21:03:04 2017 rev:3 rq:513572 version:2.4.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/hspec-discover/hspec-discover.changes 2017-04-14 13:39:22.741332200 +0200
+++ /work/SRC/openSUSE:Factory/.hspec-discover.new/hspec-discover.changes 2017-08-31 21:03:05.435549068 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:03:31 UTC 2017 - psimons(a)suse.com
+
+- Update to version 2.4.4.
+
+-------------------------------------------------------------------
Old:
----
hspec-discover-2.4.3.tar.gz
New:
----
hspec-discover-2.4.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ hspec-discover.spec ++++++
--- /var/tmp/diff_new_pack.LwWu5a/_old 2017-08-31 21:03:06.423410271 +0200
+++ /var/tmp/diff_new_pack.LwWu5a/_new 2017-08-31 21:03:06.439408024 +0200
@@ -19,7 +19,7 @@
%global pkg_name hspec-discover
%bcond_with tests
Name: %{pkg_name}
-Version: 2.4.3
+Version: 2.4.4
Release: 0
Summary: Automatically discover and run Hspec tests
License: MIT
++++++ hspec-discover-2.4.3.tar.gz -> hspec-discover-2.4.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hspec-discover-2.4.3/hspec-discover.cabal new/hspec-discover-2.4.4/hspec-discover.cabal
--- old/hspec-discover-2.4.3/hspec-discover.cabal 2017-03-25 12:27:49.000000000 +0100
+++ new/hspec-discover-2.4.4/hspec-discover.cabal 2017-06-16 11:08:31.000000000 +0200
@@ -1,9 +1,9 @@
--- This file has been generated from package.yaml by hpack version 0.17.0.
+-- This file has been generated from package.yaml by hpack version 0.18.0.
--
-- see: https://github.com/sol/hpack
name: hspec-discover
-version: 2.4.3
+version: 2.4.4
license: MIT
license-file: LICENSE
copyright: (c) 2012-2017 Simon Hengel
1
0
Hello community,
here is the log from the commit of package hpack for openSUSE:Factory checked in at 2017-08-31 21:03:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hpack (Old)
and /work/SRC/openSUSE:Factory/.hpack.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hpack"
Thu Aug 31 21:03:02 2017 rev:8 rq:513571 version:0.18.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/hpack/hpack.changes 2017-06-21 13:57:00.788880846 +0200
+++ /work/SRC/openSUSE:Factory/.hpack.new/hpack.changes 2017-08-31 21:03:02.995891845 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:04:28 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.18.1.
+
+-------------------------------------------------------------------
Old:
----
hpack-0.17.1.tar.gz
New:
----
hpack-0.18.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ hpack.spec ++++++
--- /var/tmp/diff_new_pack.xPo86F/_old 2017-08-31 21:03:03.955756982 +0200
+++ /var/tmp/diff_new_pack.xPo86F/_new 2017-08-31 21:03:03.963755858 +0200
@@ -19,7 +19,7 @@
%global pkg_name hpack
%bcond_with tests
Name: %{pkg_name}
-Version: 0.17.1
+Version: 0.18.1
Release: 0
Summary: An alternative format for Haskell packages
License: MIT
@@ -93,6 +93,7 @@
%files
%defattr(-,root,root,-)
%doc LICENSE
+%doc CHANGELOG.md
%{_bindir}/%{name}
%files -n ghc-%{name} -f ghc-%{name}.files
@@ -101,5 +102,6 @@
%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
%defattr(-,root,root,-)
+%doc CHANGELOG.md
%changelog
++++++ hpack-0.17.1.tar.gz -> hpack-0.18.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hpack-0.17.1/CHANGELOG.md new/hpack-0.18.1/CHANGELOG.md
--- old/hpack-0.17.1/CHANGELOG.md 1970-01-01 01:00:00.000000000 +0100
+++ new/hpack-0.18.1/CHANGELOG.md 2017-06-24 02:59:33.000000000 +0200
@@ -0,0 +1,25 @@
+## next
+ - Output generated cabal file to `stdout` when `-` is given as a command-line
+ option (see #113)
+ - Recognize `.chs`, `.y`, `.ly` and `.x` as Haskell modules when inferring
+ modules for
+
+## Change in 0.18.0
+ - Make `executable` a shortcut of `executables: { package-name: ... }`
+ - Add support for `ghcjs-options` and `js-sources` (see #161)
+ - Allow `license-file` to be a list
+ - Accept input file on command-line (see #106)
+ - Add Paths_* when no modules are specified (see #86)
+
+## Changes in 0.17.1
+ - Do not descend into irrelevant directories when inferring modules (see #165)
+
+## Changes in 0.17.0
+ - Added custom-setup section
+ - Add support for `!include` directives
+
+## Changes in 0.16.0
+ - Warn when `name` is missing
+ - Support globs in `c-sources`
+ - Use binary I/O for cabal files avoiding problems with non-UTF-8 locales
+ - Fix rendering of `.` as directory (cabal syntax issue)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hpack-0.17.1/hpack.cabal new/hpack-0.18.1/hpack.cabal
--- old/hpack-0.17.1/hpack.cabal 2017-06-08 05:34:06.000000000 +0200
+++ new/hpack-0.18.1/hpack.cabal 2017-06-24 02:59:33.000000000 +0200
@@ -1,9 +1,9 @@
--- This file has been generated from package.yaml by hpack version 0.17.0.
+-- This file has been generated from package.yaml by hpack version 0.18.0.
--
-- see: https://github.com/sol/hpack
name: hpack
-version: 0.17.1
+version: 0.18.1
synopsis: An alternative format for Haskell packages
description: See README at <https://github.com/sol/hpack#readme>
category: Development
@@ -15,6 +15,9 @@
build-type: Simple
cabal-version: >= 1.10
+extra-source-files:
+ CHANGELOG.md
+
source-repository head
type: git
location: https://github.com/sol/hpack
@@ -45,6 +48,7 @@
Hpack.FormattingHints
Hpack.GenericsUtil
Hpack.Haskell
+ Hpack.Options
Hpack.Render
Hpack.Util
Paths_hpack
@@ -104,6 +108,7 @@
Hpack.FormattingHintsSpec
Hpack.GenericsUtilSpec
Hpack.HaskellSpec
+ Hpack.OptionsSpec
Hpack.RenderSpec
Hpack.RunSpec
Hpack.UtilSpec
@@ -113,6 +118,7 @@
Hpack.FormattingHints
Hpack.GenericsUtil
Hpack.Haskell
+ Hpack.Options
Hpack.Render
Hpack.Run
Hpack.Util
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hpack-0.17.1/src/Hpack/Config.hs new/hpack-0.18.1/src/Hpack/Config.hs
--- old/hpack-0.17.1/src/Hpack/Config.hs 2017-06-08 05:34:06.000000000 +0200
+++ new/hpack-0.18.1/src/Hpack/Config.hs 2017-06-24 02:59:33.000000000 +0200
@@ -80,7 +80,7 @@
, packageCopyright = []
, packageBuildType = Simple
, packageLicense = Nothing
- , packageLicenseFile = Nothing
+ , packageLicenseFile = []
, packageTestedWith = Nothing
, packageFlags = []
, packageExtraSourceFiles = []
@@ -119,7 +119,7 @@
++ maybe [] sectionDependencies packageLibrary
section :: a -> Section a
-section a = Section a [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing [] []
+section a = Section a [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing [] []
packageConfig :: FilePath
packageConfig = "package.yaml"
@@ -230,9 +230,11 @@
, commonOptionsOtherExtensions :: Maybe (List String)
, commonOptionsGhcOptions :: Maybe (List GhcOption)
, commonOptionsGhcProfOptions :: Maybe (List GhcProfOption)
+, commonOptionsGhcjsOptions :: Maybe (List GhcjsOption)
, commonOptionsCppOptions :: Maybe (List CppOption)
, commonOptionsCcOptions :: Maybe (List CcOption)
, commonOptionsCSources :: Maybe (List FilePath)
+, commonOptionsJsSources :: Maybe (List FilePath)
, commonOptionsExtraLibDirs :: Maybe (List FilePath)
, commonOptionsExtraLibraries :: Maybe (List FilePath)
, commonOptionsIncludeDirs :: Maybe (List FilePath)
@@ -308,6 +310,8 @@
"Custom" -> return Custom
_ -> fail "build-type must be one of: Simple, Configure, Make, Custom"
+type ExecutableConfig = CaptureUnknownFields (Section ExecutableSection)
+
data PackageConfig = PackageConfig {
packageConfigName :: Maybe String
, packageConfigVersion :: Maybe String
@@ -322,7 +326,7 @@
, packageConfigCopyright :: Maybe (List String)
, packageConfigBuildType :: Maybe BuildType
, packageConfigLicense :: Maybe String
-, packageConfigLicenseFile :: Maybe String
+, packageConfigLicenseFile :: Maybe (List String)
, packageConfigTestedWith :: Maybe String
, packageConfigFlags :: Maybe (Map String (CaptureUnknownFields FlagSection))
, packageConfigExtraSourceFiles :: Maybe (List FilePath)
@@ -331,7 +335,8 @@
, packageConfigGit :: Maybe String
, packageConfigCustomSetup :: Maybe (CaptureUnknownFields CustomSetupSection)
, packageConfigLibrary :: Maybe (CaptureUnknownFields (Section LibrarySection))
-, packageConfigExecutables :: Maybe (Map String (CaptureUnknownFields (Section ExecutableSection)))
+, packageConfigExecutable :: Maybe ExecutableConfig
+, packageConfigExecutables :: Maybe (Map String ExecutableConfig)
, packageConfigTests :: Maybe (Map String (CaptureUnknownFields (Section ExecutableSection)))
, packageConfigBenchmarks :: Maybe (Map String (CaptureUnknownFields (Section ExecutableSection)))
} deriving (Eq, Show, Generic)
@@ -425,7 +430,7 @@
, packageCopyright :: [String]
, packageBuildType :: BuildType
, packageLicense :: Maybe String
-, packageLicenseFile :: Maybe FilePath
+, packageLicenseFile :: [FilePath]
, packageTestedWith :: Maybe String
, packageFlags :: [Flag]
, packageExtraSourceFiles :: [FilePath]
@@ -463,9 +468,11 @@
, sectionOtherExtensions :: [String]
, sectionGhcOptions :: [GhcOption]
, sectionGhcProfOptions :: [GhcProfOption]
+, sectionGhcjsOptions :: [GhcjsOption]
, sectionCppOptions :: [CppOption]
, sectionCcOptions :: [CcOption]
, sectionCSources :: [FilePath]
+, sectionJsSources :: [FilePath]
, sectionExtraLibDirs :: [FilePath]
, sectionExtraLibraries :: [FilePath]
, sectionIncludeDirs :: [FilePath]
@@ -514,24 +521,30 @@
mkPackage :: FilePath -> (CaptureUnknownFields (Section PackageConfig)) -> IO ([String], Package)
mkPackage dir (CaptureUnknownFields unknownFields globalOptions@Section{sectionData = PackageConfig{..}}) = do
+ libraryResult <- mapM (toLibrary dir packageName_ globalOptions) mLibrarySection
let
- nameWarnings :: [String]
- name :: String
- (nameWarnings, name) = maybe (["Package name not specified, inferred " ++ show inferredName], inferredName) ((,) []) packageConfigName
- where inferredName = takeBaseName dir
-
- mCustomSetup :: Maybe CustomSetup
- mCustomSetup = toCustomSetup <$> mCustomSetupSection
+ executableWarnings :: [String]
+ executableSections :: [(String, Section ExecutableSection)]
+ (executableWarnings, executableSections) = (warnings, map (fmap captureUnknownFieldsValue) sections)
+ where
+ sections = case (packageConfigExecutable, packageConfigExecutables) of
+ (Nothing, Nothing) -> []
+ (Just executable, _) -> [(packageName_, executable)]
+ (Nothing, Just executables) -> Map.toList executables
+
+ warnings = ignoringExecutablesWarning ++ unknownFieldWarnings
+ ignoringExecutablesWarning = case (packageConfigExecutable, packageConfigExecutables) of
+ (Just _, Just _) -> ["Ignoring field \"executables\" in favor of \"executable\""]
+ _ -> []
+ unknownFieldWarnings = formatUnknownSectionFields (isJust packageConfigExecutables) "executable" sections
- libraryResult <- mapM (toLibrary dir name globalOptions) mLibrarySection
- let
mLibrary :: Maybe (Section Library)
mLibrary = fmap snd libraryResult
libraryWarnings :: [String]
libraryWarnings = maybe [] fst libraryResult
- (executablesWarnings, executables) <- toExecutables dir globalOptions (map (fmap captureUnknownFieldsValue) executableSections)
+ (executablesWarnings, executables) <- toExecutables dir globalOptions executableSections
(testsWarnings, tests) <- toExecutables dir globalOptions (map (fmap captureUnknownFieldsValue) testsSections)
(benchmarksWarnings, benchmarks) <- toExecutables dir globalOptions (map (fmap captureUnknownFieldsValue) benchmarkSections)
@@ -553,8 +566,13 @@
let defaultBuildType :: BuildType
defaultBuildType = maybe Simple (const Custom) mCustomSetup
+ configLicenseFiles :: Maybe (List String)
+ configLicenseFiles = packageConfigLicenseFile <|> do
+ guard licenseFileExists
+ Just (List ["LICENSE"])
+
pkg = Package {
- packageName = name
+ packageName = packageName_
, packageVersion = fromMaybe "0.0.0" packageConfigVersion
, packageSynopsis = packageConfigSynopsis
, packageDescription = packageConfigDescription
@@ -567,7 +585,7 @@
, packageCopyright = fromMaybeList packageConfigCopyright
, packageBuildType = fromMaybe defaultBuildType packageConfigBuildType
, packageLicense = packageConfigLicense
- , packageLicenseFile = packageConfigLicenseFile <|> (guard licenseFileExists >> Just "LICENSE")
+ , packageLicenseFile = fromMaybeList configLicenseFiles
, packageTestedWith = packageConfigTestedWith
, packageFlags = flags
, packageExtraSourceFiles = extraSourceFiles
@@ -586,10 +604,11 @@
++ flagWarnings
++ maybe [] (formatUnknownFields "custom-setup section") (captureUnknownFieldsFields <$> packageConfigCustomSetup)
++ maybe [] (formatUnknownFields "library section") (captureUnknownFieldsFields <$> packageConfigLibrary)
- ++ formatUnknownSectionFields "executable" executableSections
- ++ formatUnknownSectionFields "test" testsSections
+ ++ formatUnknownSectionFields True "test" testsSections
+ ++ formatUnknownSectionFields True "benchmark" benchmarkSections
++ formatMissingSourceDirs missingSourceDirs
++ libraryWarnings
+ ++ executableWarnings
++ executablesWarnings
++ testsWarnings
++ benchmarksWarnings
@@ -598,8 +617,15 @@
return (warnings, pkg)
where
- executableSections :: [(String, CaptureUnknownFields (Section ExecutableSection))]
- executableSections = toList packageConfigExecutables
+ nameWarnings :: [String]
+ packageName_ :: String
+ (nameWarnings, packageName_) = case packageConfigName of
+ Nothing -> let inferredName = takeBaseName dir in
+ (["Package name not specified, inferred " ++ show inferredName], inferredName)
+ Just n -> ([], n)
+
+ mCustomSetup :: Maybe CustomSetup
+ mCustomSetup = toCustomSetup <$> mCustomSetupSection
testsSections :: [(String, CaptureUnknownFields (Section ExecutableSection))]
testsSections = toList packageConfigTests
@@ -630,11 +656,13 @@
where
f field = "Ignoring unknown field " ++ show field ++ " in " ++ name
- formatUnknownSectionFields :: String -> [(String, CaptureUnknownFields a)] -> [String]
- formatUnknownSectionFields sectionType = concatMap f . map (fmap captureUnknownFieldsFields)
+ formatUnknownSectionFields :: Bool -> String -> [(String, CaptureUnknownFields a)] -> [String]
+ formatUnknownSectionFields showSect sectionType = concatMap f . map (fmap captureUnknownFieldsFields)
where
f :: (String, [String]) -> [String]
- f (sect, fields) = formatUnknownFields (sectionType ++ " section " ++ show sect) fields
+ f (sect, fields) = formatUnknownFields
+ (sectionType ++ " section" ++ if showSect then " " ++ show sect else "")
+ fields
formatMissingSourceDirs = map f
where
@@ -671,12 +699,23 @@
(warnings, files) <- expandGlobs "c-sources" dir sectionCSources
return (warnings, sect {sectionCSources = files})
+expandJsSources :: FilePath -> Section a -> IO ([String], Section a)
+expandJsSources dir sect@Section{..} = do
+ (warnings, files) <- expandGlobs "js-sources" dir sectionJsSources
+ return (warnings, sect {sectionJsSources = files})
+
+expandForeignSources :: FilePath -> Section a -> IO ([String], Section a)
+expandForeignSources dir sect = do
+ (cWarnings, sect_) <- expandCSources dir sect
+ (jsWarnings, sect__) <- expandJsSources dir sect_
+ return (cWarnings ++ jsWarnings, sect__)
+
toCustomSetup :: CustomSetupSection -> CustomSetup
toCustomSetup CustomSetupSection{..} = CustomSetup
{ customSetupDependencies = fromMaybeList customSetupSectionDependencies }
toLibrary :: FilePath -> String -> Section global -> Section LibrarySection -> IO ([String], Section Library)
-toLibrary dir name globalOptions library = traverse fromLibrarySection sect >>= expandCSources dir
+toLibrary dir name globalOptions library = traverse fromLibrarySection sect >>= expandForeignSources dir
where
sect :: Section LibrarySection
sect = mergeSections globalOptions library
@@ -693,7 +732,7 @@
toExecutables :: FilePath -> Section global -> [(String, Section ExecutableSection)] -> IO ([String], [Section Executable])
toExecutables dir globalOptions executables = do
- result <- mapM toExecutable sections >>= mapM (expandCSources dir)
+ result <- mapM toExecutable sections >>= mapM (expandForeignSources dir)
let (warnings, xs) = unzip result
return (concat warnings, xs)
where
@@ -724,9 +763,11 @@
, sectionOtherExtensions = sectionOtherExtensions globalOptions ++ sectionOtherExtensions options
, sectionGhcOptions = sectionGhcOptions globalOptions ++ sectionGhcOptions options
, sectionGhcProfOptions = sectionGhcProfOptions globalOptions ++ sectionGhcProfOptions options
+ , sectionGhcjsOptions = sectionGhcjsOptions globalOptions ++ sectionGhcjsOptions options
, sectionCppOptions = sectionCppOptions globalOptions ++ sectionCppOptions options
, sectionCcOptions = sectionCcOptions globalOptions ++ sectionCcOptions options
, sectionCSources = sectionCSources globalOptions ++ sectionCSources options
+ , sectionJsSources = sectionJsSources globalOptions ++ sectionJsSources options
, sectionExtraLibDirs = sectionExtraLibDirs globalOptions ++ sectionExtraLibDirs options
, sectionExtraLibraries = sectionExtraLibraries globalOptions ++ sectionExtraLibraries options
, sectionIncludeDirs = sectionIncludeDirs globalOptions ++ sectionIncludeDirs options
@@ -748,9 +789,11 @@
, sectionOtherExtensions = fromMaybeList commonOptionsOtherExtensions
, sectionGhcOptions = fromMaybeList commonOptionsGhcOptions
, sectionGhcProfOptions = fromMaybeList commonOptionsGhcProfOptions
+ , sectionGhcjsOptions = fromMaybeList commonOptionsGhcjsOptions
, sectionCppOptions = fromMaybeList commonOptionsCppOptions
, sectionCcOptions = fromMaybeList commonOptionsCcOptions
, sectionCSources = fromMaybeList commonOptionsCSources
+ , sectionJsSources = fromMaybeList commonOptionsJsSources
, sectionExtraLibDirs = fromMaybeList commonOptionsExtraLibDirs
, sectionExtraLibraries = fromMaybeList commonOptionsExtraLibraries
, sectionIncludeDirs = fromMaybeList commonOptionsIncludeDirs
@@ -779,12 +822,12 @@
determineModules :: String -> [String] -> Maybe (List String) -> Maybe (List String) -> ([String], [String])
determineModules name modules mExposedModules mOtherModules = case (mExposedModules, mOtherModules) of
- (Nothing, Nothing) -> (modules, [])
+ (Nothing, Nothing) -> (modules, [pathsModuleFromPackageName name])
_ -> (exposedModules, otherModules)
- where
- otherModules = maybe ((modules \\ exposedModules) ++ pathsModule) fromList mOtherModules
- exposedModules = maybe (modules \\ otherModules) fromList mExposedModules
- pathsModule = [pathsModuleFromPackageName name] \\ exposedModules
+ where
+ otherModules = maybe ((modules \\ exposedModules) ++ pathsModule) fromList mOtherModules
+ exposedModules = maybe (modules \\ otherModules) fromList mExposedModules
+ pathsModule = [pathsModuleFromPackageName name] \\ exposedModules
getModules :: FilePath -> FilePath -> IO [String]
getModules dir src_ = sort <$> do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hpack-0.17.1/src/Hpack/Options.hs new/hpack-0.18.1/src/Hpack/Options.hs
--- old/hpack-0.17.1/src/Hpack/Options.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hpack-0.18.1/src/Hpack/Options.hs 2017-06-24 02:59:33.000000000 +0200
@@ -0,0 +1,33 @@
+module Hpack.Options where
+
+import Prelude ()
+import Prelude.Compat
+
+data ParseResult = Help | PrintVersion | Run Options | ParseError
+ deriving (Eq, Show)
+
+data Options = Options {
+ optionsVerbose :: Bool
+, optionsToStdout :: Bool
+, optionsTarget :: Maybe FilePath
+} deriving (Eq, Show)
+
+parseOptions :: [String] -> ParseResult
+parseOptions xs = case xs of
+ ["--version"] -> PrintVersion
+ ["--help"] -> Help
+ _ -> case targets of
+ Just (target, toStdout) -> Run (Options verbose toStdout target)
+ Nothing -> ParseError
+ where
+ silentFlag = "--silent"
+ verbose = not (silentFlag `elem` xs)
+ ys = filter (/= silentFlag) xs
+
+ targets = case ys of
+ ["-"] -> Just (Nothing, True)
+ ["-", "-"] -> Nothing
+ [dir] -> Just (Just dir, False)
+ [dir, "-"] -> Just (Just dir, True)
+ [] -> Just (Nothing, False)
+ _ -> Nothing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hpack-0.17.1/src/Hpack/Run.hs new/hpack-0.18.1/src/Hpack/Run.hs
--- old/hpack-0.17.1/src/Hpack/Run.hs 2017-06-08 05:34:06.000000000 +0200
+++ new/hpack-0.18.1/src/Hpack/Run.hs 2017-06-24 02:59:33.000000000 +0200
@@ -34,9 +34,10 @@
import Hpack.Render
import Hpack.FormattingHints
-run :: FilePath -> IO ([String], FilePath, String)
-run dir = do
- mPackage <- readPackageConfig (dir </> packageConfig)
+run :: Maybe FilePath -> FilePath -> IO ([String], FilePath, String)
+run mDir c = do
+ let dir = fromMaybe "" mDir
+ mPackage <- readPackageConfig (dir </> c)
case mPackage of
Right (warnings, pkg) -> do
let cabalFile = dir </> (packageName pkg ++ ".cabal")
@@ -105,7 +106,9 @@
, ("maintainer", formatList packageMaintainer)
, ("copyright", formatList packageCopyright)
, ("license", packageLicense)
- , ("license-file", packageLicenseFile)
+ , case packageLicenseFile of
+ [file] -> ("license-file", Just file)
+ files -> ("license-files", formatList files)
, ("tested-with", packageTestedWith)
, ("build-type", Just (show packageBuildType))
, ("cabal-version", cabalVersion)
@@ -219,11 +222,13 @@
, renderOtherExtensions sectionOtherExtensions
, renderGhcOptions sectionGhcOptions
, renderGhcProfOptions sectionGhcProfOptions
+ , renderGhcjsOptions sectionGhcjsOptions
, renderCppOptions sectionCppOptions
, renderCcOptions sectionCcOptions
, renderDirectories "include-dirs" sectionIncludeDirs
, Field "install-includes" (LineSeparatedList sectionInstallIncludes)
, Field "c-sources" (LineSeparatedList sectionCSources)
+ , Field "js-sources" (LineSeparatedList sectionJsSources)
, renderDirectories "extra-lib-dirs" sectionExtraLibDirs
, Field "extra-libraries" (LineSeparatedList sectionExtraLibraries)
, renderLdOptions sectionLdOptions
@@ -269,6 +274,9 @@
renderGhcProfOptions :: [GhcProfOption] -> Element
renderGhcProfOptions = Field "ghc-prof-options" . WordList
+renderGhcjsOptions :: [GhcjsOption] -> Element
+renderGhcjsOptions = Field "ghcjs-options" . WordList
+
renderCppOptions :: [CppOption] -> Element
renderCppOptions = Field "cpp-options" . WordList
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hpack-0.17.1/src/Hpack/Util.hs new/hpack-0.18.1/src/Hpack/Util.hs
--- old/hpack-0.17.1/src/Hpack/Util.hs 2017-06-08 05:34:06.000000000 +0200
+++ new/hpack-0.18.1/src/Hpack/Util.hs 2017-06-24 02:59:33.000000000 +0200
@@ -3,6 +3,7 @@
List(..)
, GhcOption
, GhcProfOption
+, GhcjsOption
, CppOption
, CcOption
, LdOption
@@ -18,7 +19,6 @@
import Prelude ()
import Prelude.Compat
-import Control.Applicative
import Control.Exception
import Control.Monad.Compat
import Data.Aeson.Types
@@ -54,6 +54,7 @@
type GhcOption = String
type GhcProfOption = String
+type GhcjsOption = String
type CppOption = String
type CcOption = String
type LdOption = String
@@ -77,7 +78,15 @@
toModule path = case reverse path of
[] -> Nothing
x : xs -> do
- m <- stripSuffix ".hs" x <|> stripSuffix ".lhs" x <|> stripSuffix ".hsc" x
+ m <- msum $ map (`stripSuffix` x) [
+ ".hs"
+ , ".lhs"
+ , ".chs"
+ , ".hsc"
+ , ".y"
+ , ".ly"
+ , ".x"
+ ]
let name = reverse (m : xs)
guard (isModule name) >> return (intercalate "." name)
where
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hpack-0.17.1/src/Hpack.hs new/hpack-0.18.1/src/Hpack.hs
--- old/hpack-0.17.1/src/Hpack.hs 2017-06-08 05:34:06.000000000 +0200
+++ new/hpack-0.18.1/src/Hpack.hs 2017-06-24 02:59:33.000000000 +0200
@@ -8,9 +8,9 @@
, main
#ifdef TEST
, hpackWithVersion
-, parseVerbosity
, extractVersion
, parseVersion
+, splitDirectory
#endif
) where
@@ -28,9 +28,12 @@
import System.Environment
import System.Exit
import System.IO
+import System.FilePath
+import System.Directory
import Text.ParserCombinators.ReadP
import Paths_hpack (version)
+import Hpack.Options
import Hpack.Config
import Hpack.Run
import Hpack.Util
@@ -38,9 +41,9 @@
programVersion :: Version -> String
programVersion v = "hpack version " ++ Version.showVersion v
-header :: Version -> String
-header v = unlines [
- "-- This file has been generated from " ++ packageConfig ++ " by " ++ programVersion v ++ "."
+header :: FilePath -> Version -> String
+header p v = unlines [
+ "-- This file has been generated from " ++ p ++ " by " ++ programVersion v ++ "."
, "--"
, "-- see: https://github.com/sol/hpack"
, ""
@@ -49,30 +52,23 @@
main :: IO ()
main = do
args <- getArgs
- case args of
- ["--version"] -> putStrLn (programVersion version)
- ["--help"] -> printHelp
- _ -> case parseVerbosity args of
- (verbose, [dir]) -> hpack dir verbose
- (verbose, []) -> hpack "" verbose
- _ -> do
- printHelp
- exitFailure
+ case parseOptions args of
+ PrintVersion -> putStrLn (programVersion version)
+ Help -> printHelp
+ Run options -> case options of
+ Options _verbose True dir -> hpackStdOut dir
+ Options verbose False dir -> hpack dir verbose
+ ParseError -> do
+ printHelp
+ exitFailure
printHelp :: IO ()
printHelp = do
hPutStrLn stderr $ unlines [
- "Usage: hpack [ --silent ] [ dir ]"
+ "Usage: hpack [ --silent ] [ dir ] [ - ]"
, " hpack --version"
]
-parseVerbosity :: [String] -> (Bool, [String])
-parseVerbosity xs = (verbose, ys)
- where
- silentFlag = "--silent"
- verbose = not (silentFlag `elem` xs)
- ys = filter (/= silentFlag) xs
-
safeInit :: [a] -> [a]
safeInit [] = []
safeInit xs = init xs
@@ -87,10 +83,10 @@
[v] -> Just v
_ -> Nothing
-hpack :: FilePath -> Bool -> IO ()
+hpack :: Maybe FilePath -> Bool -> IO ()
hpack = hpackWithVersion version
-hpackResult :: FilePath -> IO Result
+hpackResult :: Maybe FilePath -> IO Result
hpackResult = hpackWithVersionResult version
data Result = Result {
@@ -101,19 +97,35 @@
data Status = Generated | AlreadyGeneratedByNewerHpack | OutputUnchanged
-hpackWithVersion :: Version -> FilePath -> Bool -> IO ()
-hpackWithVersion v dir verbose = do
- r <- hpackWithVersionResult v dir
- forM_ (resultWarnings r) $ \warning -> hPutStrLn stderr ("WARNING: " ++ warning)
+hpackWithVersion :: Version -> Maybe FilePath -> Bool -> IO ()
+hpackWithVersion v p verbose = do
+ r <- hpackWithVersionResult v p
+ printWarnings (resultWarnings r)
when verbose $ putStrLn $
case resultStatus r of
Generated -> "generated " ++ resultCabalFile r
OutputUnchanged -> resultCabalFile r ++ " is up-to-date"
AlreadyGeneratedByNewerHpack -> resultCabalFile r ++ " was generated with a newer version of hpack, please upgrade and try again."
-hpackWithVersionResult :: Version -> FilePath -> IO Result
-hpackWithVersionResult v dir = do
- (warnings, cabalFile, new) <- run dir
+printWarnings :: [String] -> IO ()
+printWarnings warnings = do
+ forM_ warnings $ \warning -> hPutStrLn stderr ("WARNING: " ++ warning)
+
+splitDirectory :: Maybe FilePath -> IO (Maybe FilePath, FilePath)
+splitDirectory Nothing = return (Nothing, packageConfig)
+splitDirectory (Just p) = do
+ isDirectory <- doesDirectoryExist p
+ return $ if isDirectory
+ then (Just p, packageConfig)
+ else let
+ file = takeFileName p
+ dir = takeDirectory p
+ in (guard (p /= file) >> Just dir, if null file then packageConfig else file)
+
+hpackWithVersionResult :: Version -> Maybe FilePath -> IO Result
+hpackWithVersionResult v p = do
+ (dir, file) <- splitDirectory p
+ (warnings, cabalFile, new) <- run dir file
old <- fmap splitHeader <$> tryReadFile cabalFile
let oldVersion = fmap fst old >>= extractVersion
status <-
@@ -121,7 +133,7 @@
if (fmap snd old == Just (lines new)) then
return OutputUnchanged
else do
- B.writeFile cabalFile $ encodeUtf8 $ T.pack $ header v ++ new
+ B.writeFile cabalFile $ encodeUtf8 $ T.pack $ header file v ++ new
return Generated
else
return AlreadyGeneratedByNewerHpack
@@ -133,3 +145,10 @@
where
splitHeader :: String -> ([String], [String])
splitHeader = fmap (dropWhile null) . span ("--" `isPrefixOf`) . lines
+
+hpackStdOut :: Maybe FilePath -> IO ()
+hpackStdOut p = do
+ (dir, file) <- splitDirectory p
+ (warnings, _cabalFile, new) <- run dir file
+ B.putStr $ encodeUtf8 $ T.pack new
+ printWarnings warnings
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hpack-0.17.1/test/Hpack/ConfigSpec.hs new/hpack-0.18.1/test/Hpack/ConfigSpec.hs
--- old/hpack-0.17.1/test/Hpack/ConfigSpec.hs 2017-06-08 05:34:06.000000000 +0200
+++ new/hpack-0.18.1/test/Hpack/ConfigSpec.hs 2017-06-24 02:59:33.000000000 +0200
@@ -6,7 +6,6 @@
, package
, executable
-, library
) where
import Helper
@@ -30,7 +29,7 @@
executable name main_ = Executable name main_ []
library :: Library
-library = Library Nothing [] [] []
+library = Library Nothing [] ["Paths_foo"] []
withPackage :: String -> IO () -> (([String], Package) -> Expectation) -> Expectation
withPackage content beforeAction expectation = withTempDirectory $ \dir_ -> do
@@ -117,6 +116,15 @@
captureUnknownFieldsValue <$> decodeEither input
`shouldBe` Right (section Empty){sectionCSources = ["foo.c", "bar/*.c"]}
+ it "accepts js-sources" $ do
+ let input = [i|
+ js-sources:
+ - foo.js
+ - bar/*.js
+ |]
+ captureUnknownFieldsValue <$> decodeEither input
+ `shouldBe` Right (section Empty){sectionJsSources = ["foo.js", "bar/*.js"]}
+
it "accepts extra-lib-dirs" $ do
let input = [i|
extra-lib-dirs:
@@ -296,6 +304,9 @@
it "adds the Paths_* module to the other-modules" $ do
determineModules "foo" [] (Just $ List ["Foo"]) Nothing `shouldBe` (["Foo"], ["Paths_foo"])
+ it "adds the Paths_* module to the other-modules when no modules are specified" $ do
+ determineModules "foo" [] Nothing Nothing `shouldBe` ([], ["Paths_foo"])
+
it "replaces dashes with underscores in Paths_*" $ do
determineModules "foo-bar" [] (Just $ List ["Foo"]) Nothing `shouldBe` (["Foo"], ["Paths_foo_bar"])
@@ -470,13 +481,19 @@
(do
touch "LICENSE"
)
- (packageLicenseFile >>> (`shouldBe` Just "LICENSE"))
+ (packageLicenseFile >>> (`shouldBe` ["LICENSE"]))
it "accepts license file" $ do
withPackageConfig_ [i|
license-file: FOO
|]
- (packageLicenseFile >>> (`shouldBe` Just "FOO"))
+ (packageLicenseFile >>> (`shouldBe` ["FOO"]))
+
+ it "accepts list of license files" $ do
+ withPackageConfig_ [i|
+ license-file: [FOO, BAR]
+ |]
+ (packageLicenseFile >>> (`shouldBe` ["FOO", "BAR"]))
it "accepts build-type: Simple" $ do
withPackageConfig_ [i|
@@ -619,6 +636,30 @@
}
)
+ it "accepts ghcjs-options" $ do
+ withPackageConfig_ [i|
+ ghcjs-options: -dedupe
+ library:
+ ghcjs-options: -ghcjs1
+
+ executables:
+ foo:
+ main: Main.hs
+ ghcjs-options: -ghcjs2
+
+
+ tests:
+ spec:
+ main: Spec.hs
+ ghcjs-options: -ghcjs3
+ |]
+ (`shouldBe` package {
+ packageLibrary = Just (section library) {sectionGhcjsOptions = ["-dedupe", "-ghcjs1"]}
+ , packageExecutables = [(section $ executable "foo" "Main.hs") {sectionGhcjsOptions = ["-dedupe", "-ghcjs2"]}]
+ , packageTests = [(section $ executable "spec" "Spec.hs") {sectionGhcjsOptions = ["-dedupe", "-ghcjs3"]}]
+ }
+ )
+
it "accepts ld-options" $ do
withPackageConfig_ [i|
library:
@@ -787,6 +828,30 @@
)
(packageLibrary >>> (`shouldBe` Just (section library) {sectionCSources = ["cbits/bar.c", "cbits/foo.c"]}))
+ it "accepts js-sources" $ do
+ withPackageConfig [i|
+ library:
+ js-sources:
+ - jsbits/*.js
+ |]
+ (do
+ touch "jsbits/foo.js"
+ touch "jsbits/bar.js"
+ )
+ (packageLibrary >>> (`shouldBe` Just (section library) {sectionJsSources = ["jsbits/bar.js", "jsbits/foo.js"]}))
+
+ it "accepts global js-sources" $ do
+ withPackageConfig [i|
+ js-sources:
+ - jsbits/*.js
+ library: {}
+ |]
+ (do
+ touch "jsbits/foo.js"
+ touch "jsbits/bar.js"
+ )
+ (packageLibrary >>> (`shouldBe` Just (section library) {sectionJsSources = ["jsbits/bar.js", "jsbits/foo.js"]}))
+
it "allows to specify exposed" $ do
withPackageConfig_ [i|
library:
@@ -865,7 +930,7 @@
]
)
- it "reads executable section" $ do
+ it "reads executables section" $ do
withPackageConfig_ [i|
executables:
foo:
@@ -873,6 +938,44 @@
|]
(packageExecutables >>> (`shouldBe` [section $ executable "foo" "driver/Main.hs"]))
+ it "reads executable section" $ do
+ withPackageConfig_ [i|
+ executable:
+ main: driver/Main.hs
+ |]
+ (packageExecutables >>> (`shouldBe` [section $ executable "foo" "driver/Main.hs"]))
+
+ it "warns on unknown executable fields" $ do
+ withPackageWarnings_ [i|
+ name: foo
+ executable:
+ main: Main.hs
+ unknown: true
+ |]
+ (`shouldBe` ["Ignoring unknown field \"unknown\" in executable section"])
+
+ context "with both executable and executables" $ do
+ it "gives executable precedence" $ do
+ withPackageConfig_ [i|
+ executable:
+ main: driver/Main1.hs
+ executables:
+ foo2:
+ main: driver/Main2.hs
+ |]
+ (packageExecutables >>> (`shouldBe` [section $ executable "foo" "driver/Main1.hs"]))
+
+ it "warns" $ do
+ withPackageWarnings_ [i|
+ name: foo
+ executable:
+ main: driver/Main1.hs
+ executables:
+ foo2:
+ main: driver/Main2.hs
+ |]
+ (`shouldBe` ["Ignoring field \"executables\" in favor of \"executable\""])
+
it "accepts arbitrary entry points as main" $ do
withPackageConfig_ [i|
executables:
@@ -1041,6 +1144,50 @@
)
(`shouldBe` package {packageExecutables = [(section $ executable "foo" "driver/Main.hs") {sectionCSources = ["cbits/bar.c", "cbits/foo.c"]}]})
+ it "accepts js-sources" $ do
+ withPackageConfig [i|
+ executables:
+ foo:
+ main: driver/Main.hs
+ js-sources:
+ - jsbits/*.js
+ |]
+ (do
+ touch "jsbits/foo.js"
+ touch "jsbits/bar.js"
+ )
+ (`shouldBe` package {packageExecutables = [(section $ executable "foo" "driver/Main.hs") {sectionJsSources = ["jsbits/bar.js", "jsbits/foo.js"]}]})
+
+ it "accepts global js-sources" $ do
+ withPackageConfig [i|
+ js-sources:
+ - jsbits/*.js
+ executables:
+ foo:
+ main: driver/Main.hs
+ |]
+ (do
+ touch "jsbits/foo.js"
+ touch "jsbits/bar.js"
+ )
+ (`shouldBe` package {packageExecutables = [(section $ executable "foo" "driver/Main.hs") {sectionJsSources = ["jsbits/bar.js", "jsbits/foo.js"]}]})
+
+ context "when reading benchmark section" $ do
+ it "warns on unknown fields" $ do
+ withPackageWarnings_ [i|
+ name: foo
+ benchmarks:
+ foo:
+ main: Main.hs
+ bar: 42
+ baz: 23
+ |]
+ (`shouldBe` [
+ "Ignoring unknown field \"bar\" in benchmark section \"foo\""
+ , "Ignoring unknown field \"baz\" in benchmark section \"foo\""
+ ]
+ )
+
context "when reading test section" $ do
it "warns on unknown fields" $ do
withPackageWarnings_ [i|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hpack-0.17.1/test/Hpack/OptionsSpec.hs new/hpack-0.18.1/test/Hpack/OptionsSpec.hs
--- old/hpack-0.17.1/test/Hpack/OptionsSpec.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hpack-0.18.1/test/Hpack/OptionsSpec.hs 2017-06-24 02:59:33.000000000 +0200
@@ -0,0 +1,41 @@
+module Hpack.OptionsSpec (spec) where
+
+import Helper
+
+import Prelude ()
+import Prelude.Compat
+
+import Hpack.Options
+
+spec :: Spec
+spec = do
+ describe "parseOptions" $ do
+ context "with --help" $ do
+ it "returns Help" $ do
+ parseOptions ["--help"] `shouldBe` Help
+
+ context "with --version" $ do
+ it "returns PrintVersion" $ do
+ parseOptions ["--version"] `shouldBe` PrintVersion
+
+ context "by default" $ do
+ it "returns Run" $ do
+ parseOptions [] `shouldBe` Run (Options True False Nothing)
+
+ it "includes target" $ do
+ parseOptions ["foo"] `shouldBe` Run (Options True False (Just "foo"))
+
+ context "with superfluous arguments" $ do
+ it "returns ParseError" $ do
+ parseOptions ["foo", "bar"] `shouldBe` ParseError
+
+ context "with --silent" $ do
+ it "sets optionsVerbose to False" $ do
+ parseOptions ["--silent"] `shouldBe` Run (Options False False Nothing)
+
+ context "with -" $ do
+ it "sets optionsToStdout to True" $ do
+ parseOptions ["-"] `shouldBe` Run (Options True True Nothing)
+
+ it "rejects - for target" $ do
+ parseOptions ["-", "-"] `shouldBe` ParseError
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hpack-0.17.1/test/Hpack/RunSpec.hs new/hpack-0.18.1/test/Hpack/RunSpec.hs
--- old/hpack-0.17.1/test/Hpack/RunSpec.hs 2017-06-08 05:34:06.000000000 +0200
+++ new/hpack-0.18.1/test/Hpack/RunSpec.hs 2017-06-24 02:59:33.000000000 +0200
@@ -1,7 +1,7 @@
{-# LANGUAGE OverloadedStrings #-}
module Hpack.RunSpec (spec) where
-import Test.Hspec
+import Helper
import Data.List.Compat
import Hpack.ConfigSpec hiding (spec)
@@ -9,6 +9,9 @@
import Hpack.Render
import Hpack.Run
+library :: Library
+library = Library Nothing [] [] []
+
spec :: Spec
spec = do
describe "renderPackage" $ do
@@ -60,6 +63,25 @@
, "cabal-version: >= 1.10"
]
+ it "includes license-file" $ do
+ renderPackage_ package {packageLicenseFile = ["FOO"]} `shouldBe` unlines [
+ "name: foo"
+ , "version: 0.0.0"
+ , "license-file: FOO"
+ , "build-type: Simple"
+ , "cabal-version: >= 1.10"
+ ]
+
+ it "aligns license-files" $ do
+ renderPackage defaultRenderSettings 16 [] [] package {packageLicenseFile = ["FOO", "BAR"]} `shouldBe` unlines [
+ "name: foo"
+ , "version: 0.0.0"
+ , "license-files: FOO,"
+ , " BAR"
+ , "build-type: Simple"
+ , "cabal-version: >= 1.10"
+ ]
+
it "includes copyright holder" $ do
renderPackage_ package {packageCopyright = ["(c) 2015 Simon Hengel"]} `shouldBe` unlines [
"name: foo"
@@ -244,6 +266,7 @@
, " ghc-prof-options: -fprof-auto -rtsopts"
, " default-language: Haskell2010"
]
+
describe "renderConditional" $ do
it "renders conditionals" $ do
let conditional = Conditional "os(windows)" (section ()) {sectionDependencies = ["Win32"]} Nothing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hpack-0.17.1/test/HpackSpec.hs new/hpack-0.18.1/test/HpackSpec.hs
--- old/hpack-0.17.1/test/HpackSpec.hs 2017-06-08 05:34:06.000000000 +0200
+++ new/hpack-0.18.1/test/HpackSpec.hs 2017-06-24 02:59:33.000000000 +0200
@@ -1,5 +1,7 @@
module HpackSpec (spec) where
+import Helper
+
import Prelude ()
import Prelude.Compat
@@ -7,8 +9,6 @@
import Control.DeepSeq
import Data.Version (Version(..), showVersion)
-import Test.Hspec
-import Test.Mockery.Directory
import Test.QuickCheck
import Hpack
@@ -18,14 +18,6 @@
spec :: Spec
spec = do
- describe "parseVerbosity" $ do
- it "returns True by default" $ do
- parseVerbosity ["foo"] `shouldBe` (True, ["foo"])
-
- context "with --silent" $ do
- it "returns False" $ do
- parseVerbosity ["--silent"] `shouldBe` (False, [])
-
describe "extractVersion" $ do
it "extracts Hpack version from a cabal file" $ do
let cabalFile = ["-- This file has been generated from package.yaml by hpack version 0.10.0."]
@@ -47,9 +39,9 @@
it "does not write a new cabal file" $ do
inTempDirectory $ do
writeFile "package.yaml" "name: foo"
- hpackWithVersion (makeVersion [0,8,0]) "." False
+ hpackWithVersion (makeVersion [0,8,0]) Nothing False
old <- readFile "foo.cabal" >>= (return $!!)
- hpackWithVersion (makeVersion [0,10,0]) "." False
+ hpackWithVersion (makeVersion [0,10,0]) Nothing False
readFile "foo.cabal" `shouldReturn` old
context "when exsting cabal file was generated with a newer version of hpack" $ do
@@ -59,7 +51,7 @@
"name: foo"
, "version: 0.1.0"
]
- hpackWithVersion (makeVersion [0,10,0]) "." False
+ hpackWithVersion (makeVersion [0,10,0]) Nothing False
old <- readFile "foo.cabal" >>= (return $!!)
writeFile "package.yaml" $ unlines [
@@ -67,5 +59,43 @@
, "version: 0.2.0"
]
- hpackWithVersion (makeVersion [0,8,0]) "." False
+ hpackWithVersion (makeVersion [0,8,0]) Nothing False
readFile "foo.cabal" `shouldReturn` old
+
+ describe "splitDirectory" $ do
+ context "when given Nothing" $ do
+ it "defaults file name to package.yaml" $ do
+ splitDirectory Nothing `shouldReturn` (Nothing, "package.yaml")
+
+ context "when given a directory" $ do
+ it "defaults file name to package.yaml" $ do
+ withTempDirectory $ \dir -> do
+ splitDirectory (Just dir) `shouldReturn` (Just dir, "package.yaml")
+
+ context "when given a file name" $ do
+ it "defaults directory to Nothing" $ do
+ inTempDirectory $ do
+ touch "foo.yaml"
+ splitDirectory (Just "foo.yaml") `shouldReturn` (Nothing, "foo.yaml")
+
+ context "when given a path to a file" $ do
+ it "splits directory from file name" $ do
+ withTempDirectory $ \dir -> do
+ let file = dir </> "foo.yaml"
+ touch file
+ splitDirectory (Just file) `shouldReturn` (Just dir, "foo.yaml")
+
+ context "when path does not exist" $ do
+ it "defaults directory to Nothing" $ do
+ inTempDirectory $ do
+ splitDirectory (Just "test/foo.yaml") `shouldReturn` (Just "test", "foo.yaml")
+
+ context "when file does not exist" $ do
+ it "defaults directory to Nothing" $ do
+ inTempDirectory $ do
+ splitDirectory (Just "test") `shouldReturn` (Nothing, "test")
+
+ context "when directory does not exist" $ do
+ it "defaults directory to Nothing" $ do
+ inTempDirectory $ do
+ splitDirectory (Just "test/") `shouldReturn` (Just "test", "package.yaml")
1
0
Hello community,
here is the log from the commit of package hlint for openSUSE:Factory checked in at 2017-08-31 21:02:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hlint (Old)
and /work/SRC/openSUSE:Factory/.hlint.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hlint"
Thu Aug 31 21:02:59 2017 rev:13 rq:513570 version:2.0.9
Changes:
--------
--- /work/SRC/openSUSE:Factory/hlint/hlint.changes 2017-04-13 10:44:44.324238718 +0200
+++ /work/SRC/openSUSE:Factory/.hlint.new/hlint.changes 2017-08-31 21:03:00.916184048 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:04:59 UTC 2017 - psimons(a)suse.com
+
+- Update to version 2.0.9.
+
+-------------------------------------------------------------------
Old:
----
hlint-1.9.41.tar.gz
New:
----
hlint-2.0.9.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ hlint.spec ++++++
--- /var/tmp/diff_new_pack.HV0CD3/_old 2017-08-31 21:03:02.339984001 +0200
+++ /var/tmp/diff_new_pack.HV0CD3/_new 2017-08-31 21:03:02.379978381 +0200
@@ -18,7 +18,7 @@
%global pkg_name hlint
Name: %{pkg_name}
-Version: 1.9.41
+Version: 2.0.9
Release: 0
Summary: Source code suggestions
License: BSD-3-Clause
@@ -28,6 +28,7 @@
BuildRequires: chrpath
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-ansi-terminal-devel
+BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-cmdargs-devel
BuildRequires: ghc-containers-devel
BuildRequires: ghc-cpphs-devel
@@ -39,8 +40,12 @@
BuildRequires: ghc-process-devel
BuildRequires: ghc-refact-devel
BuildRequires: ghc-rpm-macros
+BuildRequires: ghc-text-devel
BuildRequires: ghc-transformers-devel
BuildRequires: ghc-uniplate-devel
+BuildRequires: ghc-unordered-containers-devel
+BuildRequires: ghc-vector-devel
+BuildRequires: ghc-yaml-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -87,10 +92,8 @@
%doc CHANGES.txt README.md
%{_bindir}/%{name}
%dir %{_datadir}/%{name}-%{version}
-%{_datadir}/%{name}-%{version}/Default.hs
-%{_datadir}/%{name}-%{version}/Generalise.hs
-%{_datadir}/%{name}-%{version}/Dollar.hs
-%{_datadir}/%{name}-%{version}/HLint.hs
+%{_datadir}/%{name}-%{version}/hlint.yaml
+%{_datadir}/%{name}-%{version}/default.yaml
%{_datadir}/%{name}-%{version}/Test.hs
%{_datadir}/%{name}-%{version}/report_template.html
%{_datadir}/%{name}-%{version}/hs-lint.el
++++++ hlint-1.9.41.tar.gz -> hlint-2.0.9.tar.gz ++++++
++++ 5292 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package hapistrano for openSUSE:Factory checked in at 2017-08-31 21:02:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hapistrano (Old)
and /work/SRC/openSUSE:Factory/.hapistrano.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hapistrano"
Thu Aug 31 21:02:56 2017 rev:2 rq:513565 version:0.3.2.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/hapistrano/hapistrano.changes 2017-03-24 02:05:07.688386543 +0100
+++ /work/SRC/openSUSE:Factory/.hapistrano.new/hapistrano.changes 2017-08-31 21:02:57.544657753 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:08:14 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.3.2.2.
+
+-------------------------------------------------------------------
Old:
----
hapistrano-0.2.1.2.tar.gz
New:
----
hapistrano-0.3.2.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ hapistrano.spec ++++++
--- /var/tmp/diff_new_pack.dZVskP/_old 2017-08-31 21:02:58.564514462 +0200
+++ /var/tmp/diff_new_pack.dZVskP/_new 2017-08-31 21:02:58.580512214 +0200
@@ -1,7 +1,7 @@
#
# spec file for package hapistrano
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 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,32 +19,34 @@
%global pkg_name hapistrano
%bcond_with tests
Name: %{pkg_name}
-Version: 0.2.1.2
+Version: 0.3.2.2
Release: 0
Summary: A deployment library for Haskell applications
License: MIT
Group: Development/Languages/Other
Url: https://hackage.haskell.org/package/%{name}
Source0: https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.t…
-# Begin cabal-rpm deps:
BuildRequires: chrpath
BuildRequires: ghc-Cabal-devel
-BuildRequires: ghc-base-compat-devel
-BuildRequires: ghc-either-devel
+BuildRequires: ghc-aeson-devel
+BuildRequires: ghc-async-devel
BuildRequires: ghc-filepath-devel
BuildRequires: ghc-mtl-devel
+BuildRequires: ghc-optparse-applicative-devel
+BuildRequires: ghc-path-devel
+BuildRequires: ghc-path-io-devel
BuildRequires: ghc-process-devel
BuildRequires: ghc-rpm-macros
+BuildRequires: ghc-stm-devel
BuildRequires: ghc-time-devel
-BuildRequires: ghc-time-locale-compat-devel
BuildRequires: ghc-transformers-devel
+BuildRequires: ghc-yaml-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{with tests}
BuildRequires: ghc-directory-devel
BuildRequires: ghc-hspec-devel
BuildRequires: ghc-temporary-devel
%endif
-# End cabal-rpm deps
%description
Hapistrano makes it easy to reliably deploy Haskell applications to a server.
@@ -82,22 +84,15 @@
%prep
%setup -q
-
%build
%ghc_lib_build
-
%install
%ghc_lib_install
-
-%ghc_fix_dynamic_rpath hap
-
+%ghc_fix_rpath %{pkg_name}-%{version}
%check
-%if %{with tests}
-%{cabal} test
-%endif
-
+%cabal_test
%post -n ghc-%{name}-devel
%ghc_pkg_recache
@@ -108,8 +103,11 @@
%files
%defattr(-,root,root,-)
%doc LICENSE
-%doc README.md
+%doc CHANGELOG.md README.md
%{_bindir}/hap
+%dir %{_datadir}/%{name}-%{version}
+%dir %{_datadir}/%{name}-%{version}/script
+%{_datadir}/%{name}-%{version}/script/clean-build.sh
%files -n ghc-%{name} -f ghc-%{name}.files
%defattr(-,root,root,-)
@@ -117,6 +115,6 @@
%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
%defattr(-,root,root,-)
-%doc README.md
+%doc CHANGELOG.md README.md
%changelog
++++++ hapistrano-0.2.1.2.tar.gz -> hapistrano-0.3.2.2.tar.gz ++++++
++++ 2518 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package gipeda for openSUSE:Factory checked in at 2017-08-31 21:02:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gipeda (Old)
and /work/SRC/openSUSE:Factory/.gipeda.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gipeda"
Thu Aug 31 21:02:53 2017 rev:2 rq:513564 version:0.3.3.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/gipeda/gipeda.changes 2017-05-17 10:52:02.194389529 +0200
+++ /work/SRC/openSUSE:Factory/.gipeda.new/gipeda.changes 2017-08-31 21:02:55.480947709 +0200
@@ -1,0 +2,5 @@
+Fri Jul 28 07:54:15 UTC 2017 - psimons(a)suse.com
+
+- Relax the over-specified version constraint on concurrent-output.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gipeda.spec ++++++
--- /var/tmp/diff_new_pack.W1cvRc/_old 2017-08-31 21:02:56.612788683 +0200
+++ /var/tmp/diff_new_pack.W1cvRc/_new 2017-08-31 21:02:56.656782502 +0200
@@ -72,6 +72,7 @@
%prep
%setup -q
+cabal-tweak-dep-ver concurrent-output '< 1.8' ' < 2'
%build
%ghc_bin_build
1
0
Hello community,
here is the log from the commit of package ghc-yi-snippet for openSUSE:Factory checked in at 2017-08-31 21:02:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-yi-snippet (Old)
and /work/SRC/openSUSE:Factory/.ghc-yi-snippet.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-yi-snippet"
Thu Aug 31 21:02:50 2017 rev:3 rq:513563 version:0.14.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-yi-snippet/ghc-yi-snippet.changes 2017-07-06 00:00:39.205510444 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-yi-snippet.new/ghc-yi-snippet.changes 2017-08-31 21:02:53.245261827 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:06:44 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.14.0.
+
+-------------------------------------------------------------------
Old:
----
yi-snippet-0.13.7.tar.gz
New:
----
yi-snippet-0.14.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-yi-snippet.spec ++++++
--- /var/tmp/diff_new_pack.J9QiQf/_old 2017-08-31 21:02:54.549078638 +0200
+++ /var/tmp/diff_new_pack.J9QiQf/_new 2017-08-31 21:02:54.569075828 +0200
@@ -19,7 +19,7 @@
%global pkg_name yi-snippet
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.13.7
+Version: 0.14.0
Release: 0
Summary: Snippet support for yi
License: GPL-2.0+
++++++ yi-snippet-0.13.7.tar.gz -> yi-snippet-0.14.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yi-snippet-0.13.7/yi-snippet.cabal new/yi-snippet-0.14.0/yi-snippet.cabal
--- old/yi-snippet-0.13.7/yi-snippet.cabal 2017-06-17 19:57:23.000000000 +0200
+++ new/yi-snippet-0.14.0/yi-snippet.cabal 2017-06-19 21:18:28.000000000 +0200
@@ -3,7 +3,7 @@
-- see: https://github.com/sol/hpack
name: yi-snippet
-version: 0.13.7
+version: 0.14.0
synopsis: Snippet support for yi
category: Yi
homepage: https://github.com/yi-editor/yi#readme
@@ -23,16 +23,16 @@
ghc-options: -Wall -ferror-spans
build-depends:
base >= 4.8 && < 5
- , binary >= 0.7.5
, containers >= 0.5.6
+ , yi-rope >= 0.7
+ , binary >= 0.7.5
, data-default >= 0.5
, free >= 4.12
, microlens-platform
, mtl >= 2.2
, text >= 1.2
, vector >= 0.11
- , yi-core >= 0.13.1
- , yi-rope >= 0.7
+ , yi-core >= 0.14.0
exposed-modules:
Yi.Snippet
Yi.Snippet.Internal
@@ -48,15 +48,7 @@
ghc-options: -Wall -ferror-spans
build-depends:
base >= 4.8 && < 5
- , binary >= 0.7.5
, containers >= 0.5.6
- , data-default >= 0.5
- , free >= 4.12
- , microlens-platform
- , mtl >= 2.2
- , text >= 1.2
- , vector >= 0.11
- , yi-core >= 0.13.1
, yi-rope >= 0.7
, tasty-th
, tasty-hunit
1
0
Hello community,
here is the log from the commit of package ghc-yi-rope for openSUSE:Factory checked in at 2017-08-31 21:02:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-yi-rope (Old)
and /work/SRC/openSUSE:Factory/.ghc-yi-rope.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-yi-rope"
Thu Aug 31 21:02:46 2017 rev:3 rq:513562 version:0.9
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-yi-rope/ghc-yi-rope.changes 2017-04-07 13:55:28.989032222 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-yi-rope.new/ghc-yi-rope.changes 2017-08-31 21:02:50.925587746 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:08:04 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.9.
+
+-------------------------------------------------------------------
Old:
----
yi-rope-0.8.tar.gz
New:
----
yi-rope-0.9.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-yi-rope.spec ++++++
--- /var/tmp/diff_new_pack.hC6bzx/_old 2017-08-31 21:02:52.357386575 +0200
+++ /var/tmp/diff_new_pack.hC6bzx/_new 2017-08-31 21:02:52.377383766 +0200
@@ -19,7 +19,7 @@
%global pkg_name yi-rope
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.8
+Version: 0.9
Release: 0
Summary: A rope data structure used by Yi
License: GPL-2.0+
++++++ yi-rope-0.8.tar.gz -> yi-rope-0.9.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yi-rope-0.8/bench/MainBenchmarkSuite.hs new/yi-rope-0.9/bench/MainBenchmarkSuite.hs
--- old/yi-rope-0.8/bench/MainBenchmarkSuite.hs 2016-10-07 19:59:34.000000000 +0200
+++ new/yi-rope-0.9/bench/MainBenchmarkSuite.hs 2017-07-03 23:38:45.000000000 +0200
@@ -84,7 +84,7 @@
mkTexts x t = (x, F.fromText' x t)
allTexts :: [(Int -> String, [(Int, F.YiString)])]
-allTexts = [longTexts {-, wideTexts, shortTexts, tinyTexts -}]
+allTexts = [longTexts, wideTexts, shortTexts, tinyTexts]
allChars :: [(Int -> String, [(Int, Char)])]
allChars = map mkChar "λa"
@@ -160,6 +160,7 @@
, onCharGroup "singleton" F.singleton
, onTextGroup "countNewLines" F.countNewLines
, onTextGroup "lines" F.lines
+ , onTextGroup "lines'" F.lines'
, onSplitGroup "splitAt" F.splitAt
, onSplitGroup "splitAtLine" F.splitAtLine
, onTextGroup "toReverseString" F.toReverseString
@@ -181,4 +182,4 @@
] ++ splitBench
++ wordsBench
++ spanBreakBench
- ++ foldBench
+ ++ foldBench
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yi-rope-0.8/src/Yi/Rope.hs new/yi-rope-0.9/src/Yi/Rope.hs
--- old/yi-rope-0.8/src/Yi/Rope.hs 2016-10-10 15:23:38.000000000 +0200
+++ new/yi-rope-0.9/src/Yi/Rope.hs 2017-07-03 23:38:45.000000000 +0200
@@ -2,6 +2,7 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_HADDOCK show-extensions #-}
-- |
@@ -70,6 +71,7 @@
import Data.Default
import qualified Data.FingerTree as T
import Data.FingerTree hiding (null, empty, reverse, split)
+import Data.Function (fix)
import qualified Data.List as L (foldl')
import Data.Maybe
import Data.Monoid
@@ -501,24 +503,18 @@
go acc (t':ts') = go (acc <> (c `cons` t')) ts'
-- | Add a 'Char' in front of a 'YiString'.
---
--- We add the character to the front of the first chunk. This does
--- mean that a lot of 'cons' might result in an abnormally large first
--- chunk so if you have to do that, consider using 'append' instead..
cons :: Char -> YiString -> YiString
cons c (YiString t) = case viewl t of
EmptyL -> Yi.Rope.singleton c
- Chunk !l x :< ts -> YiString $ Chunk (l + 1) (c `TX.cons` x) <| ts
+ Chunk l x :< ts | l < defaultChunkSize -> YiString $ Chunk (l + 1) (c `TX.cons` x) <| ts
+ _ -> YiString $ Chunk 1 (TX.singleton c) <| t
-- | Add a 'Char' in the back of a 'YiString'.
---
--- We add the character to the end of the last chunk. This does mean
--- that a lot of 'snoc' might result in an abnormally large last chunk
--- so if you have to do that, consider using 'append' instead..
snoc :: YiString -> Char -> YiString
snoc (YiString t) c = case viewr t of
EmptyR -> Yi.Rope.singleton c
- ts :> Chunk l x -> YiString $ ts |> Chunk (l + 1) (x `TX.snoc` c)
+ ts :> Chunk l x | l < defaultChunkSize -> YiString $ ts |> Chunk (l + 1) (x `TX.snoc` c)
+ _ -> YiString $ t |> Chunk 1 (TX.singleton c)
-- | Single character 'YiString'. Consider whether it's worth creating
-- this, maybe you can use 'cons' or 'snoc' instead?
@@ -569,26 +565,11 @@
-- | This is like 'lines'' but it does *not* preserve newlines.
--
--- Specifically, we just strip the newlines from the result of
--- 'lines''.
---
--- This behaves slightly differently than the old split: the number of
--- resulting strings here is equal to the number of newline characters
--- in the underlying string. This is much more consistent than the old
--- behaviour which blindly used @ByteString@s split and stitched the
--- result back together which was inconsistent with the rest of the
--- interface which worked with number of newlines.
+-- Implementation note: GHC does a pretty good job of optimizing
+-- this naive version. Hand coding a loop should be unnecessary
+-- here.
lines :: YiString -> [YiString]
-lines = Prelude.map dropNl . lines'
- where
- dropNl (YiString t) = case viewr t of
- EmptyR -> Yi.Rope.empty
- ts :> ch@(Chunk l tx) ->
- YiString $ ts |- if TX.null tx
- then ch
- else case TX.last tx of
- '\n' -> Chunk (l - 1) (TX.init tx)
- _ -> ch
+lines = fmap fromText . TX.lines . toText
-- | Splits the 'YiString' into a list of 'YiString' each containing a
-- line.
@@ -603,13 +584,15 @@
--
-- > 'toText' . 'concat' . 'lines'' ≡ 'toText'
--
--- but the underlying structure might change: notably, chunks will
--- most likely change sizes.
lines' :: YiString -> [YiString]
-lines' t = let (YiString f, YiString s) = splitAtLine' 0 t
- in if T.null s
- then if T.null f then [] else [YiString f]
- else YiString f : lines' (YiString s)
+lines' = splitByKeepingDelim '\n'
+
+splitByKeepingDelim :: Char -> YiString -> [YiString]
+splitByKeepingDelim x = fmap fromText . fix go x . toText
+ where
+ go :: (Char -> TX.Text -> [TX.Text]) -> Char -> TX.Text -> [TX.Text]
+ go _ c (TX.span (/=c) -> (_, TX.null -> True)) = []
+ go f c (TX.span (/=c) -> (a,b)) = a `TX.snoc` c : f c (TX.tail b)
-- | Joins up lines by a newline character. It does not leave a
-- newline after the last line. If you want a more classical
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yi-rope-0.8/yi-rope.cabal new/yi-rope-0.9/yi-rope.cabal
--- old/yi-rope-0.8/yi-rope.cabal 2016-10-10 15:27:03.000000000 +0200
+++ new/yi-rope-0.9/yi-rope.cabal 2017-07-03 22:35:43.000000000 +0200
@@ -1,17 +1,17 @@
name: yi-rope
-version: 0.8
+version: 0.9
synopsis: A rope data structure used by Yi
description: A rope data structure used by Yi
license: GPL-2
license-file: LICENSE
-author: Mateusz Kowalczyk
-maintainer: fuuzetsu(a)fuuzetsu.co.uk
+author: AUTHORS
+maintainer: yi-devel(a)googlegroups.com
category: Yi
build-type: Simple
cabal-version: >=1.10
library
- ghc-options: -fpedantic-bottoms -fexpose-all-unfoldings -Wall -O2 -flate-dmd-anal
+ ghc-options: -fpedantic-bottoms -fexpose-all-unfoldings -ferror-spans -Wall -O2 -flate-dmd-anal
exposed-modules:
Yi.Rope
1
0
Hello community,
here is the log from the commit of package ghc-yi-mode-javascript for openSUSE:Factory checked in at 2017-08-31 21:02:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-yi-mode-javascript (Old)
and /work/SRC/openSUSE:Factory/.ghc-yi-mode-javascript.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-yi-mode-javascript"
Thu Aug 31 21:02:44 2017 rev:3 rq:513561 version:0.14.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-yi-mode-javascript/ghc-yi-mode-javascript.changes 2017-07-06 00:00:28.035084055 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-yi-mode-javascript.new/ghc-yi-mode-javascript.changes 2017-08-31 21:02:48.805885568 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:06:44 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.14.0.
+
+-------------------------------------------------------------------
Old:
----
yi-mode-javascript-0.13.7.tar.gz
New:
----
yi-mode-javascript-0.14.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-yi-mode-javascript.spec ++++++
--- /var/tmp/diff_new_pack.6vqihZ/_old 2017-08-31 21:02:50.173693388 +0200
+++ /var/tmp/diff_new_pack.6vqihZ/_new 2017-08-31 21:02:50.177692827 +0200
@@ -18,7 +18,7 @@
%global pkg_name yi-mode-javascript
Name: ghc-%{pkg_name}
-Version: 0.13.7
+Version: 0.14.0
Release: 0
Summary: Yi editor javascript mode
License: GPL-2.0+
++++++ yi-mode-javascript-0.13.7.tar.gz -> yi-mode-javascript-0.14.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yi-mode-javascript-0.13.7/src/Yi/Syntax/JavaScript.hs new/yi-mode-javascript-0.14.0/src/Yi/Syntax/JavaScript.hs
--- old/yi-mode-javascript-0.13.7/src/Yi/Syntax/JavaScript.hs 2017-06-14 18:26:30.000000000 +0200
+++ new/yi-mode-javascript-0.14.0/src/Yi/Syntax/JavaScript.hs 2017-06-19 21:00:18.000000000 +0200
@@ -18,6 +18,7 @@
module Yi.Syntax.JavaScript where
import Prelude hiding (elem,error,any,exp)
+import qualified Prelude
import Control.Applicative (Alternative ((<|>), many), optional)
import Data.Data (Data)
@@ -126,6 +127,8 @@
subtrees (Else _ x) = fromBlock x
subtrees (With _ _ x) = fromBlock x
subtrees _ = []
+ uniplate = Prelude.error "uniplate not implemented in IsTree (Yi.Syntax.JavaScript.Statement)"
+ emptyNode = Prelude.error "emptyNode not implemented in IsTree (Yi.Syntax.JavaScript.Statement)"
instance Failable ForContent where
stupid = ForErr
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yi-mode-javascript-0.13.7/yi-mode-javascript.cabal new/yi-mode-javascript-0.14.0/yi-mode-javascript.cabal
--- old/yi-mode-javascript-0.13.7/yi-mode-javascript.cabal 2017-06-17 19:57:23.000000000 +0200
+++ new/yi-mode-javascript-0.14.0/yi-mode-javascript.cabal 2017-06-19 21:18:28.000000000 +0200
@@ -3,7 +3,7 @@
-- see: https://github.com/sol/hpack
name: yi-mode-javascript
-version: 0.13.7
+version: 0.14.0
synopsis: Yi editor javascript mode
category: Yi
homepage: https://github.com/yi-editor/yi#readme
1
0