aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Interface.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Haddock/Interface.hs')
-rw-r--r--src/Haddock/Interface.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Haddock/Interface.hs b/src/Haddock/Interface.hs
index 0c171cbc..81919aed 100644
--- a/src/Haddock/Interface.hs
+++ b/src/Haddock/Interface.hs
@@ -46,6 +46,7 @@ import qualified Data.Map as Map
import Distribution.Verbosity
import System.Directory
import System.FilePath
+import Text.Printf
import Digraph
import Exception
@@ -161,6 +162,13 @@ processModule verbosity modsum flags modMap instIfaceMap = do
out verbosity verbose "Creating interface..."
(interface, msg) <- runWriterGhc $ createInterface tm flags modMap instIfaceMap
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
interface' <- liftIO $ evaluate interface
return (Just interface')
else