Commit 4bfbe2db authored by Eric Kow's avatar Eric Kow
Browse files

Suppress missing haddock warning for some packages.

Allow a hardcoded whitelist of packages (currently 'rts') to not have
haddocks. When building several packages together, the accumulation of
these spurious warnings can make it a bit harder to notice legitimate
errors.
parent ecea1d5d
......@@ -52,7 +52,9 @@ module Distribution.Simple.Haddock (
-- local
import Distribution.Package
( PackageIdentifier, Package(..), packageName )
( PackageIdentifier(..)
, Package(..)
, PackageName(..), packageName )
import qualified Distribution.ModuleName as ModuleName
import Distribution.PackageDescription as PD
( PackageDescription(..), BuildInfo(..), allExtensions
......@@ -503,7 +505,9 @@ haddockPackageFlags lbi clbi htmlTemplate = do
if exists
then return (Right (interface, html))
else return (Left (packageId ipkg))
| ipkg <- PackageIndex.allPackages transitiveDeps ]
| ipkg <- PackageIndex.allPackages transitiveDeps
, pkgName (packageId ipkg) `notElem` noHaddockWhitelist
]
let missing = [ pkgid | Left pkgid <- interfaces ]
warning = "The documentation for the following packages are not "
......@@ -515,6 +519,7 @@ haddockPackageFlags lbi clbi htmlTemplate = do
return (flags, if null missing then Nothing else Just warning)
where
noHaddockWhitelist = map PackageName [ "rts" ]
interfaceAndHtmlPath :: InstalledPackageInfo -> Maybe (FilePath, FilePath)
interfaceAndHtmlPath pkg = do
interface <- listToMaybe (InstalledPackageInfo.haddockInterfaces pkg)
......
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