Skip to content

Commit

Permalink
chore: rename get_transitive_closure to get_reachable_nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
tromai committed Feb 21, 2024
1 parent cb847c0 commit 9347251
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/macaron/slsa_analyzer/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def get_children(self, check_id: str) -> set[str]:
return set(self._check_relationships_mapping.get(check_id, {}))

@staticmethod
def get_transitive_closure(
def get_reachable_nodes(
node: T,
get_successors: Callable[[T], Iterable[T]],
) -> Iterable[T]:
Expand Down Expand Up @@ -462,7 +462,7 @@ def get_final_checks(self, ex_pats: list[str], in_pats: list[str]) -> list[str]:

transitive_ex: set[str] = set()
for direct_ex in exclude:
transitive_children = self.get_transitive_closure(
transitive_children = self.get_reachable_nodes(
node=direct_ex,
get_successors=self.get_children,
)
Expand All @@ -475,7 +475,7 @@ def get_final_checks(self, ex_pats: list[str], in_pats: list[str]) -> list[str]:

transitive_in: set[str] = set()
for direct_in in include:
transitive_parents = self.get_transitive_closure(
transitive_parents = self.get_reachable_nodes(
node=direct_in,
get_successors=self.get_parents,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/slsa_analyzer/checks/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def get_successors(start: str) -> set[str]:
return set()

assert sorted(
Registry.get_transitive_closure(
Registry.get_reachable_nodes(
node=start_node,
get_successors=get_successors,
)
Expand Down

0 comments on commit 9347251

Please sign in to comment.