linter: regex validator does not require expression

This commit is contained in:
Matthias Bernt
2021-10-18 12:40:52 +02:00
parent ef6b0c3b66
commit ec60b94e92
-2
View File
@@ -163,8 +163,6 @@ def lint_inputs(tool_xml, lint_ctx):
lint_ctx.error(f"Parameter [{param_name}]: expression validator without content")
if vtype != "expression" and validator.text is not None:
lint_ctx.warn(f"Parameter [{param_name}]: '{vtype}' validators are not expected to contain text (found '{validator.text}')")
if vtype == "regex" and "expression" not in validator.attrib:
lint_ctx.error(f"Parameter [{param_name}]: '{vtype}' validators need to define an 'expression' attribute")
if vtype in ["in_range", "length", "dataset_metadata_in_range"] and ("min" not in validator.attrib or "max" not in validator.attrib):
lint_ctx.error(f"Parameter [{param_name}]: '{vtype}' validators need to define the 'min' or 'max' attribute(s)")
if vtype in ["metadata"] and ("check" not in validator.attrib or "skip" not in validator.attrib):