def load_rules_from_paths()

in cortado/rules.py [0:0]


def load_rules_from_paths(paths: list[str], skip_on_error: bool = True) -> list[Rule]:
    rules: list[Rule] = []
    for path in paths:
        p = Path(path)
        if not p.exists():
            log.error("Provided rule path does not exist", path=str(p))
            raise ValueError(f"Can't read provided path: {p}")

        try:
            rule = load_rule(p)
        except ValueError as e:
            if skip_on_error:
                log.warning("Error while reading a rule, skipping", rule=path, error=e)
                continue
            raise
        rules.append(rule)
    return rules