Commit a1da3d78 authored by Duncan Coutts's avatar Duncan Coutts

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.
parent dc186a88
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment