From d4e941882548a50a6da0572033d345a328aa860a Mon Sep 17 00:00:00 2001 From: Zanie Date: Thu, 26 Oct 2023 14:24:23 -0500 Subject: [PATCH] Fix calculation to ignore fixes --- python/ruff-ecosystem/ruff_ecosystem/check.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/python/ruff-ecosystem/ruff_ecosystem/check.py b/python/ruff-ecosystem/ruff_ecosystem/check.py index 4fd268ef5c..cc9f40a4d4 100644 --- a/python/ruff-ecosystem/ruff_ecosystem/check.py +++ b/python/ruff-ecosystem/ruff_ecosystem/check.py @@ -73,9 +73,18 @@ def markdown_check_result(result: Result) -> str: lines.append(f"\u2139\ufe0f ecosystem check **detected linter changes**. {changes}") lines.append("") - # Limit the number of items displayed per rule with a floor of 10 and - # ceiling of 200 depending on the total number of affected rules - max_display_per_rule = max(10, 200 // total_affected_rules) + # Limit the number of items displayed per rule to between 10 and 200 + max_display_per_rule = max( + 10, + # Calculate the number of affected rules that we would display to increase + # the maximum if there are less rules affected + 200 + // len( + set(all_rule_changes.added_violations.keys()).union( + all_rule_changes.removed_violations.keys() + ) + ), + ) # Display per project changes for project, comparison in result.completed: