Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit 8551fcd

Browse files
authored
Use floor over round to calculate the percentage (#1195)
If we compile documentation where only a small fraction is undocumented, it is misleading to see 100% coverage - 99% is more intuitive. Fixes #1194
1 parent 3c9e808 commit 8551fcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

haddock-api/src/Haddock/Interface.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ processModule verbosity modsum flags modMap instIfaceMap = do
182182
liftIO $ mapM_ putStrLn (nub msgs)
183183
dflags <- getDynFlags
184184
let (haddockable, haddocked) = ifaceHaddockCoverage interface
185-
percentage = round (fromIntegral haddocked * 100 / fromIntegral haddockable :: Double) :: Int
185+
percentage = floor (fromIntegral haddocked * 100 / fromIntegral haddockable :: Double) :: Int
186186
modString = moduleString (ifaceMod interface)
187187
coverageMsg = printf " %3d%% (%3d /%3d) in '%s'" percentage haddocked haddockable modString
188188
header = case ifaceDoc interface of

0 commit comments

Comments
 (0)