Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes the regex pattern in the csc.json problem matcher to support .NET 10 build errors that start with whitespace characters. The change removes the constraint that prevented matching lines beginning with spaces.
Key Changes:
- Modified the regex pattern to allow file paths starting with spaces by changing
^([^\\s].*)to^(.*)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "pattern": [ | ||
| { | ||
| "regexp": "^([^\\s].*)\\((\\d+)(?:,\\d+|,\\d+,\\d+)?\\):\\s+(error|warning)\\s+([a-zA-Z]+(?<!MSB)\\d+):\\s*(.*?)\\s+\\[(.*?)\\]$", | ||
| "regexp": "^(.*)\\((\\d+)(?:,\\d+|,\\d+,\\d+)?\\):\\s+(error|warning)\\s+([a-zA-Z]+(?<!MSB)\\d+):\\s*(.*?)\\s+\\[(.*?)\\]$", |
There was a problem hiding this comment.
The regex pattern change from ^([^\\s].*) to ^(.*) makes the pattern overly permissive. While it solves the issue of matching lines starting with spaces, it also allows matching lines that start with whitespace-only content or even empty filenames.
Consider using ^(\\s*.+) instead, which explicitly allows optional leading whitespace but still requires at least one character for the filename. This maintains the intent of matching paths with leading spaces while preventing potential false positives from empty or whitespace-only matches.
Description:
We use basic dotnet 10, and our build errors start with only spaces.
Related issue:
None.
Check list: