Skip to content
Snippets Groups Projects
Unverified Commit e90e7981 authored by alexbiehl-gc's avatar alexbiehl-gc Committed by GitHub
Browse files

Merge pull request #1322 from haskell/alex/forward-port

simplify calculating percentages fixing #1194 (#1236)
parents d20dcc3a 04da9893
No related branches found
No related tags found
5 merge requests!38Make --no-tmp-comp-dir the default,!37Adapt to latest xhtml version, various optimizations,!31Support HsToken in DataDecl and ClassDecl,!12Drop orphan instance when defined upstream.,!10Haddock interfaces produced from `.hi` files
...@@ -186,7 +186,7 @@ processModule verbosity modsum flags modMap instIfaceMap = do ...@@ -186,7 +186,7 @@ processModule verbosity modsum flags modMap instIfaceMap = do
liftIO $ mapM_ putStrLn (nub msgs) liftIO $ mapM_ putStrLn (nub msgs)
dflags <- getDynFlags dflags <- getDynFlags
let (haddockable, haddocked) = ifaceHaddockCoverage interface let (haddockable, haddocked) = ifaceHaddockCoverage interface
percentage = round (fromIntegral haddocked * 100 / fromIntegral haddockable :: Double) :: Int percentage = div (haddocked * 100) haddockable
modString = moduleString (ifaceMod interface) modString = moduleString (ifaceMod interface)
coverageMsg = printf " %3d%% (%3d /%3d) in '%s'" percentage haddocked haddockable modString coverageMsg = printf " %3d%% (%3d /%3d) in '%s'" percentage haddocked haddockable modString
header = case ifaceDoc interface of header = case ifaceDoc interface of
...@@ -245,4 +245,3 @@ buildHomeLinks ifaces = foldl upd Map.empty (reverse ifaces) ...@@ -245,4 +245,3 @@ buildHomeLinks ifaces = foldl upd Map.empty (reverse ifaces)
mdl = ifaceMod iface mdl = ifaceMod iface
keep_old env n = Map.insertWith (\_ old -> old) n mdl env keep_old env n = Map.insertWith (\_ old -> old) n mdl env
keep_new env n = Map.insert n mdl env keep_new env n = Map.insert n mdl env
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment