From 1734d1bd825023bc784862a13efbf3cee530c3cc Mon Sep 17 00:00:00 2001 From: stuebinm Date: Fri, 19 Nov 2021 00:26:24 +0100 Subject: add lint for empty group layers --- lib/Properties.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Properties.hs b/lib/Properties.hs index 9f995b0..74fd72a 100644 --- a/lib/Properties.hs +++ b/lib/Properties.hs @@ -118,9 +118,16 @@ checkLayer = do case layerType layer of "tilelayer" -> mapM_ checkLayerProperty (getProperties layer) + "group" -> pure () ty -> unless (layerName layer == "floorLayer" && ty == "objectgroup") $ complain "only tilelayer are supported." + if layerType layer == "group" + then when (null (layerLayers layer)) + $ warn "Empty group layers are pointless." + else when (isJust (layerLayers layer)) + $ complain "Layer is not of type \"group\", but has sublayers." + -- | Checks a single (custom) property of a layer -- -- cgit v1.2.3