audit-labs/audit-tools
A collection of scripts, queries, and other goodies you can use in an audit.
clone: git clone https://gitbay.org/audit-labs/audit-tools.git
1"""Shared types used by the platform runners and the TUI."""
2
3from collections.abc import Callable
4from dataclasses import dataclass
5
6
7# ``arg`` describes how a collector is called:
8# "base" -> fn(target, cfg)
9# "collabs" -> fn(target, cfg, repo_collabs) (GitHub collaborator cache)
10# "projects" -> fn(target, cfg, projects) (GitLab project cache)
11@dataclass(frozen=True)
12class Check:
13 key: str
14 label: str
15 fn: Callable
16 filename: str
17 arg: str = "base"
18 note: str = ""
19
20
21# kind is one of: "fetch", "start", "done", "error", "summary".
22@dataclass(frozen=True)
23class ProgressEvent:
24 kind: str
25 label: str
26 count: int | None = None
27 message: str = ""
28
29
30ProgressCallback = Callable[[ProgressEvent], None]