From e3055871434ad231b5f58c128875337a2d414447 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 25 May 2014 08:24:48 +0300 Subject: [PATCH] Don't warn about unlisted Setup module --- yesod-bin/Devel.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/yesod-bin/Devel.hs b/yesod-bin/Devel.hs index d10e3cf4..8a2d0760 100644 --- a/yesod-bin/Devel.hs +++ b/yesod-bin/Devel.hs @@ -422,7 +422,7 @@ failWith msg = do exitFailure checkFileList :: FileList -> D.Library -> [FilePath] -checkFileList fl lib = filter isUnlisted . filter isSrcFile $ sourceFiles +checkFileList fl lib = filter (not . isSetup) . filter isUnlisted . filter isSrcFile $ sourceFiles where al = allModules lib -- a file is only a possible 'module file' if all path pieces start with a capital letter @@ -432,6 +432,12 @@ checkFileList fl lib = filter isUnlisted . filter isSrcFile $ sourceFiles isUnlisted file = not (toModuleName file `Set.member` al) toModuleName = L.intercalate "." . filter (/=".") . splitDirectories . dropExtension + isSetup "Setup.hs" = True + isSetup "./Setup.hs" = True + isSetup "Setup.lhs" = True + isSetup "./Setup.lhs" = True + isSetup _ = False + allModules :: D.Library -> Set.Set String allModules lib = Set.fromList $ map toString $ D.exposedModules lib ++ (D.otherModules . D.libBuildInfo) lib where