diff options
Diffstat (limited to '')
-rw-r--r-- | lib/CheckMap.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/CheckMap.hs b/lib/CheckMap.hs index eaeac55..176e3d5 100644 --- a/lib/CheckMap.hs +++ b/lib/CheckMap.hs @@ -19,7 +19,7 @@ import GHC.Generics (Generic) import LintWriter (LintResult (..), LintWriter, askContext, filterLintLevel, lintToDep, resultToDeps, - resultToLints, runLintWriter) + resultToLints, resultToOffers, runLintWriter) import Properties (checkLayerProperty, checkMap) import Tiled2 (Layer (layerName, layerProperties), Tiledmap (tiledmapLayers), loadTiledmap) @@ -30,9 +30,10 @@ import Util (PrettyPrint (prettyprint), prettyprint) -- | What this linter produces: lints for a single map data MapResult = MapResult - { mapresultLayer :: Maybe (Map Text (LintResult Layer)) - , mapresultGeneral :: [Lint] - , mapresultDepends :: [Dep] + { mapresultLayer :: Maybe (Map Text (LintResult Layer)) + , mapresultGeneral :: [Lint] + , mapresultDepends :: [Dep] + , mapresultProvides :: [Text] } deriving (Generic, ToJSON) @@ -45,6 +46,7 @@ loadAndLintMap path depth = loadTiledmap path >>= pure . \case Left err -> MapResult { mapresultLayer = Nothing , mapresultDepends = [] + , mapresultProvides = [] , mapresultGeneral = [ hint Fatal . T.pack $ path <> ": Fatal: " <> err @@ -60,6 +62,7 @@ runLinter tiledmap depth = MapResult , mapresultGeneral = generalLints -- no general lints for now , mapresultDepends = concatMap (resultToDeps . snd) layer <> mapMaybe lintToDep generalLints + , mapresultProvides = concatMap (resultToOffers . snd) layer } where layerMap :: Map Text (LintResult Layer) |