summaryrefslogtreecommitdiff
path: root/lib/CheckDir.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CheckDir.hs')
-rw-r--r--lib/CheckDir.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/CheckDir.hs b/lib/CheckDir.hs
index 68bcefe..5540aae 100644
--- a/lib/CheckDir.hs
+++ b/lib/CheckDir.hs
@@ -6,7 +6,7 @@
{-# LANGUAGE TupleSections #-}
-- | Module that contains high-level checking for an entire directory
-module CheckDir (recursiveCheckDir, DirResult(..)) where
+module CheckDir (recursiveCheckDir, DirResult(..), resultIsFatal) where
import CheckMap (MapResult (mapresultProvides),
loadAndLintMap, mapresultDepends)
@@ -47,7 +47,7 @@ data DirResult = DirResult
, dirresultDeps :: [MissingDep]
-- ^ all dependencies to things outside this repository
, dirresultMissingAssets :: [MissingAsset]
- -- ^ local things that are referred to but missing
+ -- ^ entrypoints of maps which are referred to but missing
} deriving (Generic)
data MissingDep = MissingDep
@@ -57,6 +57,13 @@ data MissingDep = MissingDep
newtype MissingAsset = MissingAsset MissingDep
+
+resultIsFatal :: DirResult -> Bool
+resultIsFatal res =
+ not $ null (dirresultMissingAssets res)
+
+
+
instance ToJSON DirResult where
toJSON res = A.object
[ "missingDeps" .= dirresultDeps res