third_party/blink/tools/blinkpy/style/filter.py
def validate_filter_rules(filter_rules, all_categories):
    """Validate the given filter rules, and raise a ValueError if not valid.

    Args:
      filter_rules: A list of boolean filter rules, for example--
                    ["-whitespace", "+whitespace/braces"]
      all_categories: A list of all available category names, for example--
                      ["whitespace/tabs", "whitespace/braces"]

    Raises:
      ValueError: An error occurs if a filter rule does not begin
                  with "+" or "-" or if a filter rule does not match
                  the beginning of some category name in the list
                  of all available categories.
    """
    for rule in filter_rules:
        if not (rule.startswith('+') or rule.startswith('-')):
            raise ValueError('Invalid filter rule "%s": every rule '
                             'must start with + or -.' % rule)

        for category in all_categories:
            if category.startswith(rule[1:]):
                break
        else:
            raise ValueError('Suspected incorrect filter rule "%s": '
                             'the rule does not match the beginning '
                             'of any category name.' % rule)
Validate the given filter rules, and raise a ValueError if not valid.

    Args:
      filter_rules: A list of boolean filter rules, for example--
                    ["-whitespace", "+whitespace/braces"]
      all_categories: A list of all available category names, for example--
                      ["whitespace/tabs", "whitespace/braces"]

    Raises:
      ValueError: An error occurs if a filter rule does not begin
                  with "+" or "-" or if a filter rule does not match
                  the beginning of some category name in the list
                  of all available categories.
    
Validate the given filter rules, and raise a ValueError if not valid.
Validate the given filter rules and raise a ValueError if not valid .
def validate_filter_rules(filter_rules, all_categories):
    for rule in filter_rules:
        if not (rule.startswith('+') or rule.startswith('-')):
            raise ValueError('Invalid filter rule "%s": every rule '
                             'must start with + or -.' % rule)
        for category in all_categories:
            if category.startswith(rule[1:]):
                break
        else:
            raise ValueError('Suspected incorrect filter rule "%s": '
                             'the rule does not match the beginning '
                             'of any category name.' % rule)
def validate_filter_rules ( filter_rules , all_categories ) : for rule in filter_rules : if not ( rule . startswith ( '+' ) or rule . startswith ( '-' ) ) : raise ValueError ( 'Invalid filter rule "%s": every rule ' 'must start with + or -.' % rule ) for category in all_categories : if category . startswith ( rule [ 1 : ] ) : break else : raise ValueError ( 'Suspected incorrect filter rule "%s": ' 'the rule does not match the beginning ' 'of any category name.' % rule )
Validate the given filter rules, and raise a ValueError if not valid.
Validate the given filter rules and raise a ValueError if not valid .
"""Validate the given filter rules, and raise a ValueError if not valid.

    Args:
      filter_rules: A list of boolean filter rules, for example--
                    ["-whitespace", "+whitespace/braces"]
      all_categories: A list of all available category names, for example--
                      ["whitespace/tabs", "whitespace/braces"]

    Raises:
      ValueError: An error occurs if a filter rule does not begin
                  with "+" or "-" or if a filter rule does not match
                  the beginning of some category name in the list
                  of all available categories.
    """
An error occurs if a filter rule does not begin
with "+" or "-" or if a filter rule does not match
the beginning of some category name in the list
of all available categories.
An error occurs if a filter rule does not begin with " + " or " - " or if a filter rule does not match the beginning of some category name in the list of all available categories .
ValueError
filter_rules
A list of boolean filter rules, for example
["-whitespace", "+whitespace/braces"]
A list of boolean filter rules for example [ " - whitespace " " + whitespace / braces " ]
all_categories
A list of all available category names, for example
["whitespace/tabs", "whitespace/braces"]
A list of all available category names for example [ " whitespace / tabs " " whitespace / braces " ]