Skip to content

Commit

Permalink
Don't lint modules if they won't be rebuilt, close #1328
Browse files Browse the repository at this point in the history
  • Loading branch information
paf31 committed Aug 9, 2015
1 parent 38e6b81 commit 0844089
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Language/PureScript/Make.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import Data.Function (on)
import Data.List (sortBy, groupBy)
import Data.Maybe (fromMaybe)
import Data.Time.Clock
import Data.Foldable (for_)
import Data.Traversable (traverse)
import Data.Version (showVersion)
import qualified Data.Map as M
Expand Down Expand Up @@ -140,7 +141,6 @@ make :: forall m. (Functor m, Applicative m, Monad m, MonadReader Options m, Mon
-> m Environment
make MakeActions{..} ms = do
(sorted, graph) <- sortModules $ map importPrim ms
mapM_ lint sorted
toRebuild <- foldM (\s (Module _ moduleName' _ _) -> do
inputTimestamp <- getInputTimestamp moduleName'
outputTimestamp <- getOutputTimestamp moduleName'
Expand All @@ -150,6 +150,7 @@ make MakeActions{..} ms = do
_ -> S.insert moduleName' s) S.empty sorted

marked <- rebuildIfNecessary (reverseDependencies graph) toRebuild sorted
for_ marked $ \(willRebuild, m) -> when willRebuild (lint m)
(desugared, nextVar) <- runSupplyT 0 $ zip (map fst marked) <$> desugar (map snd marked)
evalSupplyT nextVar $ go initEnvironment desugared
where
Expand Down

0 comments on commit 0844089

Please sign in to comment.