Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

suppress annoying missing haddock warning for whitelist (rts) #1231

Merged
merged 2 commits into from

3 participants

@kowey

See https://plus.google.com/114991347543804898741/posts/9FbAWEuTFXN

Note: there seems to be a very similar chunk of code in cabal-install Distribution.Client.Haddock. Sounds like there's a refactor wanting to happen there? Not sure what the background is though.

kowey added some commits
@kowey kowey 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.
4bfbe2d
@kowey kowey Rename a lamda var to avoid shadow warning. 0e18fcf
@23Skidoo
Collaborator

@dcoutts, what do you think?

@dcoutts
Collaborator

Looks fine to me.

The thing in cabal-install is about generating an index of all the packages you have installed. Yes, I guess there's some opportunity for sharing there. If anyone wants to do that, then follow the model we have for D.S.Program.*, e.g. the HcPkg and GHC modules there. They define program invocations and some handy utilities for calling the programs in various ways.

@23Skidoo
Collaborator

@dcoutts

Looks fine to me.

I'm merging this in then. Opened ticket #1233 to remind us about the code duplication issue.

@23Skidoo 23Skidoo merged commit 4609f95 into haskell:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 5, 2013
  1. @kowey

    Suppress missing haddock warning for some packages.

    kowey authored
    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.
  2. @kowey
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 5 deletions.
  1. +10 −5 Cabal/Distribution/Simple/Haddock.hs
View
15 Cabal/Distribution/Simple/Haddock.hs
@@ -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
@@ -452,9 +454,9 @@ renderPureArgs version args = concat
[
(:[]) . (\f -> "--dump-interface="++ unDir (argOutputDir args) </> f)
. fromFlag . argInterfaceFile $ args,
- (\pkgName -> if isVersion2
- then ["--optghc=-package-name", "--optghc=" ++ pkgName]
- else ["--package=" ++ pkgName]) . display . fromFlag . argPackageName $ args,
+ (\pname -> if isVersion2
+ then ["--optghc=-package-name", "--optghc=" ++ pname]
+ else ["--package=" ++ pname]) . display . fromFlag . argPackageName $ args,
(\(All b,xs) -> bool (map (("--hide=" ++). display) xs) [] b) . argHideModules $ args,
bool ["--ignore-all-exports"] [] . getAny . argIgnoreExports $ args,
maybe [] (\(m,e) -> ["--source-module=" ++ m
@@ -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)
Something went wrong with that request. Please try again.