Skip to content

Expand the CSC problem matcher to light up more errors on GitHub.#717

Open
StephenCleary wants to merge 1 commit intoactions:mainfrom
StephenCleary:fix-csc-problem-matcher
Open

Expand the CSC problem matcher to light up more errors on GitHub.#717
StephenCleary wants to merge 1 commit intoactions:mainfrom
StephenCleary:fix-csc-problem-matcher

Conversation

@StephenCleary
Copy link
Copy Markdown

Description:

This extends the csc problem matcher to support more flexible error message syntax, with tests. All examples have been seen in actual GHA runner output (these are anonymized real-world cases).

There are three changes to the regex:

  • At the beginning of the line, whitespace and msbuild-style project number prefixes (e.g., 10>) are allowed. This is necessary for dotnet msbuild error parsing as well as dotnet build error parsing in some scenarios.
  • Column numbers are now captured.
  • Error codes no longer need to end in a number. This is necessary for dotnet format error parsing.

Related issue:

Replaces #691. Also see #583 which takes the alternative approach of adding an independent problem matcher for dotnet format (this PR includes dotnet format errors in the csc problem matcher).

Check list:

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

Expand csc problem matcher with more real-world scenarios.
@StephenCleary StephenCleary requested a review from a team as a code owner March 26, 2026 20:02
Copilot AI review requested due to automatic review settings March 26, 2026 20:02
Copy link
Copy Markdown

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 expands the GitHub Actions CSC problem matcher regex so it recognizes a wider variety of real-world compiler/analyzer error formats (including dotnet msbuild prefixes and dotnet format-style codes), and updates tests to cover the new parsing behavior.

Changes:

  • Updated .github/csc.json regex to allow leading whitespace and optional MSBuild project-number prefixes (e.g., 20>), capture column numbers, and allow non-numeric error codes.
  • Extended Jest coverage with multiple real-world-inspired matcher examples (including dotnet format and MSBuild-prefixed output).
  • Refactored the test to use test.each for clearer case-by-case validation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
__tests__/csc.test.ts Adds multiple test cases validating the expanded matcher behavior and captured groups (including column).
.github/csc.json Expands the matcher regex and updates capture-group mapping (adds column, shifts indices).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@StephenCleary
Copy link
Copy Markdown
Author

CC @baronfel

Copy link
Copy Markdown

@baronfel baronfel left a comment

Choose a reason for hiding this comment

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

LGTM from MSBuild team side!

@Frulfump
Copy link
Copy Markdown

Nice now we just have to wait for the maintainers of this repo and they are always super slow #701
One could clear the backlog of this repo in a week with AI but I think they are aiming for job security...

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.

5 participants