From 5b8ed8ad906e92bce5b8576b29ae6f2cc46d8696 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 20 Sep 2021 01:56:15 +0200 Subject: lint map things that aren't custom properties --- lib/CheckMap.hs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'lib/CheckMap.hs') diff --git a/lib/CheckMap.hs b/lib/CheckMap.hs index 08932b4..ffd94ec 100644 --- a/lib/CheckMap.hs +++ b/lib/CheckMap.hs @@ -17,12 +17,10 @@ import qualified Data.Vector as V import GHC.Generics (Generic) import LintWriter (LintResult (..), LintWriter, - lintsToDeps, resultToLints, - runLintWriter) -import Properties (checkLayerProperty, - checkMapProperty) + lintsToDeps, runLintWriter) +import Properties (checkLayerProperty, checkMap) import Tiled2 (Layer (layerName, layerProperties), - Tiledmap (tiledmapLayers, tiledmapProperties), + Tiledmap (tiledmapLayers), loadTiledmap) import Types (Dep, Level (..), Lint (..), hint, lintLevel) @@ -57,7 +55,7 @@ loadAndLintMap path = loadTiledmap path >>= pure . \case runLinter :: Tiledmap -> MapResult () runLinter tiledmap = MapResult { mapresultLayer = Just layerMap - , mapresultGeneral = propertyLints -- no general lints for now + , mapresultGeneral = generalLints -- no general lints for now , mapresultDepends = concatMap (lintsToDeps . snd) layer } where @@ -67,8 +65,7 @@ runLinter tiledmap = MapResult where runCheck l = (layerName l, LintResult $ runWriterT (checkLayer l)) -- lints collected from properties - propertyLints = runLintWriter - $ mapM_ (checkMapProperty tiledmap) (tiledmapProperties tiledmap) + generalLints = runLintWriter (checkMap tiledmap) -- | collect lints on a single map layer -- cgit v1.2.3