Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: better error if requires is not a set #173

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/repo_review/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,18 @@ def process(

# Collect our own config
config = pyproject(package).get("tool", {}).get("repo-review", {})
select_checks = select if select else set(config.get("select", ()))
skip_checks = ignore if ignore else set(config.get("ignore", ()))
select_checks = select if select else frozenset(config.get("select", ()))
skip_checks = ignore if ignore else frozenset(config.get("ignore", ()))

# Make a graph of the check's interdependencies
graph: dict[str, set[str]] = {
n: getattr(t, "requires", set()) for n, t in tasks.items()
graph: dict[str, Set[str]] = {
n: getattr(t, "requires", frozenset()) 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] = {}

Expand Down