예제 #1
0
def _validate_target_typewise(reporter, target_type):
    if target_type not in [
        TARGET_TYPE_NODE, TARGET_TYPE_ATTRIBUTE, TARGET_TYPE_REGEXP
    ]:
        reporter.add(reports.invalid_option_type(
            "target",
            ["node", "regular expression", "attribute_name=value"]
        ))
예제 #2
0
def _validate_target_typewise(reporter, target_type):
    if target_type not in [
            TARGET_TYPE_NODE, TARGET_TYPE_ATTRIBUTE, TARGET_TYPE_REGEXP
    ]:
        reporter.append(
            reports.invalid_option_type(
                "target",
                ["node", "regular expression", "attribute_name=value"]))
예제 #3
0
def _validate_target_typewise(target_type) -> ReportItemList:
    report_list: ReportItemList = []
    if target_type not in [
            TARGET_TYPE_NODE, TARGET_TYPE_ATTRIBUTE, TARGET_TYPE_REGEXP
    ]:
        report_list.append(
            reports.invalid_option_type(
                "target",
                ["node", "regular expression", "attribute_name=value"]))
    return report_list