Skip to content
Snippets Groups Projects
Unverified Commit 9e3e10ae authored by stuebinm's avatar stuebinm
Browse files

more sensible msg for "property required by"-lints

the previous state appears to have been an oversight and made no sense
at all.
parent a74cc87b
Branches
No related tags found
No related merge requests found
...@@ -163,6 +163,7 @@ checkLayerProperty p@(Property name _value) = case name of ...@@ -163,6 +163,7 @@ checkLayerProperty p@(Property name _value) = case name of
complain $ "unknown property type " <> prettyprint name complain $ "unknown property type " <> prettyprint name
where where
isForbidden = forbidProperty name isForbidden = forbidProperty name
requireProperty req = propertyRequiredBy req name
-- | this property can only be used on a layer that contains at least one tiles -- | this property can only be used on a layer that contains at least one tiles
forbidEmptyLayer = do forbidEmptyLayer = do
...@@ -208,7 +209,13 @@ forbidProperty name = do ...@@ -208,7 +209,13 @@ forbidProperty name = do
requireProperty :: HasProperties a => Text -> LintWriter a requireProperty :: HasProperties a => Text -> LintWriter a
requireProperty name = requireProperty name =
unlessHasProperty 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 -- | suggest some value for another property if that property does not
-- also already exist -- also already exist
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment