[commit: Cabal] master: Adjust the initial comment in cabal files generated by cabal init (ab788ca)
Ian Lynagh
igloo at earth.li
Fri Jun 24 02:09:21 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/ab788cadda6443c40b53e0d5b96aba777d0b80b1
>---------------------------------------------------------------
commit ab788cadda6443c40b53e0d5b96aba777d0b80b1
Author: Duncan Coutts <duncan at community.haskell.org>
Date: Tue May 17 00:31:27 2011 +0000
Adjust the initial comment in cabal files generated by cabal init
Use slightly longer lines and a somewhat more terse comment.
Also use a new shorter and hopefully stable URL for the user guide.
>---------------------------------------------------------------
cabal-install/Distribution/Client/Init.hs | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/cabal-install/Distribution/Client/Init.hs b/cabal-install/Distribution/Client/Init.hs
index b6545a5..be79adf 100644
--- a/cabal-install/Distribution/Client/Init.hs
+++ b/cabal-install/Distribution/Client/Init.hs
@@ -419,9 +419,13 @@ writeCabalFile flags@(InitFlags{packageName = Flag p}) = do
-- structure onto a low-level AST structure and use the existing
-- pretty-printing code to generate the file.
generateCabalFile :: String -> InitFlags -> String
-generateCabalFile fileName c = render $
+generateCabalFile fileName c =
+ renderStyle style { lineLength = 79, ribbonsPerLine = 1.1 } $
(if (minimal c /= Flag True)
- then showComment (Just $ fileName ++ " auto-generated by cabal init. For additional options, see http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html#pkg-descr.")
+ then showComment (Just $ "Initial " ++ fileName ++ " generated by cabal "
+ ++ "init. For further documentation, see "
+ ++ "http://haskell.org/cabal/users-guide/")
+ $$ text ""
else empty)
$$
vcat [ fieldS "name" (packageName c)
@@ -552,7 +556,11 @@ generateCabalFile fileName c = render $
showComment :: Maybe String -> Doc
showComment (Just t) = vcat . map text
. map ("-- "++) . lines
- . render . fsep . map text . words $ t
+ . renderStyle style {
+ lineLength = 76,
+ ribbonsPerLine = 1.05
+ }
+ . fsep . map text . words $ t
showComment Nothing = text ""
-- | Generate warnings for missing fields etc.
More information about the Cvs-libraries
mailing list