Example #1
0
def test_improper_configs_are_rejected(rule_config_dict):
    """Ensure that unsupported configs raise a ValueError."""
    config = FluffConfig(configs={"rules": rule_config_dict})
    with pytest.raises(ValueError):
        std_rule_set.get_rulelist(config)
Example #2
0
def get_rule_from_set(code, config):
    """Fetch a rule from the rule set."""
    for r in std_rule_set.get_rulelist(config=config):
        if r.code == code:
            return r
    raise ValueError("{0!r} not in {1!r}".format(code, std_rule_set))