def has_unordered_sections(yaml_file, product_yaml=None): rule = yaml.open_and_macro_expand(yaml_file, product_yaml) if 'references' in rule or 'identifiers' in rule: rule_lines = read_file_list(yaml_file) new_lines = ssg.rule_yaml.sort_section_keys(yaml_file, rule_lines, TO_SORT) # Compare string representations to avoid issues with references being # different. return "\n".join(rule_lines) != "\n".join(new_lines) return False
def has_duplicated_subkeys(yaml_file, product_yaml=None): rule_lines = read_file_list(yaml_file) return ssg.rule_yaml.has_duplicated_subkeys(yaml_file, rule_lines, TO_SORT)