summaryrefslogtreecommitdiff
path: root/lib/CheckMap.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CheckMap.hs')
-rw-r--r--lib/CheckMap.hs12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/CheckMap.hs b/lib/CheckMap.hs
index 73909b9..35c00a1 100644
--- a/lib/CheckMap.hs
+++ b/lib/CheckMap.hs
@@ -89,7 +89,7 @@ runLinter :: Tiledmap -> Int -> MapResult
runLinter tiledmap depth = MapResult
{ mapresultLayer = invertThing layer
, mapresultTileset = invertThing tileset
- , mapresultGeneral = generalLints
+ , mapresultGeneral = resultToLints generalResult
, mapresultDepends = mapMaybe lintToDep generalLints
<> concatMap resultToDeps layer
<> concatMap resultToDeps tileset
@@ -99,6 +99,7 @@ runLinter tiledmap depth = MapResult
where
layer = checkThing tiledmapLayers checkLayer
tileset = checkThing tiledmapTilesets checkTileset
+ generalResult = runLintWriter tiledmap depth checkMap
checkThing getter checker = V.toList . V.map runCheck $ getter tiledmap
where runCheck thing = runLintWriter thing depth checker
@@ -106,15 +107,12 @@ runLinter tiledmap depth = MapResult
-- | "inverts" a LintResult, i.e. groups it by lints instead of
-- layers / maps
invertThing thing = M.unionsWith (<>) $ fmap invertLintResult thing
- -- lints collected from properties
- generalLints =
- resultToLints generalResult
- generalResult = runLintWriter tiledmap depth checkMap
adjustedMap = (resultToAdjusted generalResult)
- { tiledmapLayers = V.fromList . fmap resultToAdjusted $ layer }
- -- TODO: this appears to have reordered map layers???
+ { tiledmapLayers = V.fromList . fmap resultToAdjusted $ layer
+ , tiledmapTilesets = V.fromList . fmap resultToAdjusted $ tileset
+ }
-- human-readable lint output, e.g. for consoles
instance PrettyPrint (Level, MapResult) where