summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorstuebinm2021-11-19 00:26:24 +0100
committerstuebinm2021-11-19 00:26:24 +0100
commit1734d1bd825023bc784862a13efbf3cee530c3cc (patch)
treee7d32f59caa7340071af84d7d310f783dac0c514 /lib
parent858cdc8e4b8cfae8a4df88de63a02641a227cc70 (diff)
add lint for empty group layers
Diffstat (limited to 'lib')
-rw-r--r--lib/Properties.hs7
1 files changed, 7 insertions, 0 deletions
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
--