Skip to content

Conversation

@jguddas
Copy link

@jguddas jguddas commented Dec 17, 2025

Description:
We use basic dotnet 10, and our build errors start with only spaces.

Related issue:
None.

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@jguddas jguddas requested a review from a team as a code owner December 17, 2025 09:53
Copilot AI review requested due to automatic review settings December 17, 2025 09:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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+\\[(.*?)\\]$",
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant