Skip to content

Commit 0fe2071

Browse files
committed
fix(examples): add typed signatures to finding helpers
1 parent c88112a commit 0fe2071

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

examples/skills_code_review_agent/review/findings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def _merge(winner: Finding, loser: Finding) -> Finding:
3939
return winner.model_copy(update=update) if update else winner
4040

4141

42-
def dedupe(findings):
42+
def dedupe(findings: list[Finding]) -> tuple[list[Finding], list[Finding]]:
4343
"""Collapse findings sharing (file, line, category). Returns (kept, dropped)."""
4444
kept: dict[str, Finding] = {}
4545
dropped = []
@@ -53,14 +53,14 @@ def dedupe(findings):
5353
return list(kept.values()), dropped
5454

5555

56-
def gate(findings, threshold: float = CONFIDENCE_THRESHOLD):
56+
def gate(findings: list[Finding], threshold: float = CONFIDENCE_THRESHOLD) -> tuple[list[Finding], list[Finding]]:
5757
"""Split into (reported, needs_human_review) by confidence."""
5858
reported = [f for f in findings if f.confidence >= threshold]
5959
needs = [f for f in findings if f.confidence < threshold]
6060
return reported, needs
6161

6262

63-
def severity_distribution(findings):
63+
def severity_distribution(findings: list[Finding]) -> dict[str, int]:
6464
"""Count findings per severity."""
6565
dist: dict[str, int] = {}
6666
for f in findings:

0 commit comments

Comments
 (0)