mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 05:20:49 -05:00
[ty] Better handling for neutral conformence test changes (#22585)
This commit is contained in:
@@ -433,6 +433,9 @@ def diff_format(
|
||||
neutral: bool = False,
|
||||
is_percentage: bool = False,
|
||||
):
|
||||
if diff == 0:
|
||||
return ""
|
||||
|
||||
increased = diff > 0
|
||||
good = " (✅)" if not neutral else ""
|
||||
bad = " (❌)" if not neutral else ""
|
||||
@@ -468,6 +471,16 @@ def render_summary(grouped_diagnostics: list[GroupedDiagnostics]):
|
||||
false_neg_change = new.false_negatives - old.false_negatives
|
||||
total_change = new.total - old.total
|
||||
|
||||
if (
|
||||
precision_change == 0
|
||||
and recall_change == 0
|
||||
and true_pos_change == 0
|
||||
and false_pos_change == 0
|
||||
and false_neg_change == 0
|
||||
and total_change == 0
|
||||
):
|
||||
return "## Typing conformance\n\nNo changes"
|
||||
|
||||
true_pos_diff = diff_format(true_pos_change, greater_is_better=True)
|
||||
false_pos_diff = diff_format(false_pos_change, greater_is_better=False)
|
||||
false_neg_diff = diff_format(false_neg_change, greater_is_better=False)
|
||||
|
||||
Reference in New Issue
Block a user