Skip to content

Commit

Permalink
Filter out Build_doctests (can't have doctests)
Browse files Browse the repository at this point in the history
We used to only get module sources from library and executable components.  So
the `Build_doctests` module wouldn't show up.  But for issue ulidtko#57 we're now
getting module sources for the test suites as well, and Cabal nags us with the
warning:

    <no location info>: warning: [-Wmissing-home-modules]
	These modules are needed for compilation but not listed in your .cabal
        file's other-modules:
            Build_doctests

So people are likely to follow the warning and put in Build_doctests into their
Cabal file, and then be annoyed that it breaks their tests.

Because `Build_doctests` is autogenerated by Cabal-doctests, we know it will
never have doctests itself, so it can be safely filtered out.
  • Loading branch information
shajra committed Dec 30, 2019
1 parent 073a571 commit 4e3c021
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Distribution/Extra/Doctest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ generateBuildModule testSuiteName flags pkg lbi = do
-- pass the full path to the main-is module instead.
mainIsPath <- T.traverse (findFileEx verbosity iArgsNoPrefix) (compMainIs comp)

let all_sources = map display module_sources
let all_sources = filter (/= "Build_doctests")
$ map display module_sources
++ additionalModules
++ maybeToList mainIsPath

Expand Down

0 comments on commit 4e3c021

Please sign in to comment.