Skip to content

Fix DefaultVerificationExcludePatterns to use ** for recursive matching#54390

Open
NikolaMilosavljevic wants to merge 4 commits into
dotnet:mainfrom
NikolaMilosavljevic:temp3
Open

Fix DefaultVerificationExcludePatterns to use ** for recursive matching#54390
NikolaMilosavljevic wants to merge 4 commits into
dotnet:mainfrom
NikolaMilosavljevic:temp3

Conversation

@NikolaMilosavljevic
Copy link
Copy Markdown
Member

Fixes dotnet/sdk#54274

The DefaultVerificationExcludePatterns in VerificationEngine.cs used single * globs (e.g. **/obj/*) which only match files directly inside obj/ or bin/ — not nested paths like obj/Debug/net10.0/AssemblyInfo.cs. Changed to ** (e.g. **/obj/**) for recursive matching.

Changes

  • src/TemplateEngine/Tools/Microsoft.TemplateEngine.Authoring.TemplateVerifier/VerificationEngine.cs — Changed 4 default exclude patterns from * to ** in the trailing segment
  • test/TemplateEngine/Microsoft.TemplateEngine.Authoring.TemplateVerifier.UnitTests/VerificationEngineTests.cs — Added DefaultExcludePatternsFilterNestedObjAndBinFiles test verifying nested obj/bin files are properly excluded

Build & Test

  • Full repo build passes
  • All TemplateVerifier unit tests pass, including the new one

The default exclude patterns used single * (e.g. **/obj/*) which only
matches files directly inside obj/ or bin/ directories. Changed to **
(e.g. **/obj/**) to recursively match all nested paths like
obj/Debug/net10.0/AssemblyInfo.cs.

Fixes dotnet#54274

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 20, 2026 16:23
Copy link
Copy Markdown
Contributor

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 TemplateVerifier’s default verification exclude patterns so obj/ and bin/ are excluded recursively (matching nested build outputs), addressing #54274 and reducing snapshot noise for buildable templates.

Changes:

  • Updated the default exclude globs from **/obj/* / **/bin/* to **/obj/** / **/bin/** (and the backslash variants) for recursive matching.
  • Added a unit test to ensure nested obj/ and bin/ files are excluded by default.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/TemplateEngine/Tools/Microsoft.TemplateEngine.Authoring.TemplateVerifier/VerificationEngine.cs Broadens default exclude globs to recursively filter obj/ and bin/ contents.
test/TemplateEngine/Microsoft.TemplateEngine.Authoring.TemplateVerifier.UnitTests/VerificationEngineTests.cs Adds coverage for nested obj/bin exclusion behavior via a new unit test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Default VerificationExcludePatterns use single * instead of ** — broken for nested obj/bin paths

2 participants