summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/Properties.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Properties.hs b/lib/Properties.hs
index ee774c8..ed97355 100644
--- a/lib/Properties.hs
+++ b/lib/Properties.hs
@@ -163,6 +163,7 @@ checkLayerProperty p@(Property name _value) = case name of
complain $ "unknown property type " <> prettyprint name
where
isForbidden = forbidProperty name
+ requireProperty req = propertyRequiredBy req name
-- | this property can only be used on a layer that contains at least one tiles
forbidEmptyLayer = do
@@ -208,7 +209,13 @@ forbidProperty name = do
requireProperty :: HasProperties a => Text -> LintWriter a
requireProperty name =
unlessHasProperty name
- $ complain $ "property "<>prettyprint name<>" requires property "<>prettyprint name
+ $ complain $ "property "<>prettyprint name<>" is required"
+
+propertyRequiredBy :: HasProperties a => Text -> Text -> LintWriter a
+propertyRequiredBy req by =
+ unlessHasProperty req
+ $ complain $ "property "<>prettyprint req<>" is required by property "<> prettyprint by
+
-- | suggest some value for another property if that property does not
-- also already exist