summaryrefslogtreecommitdiff
path: root/lib/CheckMap.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CheckMap.hs')
-rw-r--r--lib/CheckMap.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/CheckMap.hs b/lib/CheckMap.hs
index 5d50f3f..8a2ad7e 100644
--- a/lib/CheckMap.hs
+++ b/lib/CheckMap.hs
@@ -32,8 +32,8 @@ import Tiled2 (HasName (getName),
LoadResult (..),
Tiledmap (tiledmapLayers, tiledmapTilesets),
Tileset, loadTiledmap)
-import Types (Dep, Hint (hintLevel, hintMsg), Level (..),
- Lint (..), hint)
+import Types (Dep, Hint (Hint, hintLevel, hintMsg),
+ Level (..), Lint (..), hint, lintsToHints)
import Util (PrettyPrint (prettyprint), prettyprint)
@@ -50,7 +50,7 @@ data MapResult = MapResult
-- ^ entrypoints provided by this map (needed for dependency checking)
, mapresultAdjusted :: Maybe Tiledmap
-- ^ the loaded map, with adjustments by the linter
- , mapresultGeneral :: [Lint]
+ , mapresultGeneral :: [Hint]
-- ^ general-purpose lints that didn't fit anywhere else
} deriving (Generic)
@@ -78,7 +78,7 @@ instance ToJSON CollectedLints where
loadAndLintMap :: LintConfig' -> FilePath -> Int -> IO (Maybe MapResult)
loadAndLintMap config path depth = loadTiledmap path <&> (\case
DecodeErr err -> Just (MapResult mempty mempty mempty mempty Nothing
- [ hint Fatal . T.pack $
+ [ Hint Fatal . T.pack $
path <> ": Fatal: " <> err
])
IOErr _ -> Nothing
@@ -90,7 +90,7 @@ runLinter :: LintConfig' -> Tiledmap -> Int -> MapResult
runLinter config tiledmap depth = MapResult
{ mapresultLayer = invertThing layer
, mapresultTileset = invertThing tileset
- , mapresultGeneral = resultToLints generalResult
+ , mapresultGeneral = lintsToHints $ resultToLints generalResult
, mapresultDepends = mapMaybe lintToDep (resultToLints generalResult)
<> concatMap resultToDeps layer
<> concatMap resultToDeps tileset
@@ -187,5 +187,4 @@ instance PrettyPrint (Level, MapResult) where
prettyGeneral :: [Text]
prettyGeneral = map
((<> "\n") . prettyprint)
- . filterLintLevel level
$ mapresultGeneral mapResult