Repository : ssh://darcs.haskell.org//srv/darcs/haddock

On branches: development,master

http://hackage.haskell.org/trac/ghc/changeset/4d6b343127aa3d545473fe9e80821b8d4587f6a1

>---------------------------------------------------------------

commit 4d6b343127aa3d545473fe9e80821b8d4587f6a1
Author: David Waern <[email protected]>
Date:   Sat Oct 1 01:25:39 2011 +0200

    Merge in darcs patch from Simon Meier:
    
      Wed Jun  1 19:41:16 CEST 2011  [email protected]
        * prettier haddock coverage info
        The new coverage info rendering uses less horizontal space. This 
reduces the
        number of unnecessary line-wrappings. Moreover, the most important 
information,
        how much has been documented already, is now put up front. Hopefully, 
this
        makes it more likely that a library author is bothered by the low 
coverage of
        his modules and fixes that issue ;-)

>---------------------------------------------------------------

 src/Haddock/Interface.hs |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/Haddock/Interface.hs b/src/Haddock/Interface.hs
index 276621d..09f0188 100644
--- a/src/Haddock/Interface.hs
+++ b/src/Haddock/Interface.hs
@@ -142,6 +142,7 @@ createIfaces0 verbosity modules flags instIfaceMap =
 createIfaces :: Verbosity -> [Flag] -> InstIfaceMap -> ModuleGraph -> Ghc 
[Interface]
 createIfaces verbosity flags instIfaceMap mods = do
   let sortedMods = flattenSCCs $ topSortModuleGraph False mods Nothing
+  out verbosity normal "Haddock coverage:"
   (ifaces, _) <- foldM f ([], Map.empty) sortedMods
   return (reverse ifaces)
   where
@@ -162,11 +163,9 @@ processModule verbosity modsum flags modMap instIfaceMap = 
do
     liftIO $ mapM_ putStrLn msg
     let (haddockable, haddocked) = ifaceHaddockCoverage interface
         percentage = round (fromIntegral haddocked * 100 / fromIntegral 
haddockable :: Double) :: Int
-        coveragemsg = printf "haddock coverage for %s: %7s %3d%%"
-                        (ifaceOrigFilename interface)
-                        (printf "%d/%d" haddocked haddockable ::  String)
-                        percentage
-    out verbosity normal coveragemsg
+        modString = moduleString (ifaceMod interface)
+        coverageMsg = printf " %3d%% (%3d /%3d) in '%s'" percentage haddocked 
haddockable modString
+    out verbosity normal coverageMsg
     interface' <- liftIO $ evaluate interface
     return (Just interface')
   else



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to