Skip to content

Commit 1e6e976

Browse files
aristathclaude
andcommitted
Fix regex to capture Methods percentage correctly
The regex was incorrectly trying to match the Methods percentage without capturing it. Since the match groups were off by one, line_percent was getting the wrong value. Changed from: r'^([\w\\]+)\s+Methods:\s+[\d.]+%.*Lines:\s+([\d.]+)%...' To: r'^([\w\\]+)\s+Methods:\s+([\d.]+)%.*Lines:\s+([\d.]+)%...' Now the groups are: - Group 1: Class name - Group 2: Methods percentage (unused but captured) - Group 3: Lines percentage - Groups 4-5: Covered/total lines 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9973f48 commit 1e6e976

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/code-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ jobs:
200200
def parse_coverage_line(line):
201201
"""Parse a coverage line to extract class name and line coverage percentage."""
202202
# Example line: "Progress_Planner\Activity Methods: 55.56% ( 5/ 9) Lines: 91.92% ( 91/ 99)"
203-
match = re.search(r'^([\w\\]+)\s+Methods:\s+[\d.]+%.*Lines:\s+([\d.]+)%\s+\(\s*(\d+)/\s*(\d+)\)', line)
203+
match = re.search(r'^([\w\\]+)\s+Methods:\s+([\d.]+)%.*Lines:\s+([\d.]+)%\s+\(\s*(\d+)/\s*(\d+)\)', line)
204204
if match:
205205
class_name = match.group(1)
206206
line_percent = float(match.group(2))

0 commit comments

Comments
 (0)