Skip to content

Commit db2d2df

Browse files
tirth8205claude
andcommitted
fix: suppress both arg-type and return-value mypy codes for sort keys
Different mypy versions report different error codes for the same lambda sort key issue. Suppress both to pass across Python 3.10-3.13. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d7fc288 commit db2d2df

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

code_review_graph/analysis.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def find_hub_nodes(store: GraphStore, top_n: int = 10) -> list[dict]:
4949
})
5050

5151
scored.sort(
52-
key=lambda x: x.get("total_degree", 0), # type: ignore[arg-type]
52+
key=lambda x: x.get("total_degree", 0), # type: ignore[arg-type,return-value]
5353
reverse=True,
5454
)
5555
return scored[:top_n]
@@ -106,7 +106,7 @@ def find_bridge_nodes(
106106
})
107107

108108
results.sort(
109-
key=lambda x: float(x.get("betweenness", 0)), # type: ignore[arg-type]
109+
key=lambda x: float(x.get("betweenness", 0)), # type: ignore[arg-type,return-value]
110110
reverse=True,
111111
)
112112
return results[:top_n]
@@ -184,7 +184,7 @@ def find_knowledge_gaps(store: GraphStore) -> dict[str, list[dict]]:
184184
"degree": d,
185185
})
186186
untested_hotspots.sort(
187-
key=lambda x: x.get("degree", 0), # type: ignore[arg-type]
187+
key=lambda x: x.get("degree", 0), # type: ignore[arg-type,return-value]
188188
reverse=True,
189189
)
190190

@@ -308,7 +308,7 @@ def find_surprising_connections(
308308
})
309309

310310
scored_edges.sort(
311-
key=lambda x: float(x.get("surprise_score", 0)), # type: ignore[arg-type]
311+
key=lambda x: float(x.get("surprise_score", 0)), # type: ignore[arg-type,return-value]
312312
reverse=True,
313313
)
314314
return scored_edges[:top_n]

0 commit comments

Comments
 (0)