From a71e86b5a97e6e250f54853b04060c86b40aed9a Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 22 Dec 2023 15:57:05 -0500 Subject: [PATCH] fix: better error if requires is not a set Signed-off-by: Henry Schreiner --- src/repo_review/processor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/repo_review/processor.py b/src/repo_review/processor.py index 53ee3e2..b4918dc 100644 --- a/src/repo_review/processor.py +++ b/src/repo_review/processor.py @@ -199,6 +199,11 @@ def process( graph: dict[str, set[str]] = { n: getattr(t, "requires", set()) for n, t in tasks.items() } + for name, s in graph.items(): + if not isinstance(s, set): + msg = f"requires must be a set, got {s!r} for {name!r}" # type: ignore[unreachable] + raise TypeError(msg) + # Keep track of which checks have been completed completed: dict[str, str | None] = {}