summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CheckDir.hs15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/CheckDir.hs b/lib/CheckDir.hs
index 680039c..b1b5830 100644
--- a/lib/CheckDir.hs
+++ b/lib/CheckDir.hs
@@ -62,12 +62,11 @@ newtype MissingAsset = MissingAsset MissingDep
resultIsFatal :: LintConfig' -> DirResult -> Bool
resultIsFatal config res =
- (not (null (dirresultMissingAssets res)))
- && (configMaxLintLevel config) <= maxObservedLevel
+ not (null (dirresultMissingAssets res))
+ && configMaxLintLevel config <= maxObservedLevel
where maxObservedLevel = maximum
. map hintLevel
- . concatMap keys
- . map mapresultLayer
+ . concatMap (keys . mapresultLayer)
. elems
. dirresultMaps
$ res
@@ -134,16 +133,16 @@ recursiveCheckDir :: LintConfig' -> FilePath -> FilePath -> IO DirResult
recursiveCheckDir config prefix root = do
linted <- recursiveCheckDir' config prefix [root] mempty mempty
mAssets <- missingAssets prefix linted
- pure $ linted <> mempty { dirresultDeps = missingDeps linted
+ pure $ linted <> mempty { dirresultDeps = missingDeps root linted
, dirresultMissingAssets = mAssets
}
-- | Given a (partially) completed DirResult, check which local
-- maps are referenced but do not actually exist.
-missingDeps :: DirResult -> [MissingDep]
-missingDeps res =
- let simple = M.insert "main.json" [] used \\ M.union defined trivial
+missingDeps :: FilePath -> DirResult -> [MissingDep]
+missingDeps entrypoint res =
+ let simple = M.insert (T.pack entrypoint) [] used \\ M.union defined trivial
in M.foldMapWithKey (\f n -> [MissingDep f n]) simple
where
-- which maps are linked somewhere?