diff --git a/src/env_file_helper.py b/src/env_file_helper.py index 8e88ad7..4a7d3eb 100644 --- a/src/env_file_helper.py +++ b/src/env_file_helper.py @@ -36,17 +36,13 @@ def is_rule_satisfied(in_list: list[EnvFile], rule: DependencyRule, swap=False) child_indices = _get_indices_with_string(in_list, rule.child) parent_indices = _get_indices_with_string(in_list, rule.dependency) - child_index = min(child_indices) - results: list[bool] = [] for child_index in child_indices: for parent_index in parent_indices: - if parent_index < child_index: - results.append(True) - else: + if not parent_index < child_index: if swap: _swap_item_with_previous(in_list, parent_index) - results.append(False) - return all(results) + return False + return True def sort_env_files_by_rule(env_list: list[EnvFile], rules: list[DependencyRule]) -> list[EnvFile]: