def check_rule_name_ending(rule_name, starlark_rule_types=('binary', 'library')):
    """
    Return True if `rule_name` ends with a rule type from `starlark_rule_types`
    Return False otherwise
    """
    for rule_type in starlark_rule_types:
        if rule_name.endswith(rule_type):
            return True
    return False