summaryrefslogtreecommitdiff
path: root/lib/CheckMap.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CheckMap.hs')
-rw-r--r--lib/CheckMap.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CheckMap.hs b/lib/CheckMap.hs
index 1d4c404..aa4616a 100644
--- a/lib/CheckMap.hs
+++ b/lib/CheckMap.hs
@@ -33,7 +33,7 @@ import LintConfig (LintConfig (..), LintConfig')
import LintWriter (LintResult, invertLintResult,
resultToAdjusted, resultToBadges,
resultToDeps, resultToLints, resultToOffers,
- runLintWriter)
+ runLintWriter, resultToCWs)
import Properties (checkLayer, checkMap, checkTileset)
import System.FilePath (takeFileName)
import Types (Dep (MapLink),
@@ -62,6 +62,8 @@ data MapResult (kind :: ResultKind) = MapResult
-- ^ the loaded map, with adjustments by the linter
, mapresultBadges :: [Badge]
-- ^ badges that can be found on this map
+ , mapresultCWs :: [Text]
+ -- ^ collected CWs that apply to this map
, mapresultGeneral :: [Hint]
-- ^ general-purpose lints that didn't fit anywhere else
} deriving (Generic)
@@ -103,7 +105,7 @@ shrinkMapResult !res = res { mapresultAdjusted = () }
-- layers upwards in the file hierarchy
loadAndLintMap :: LintConfig' -> FilePath -> Int -> IO (Maybe (MapResult Full))
loadAndLintMap config path depth = loadTiledmap path <&> \case
- Left err -> Just (MapResult mempty mempty mempty mempty Nothing mempty
+ Left err -> Just (MapResult mempty mempty mempty mempty Nothing mempty mempty
[ Hint Fatal . toText $
path <> ": Fatal: " <> err
])
@@ -124,6 +126,7 @@ runLinter isMain config@LintConfig{..} tiledmap depth = MapResult
<> concatMap resultToDeps tileset
, mapresultProvides = concatMap resultToOffers layer
, mapresultAdjusted = Just adjustedMap
+ , mapresultCWs = resultToCWs generalResult
, mapresultBadges = concatMap resultToBadges layer
<> resultToBadges generalResult
}