Skip to content

Commit 9973f48

Browse files
aristathclaude
andcommitted
Fix regex pattern to match AWK output format
The Python regex was expecting leading whitespace before class names, but the AWK script outputs class names at the start of lines without leading whitespace. Changed regex from: r'^\s+([\w\\]+)\s+Methods:...' To: r'^([\w\\]+)\s+Methods:...' This allows the parser to correctly extract coverage data from lines like: "Progress_Planner\Activity Methods: 55.56% ( 5/ 9) Lines: 91.92% ( 91/ 99)" With base coverage at 0%, all files with coverage should now appear as "new files" in the collapsible details section of the PR comment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3032edf commit 9973f48

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/code-coverage.yml

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

0 commit comments

Comments
 (0)