From dbf2253dc4256809b255767cbf4ae9c236f18542 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sat, 19 Mar 2022 19:12:04 +0100 Subject: remove leftover rc3 things & some new stuff this removes: - the bbb properties - all explicit mentions of rc3 - the weird script domain hacks (done via a substitution now) - some (few) of the weirder code choices it also adds some more type level witchery to deal with configs, which for some reason seems to be the hardest problem of this entire program … also the server now does inter-assembly dependency checking! --- lib/CheckMap.hs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/CheckMap.hs') diff --git a/lib/CheckMap.hs b/lib/CheckMap.hs index 9e3027c..8611f03 100644 --- a/lib/CheckMap.hs +++ b/lib/CheckMap.hs @@ -10,6 +10,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE RecordWildCards #-} -- | Module that contains the high-level checking functions module CheckMap (loadAndLintMap, MapResult(..), ResultKind(..), Optional,shrinkMapResult) where @@ -28,7 +29,7 @@ import Badges (Badge) import Data.Tiled (Layer (layerLayers, layerName), Tiledmap (tiledmapLayers, tiledmapTilesets), loadTiledmap) -import LintConfig (LintConfig (configAssemblyTag), LintConfig') +import LintConfig (LintConfig', LintConfig (..)) import LintWriter (LintResult, invertLintResult, resultToAdjusted, resultToBadges, resultToDeps, resultToLints, resultToOffers, @@ -111,11 +112,12 @@ loadAndLintMap config path depth = loadTiledmap path <&> \case -- | lint a loaded map runLinter :: Bool -> LintConfig' -> Tiledmap -> Int -> MapResult Full -runLinter isMain config tiledmap depth = MapResult +runLinter isMain config@LintConfig{..} tiledmap depth = MapResult { mapresultLayer = invertThing layer , mapresultTileset = invertThing tileset , mapresultGeneral = - ([Hint Error "main.json should link back to the lobby" | isMain && not (any linksLobby layerDeps)]) + [Hint Warning "main.json should link back to the lobby" + | isMain && not (any linksLobby layerDeps)] <> lintsToHints (resultToLints generalResult) , mapresultDepends = resultToDeps generalResult <> layerDeps @@ -127,9 +129,10 @@ runLinter isMain config tiledmap depth = MapResult } where linksLobby = \case - MapLink link -> "/@/rc3_21/lobby" `T.isPrefixOf` link + MapLink link -> + ("/@/"<>configEventSlug<>"/lobby") `T.isPrefixOf` link || configAssemblyTag config == "lobby" - _ -> False + _ -> False layerDeps = concatMap resultToDeps layer layer = checkLayerRec config depth (V.toList $ tiledmapLayers tiledmap) tileset = checkThing tiledmapTilesets checkTileset -- cgit v1.2.3