implement env manager #6

Merged
dan merged 28 commits from dependency-improvement into dev 2023-12-04 17:09:03 +01:00
Showing only changes of commit dc50a9d6f7 - Show all commits

View file

@ -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]: