Skip to content

Add suppressor for GetScope()#88

Merged
viceroypenguin merged 2 commits intomasterfrom
suppressor
Feb 10, 2026
Merged

Add suppressor for GetScope()#88
viceroypenguin merged 2 commits intomasterfrom
suppressor

Conversation

@viceroypenguin
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings February 10, 2026 02:38
Copy link
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

Adds a Roslyn diagnostic suppressor to prevent CA2000 false-positives when using Owned<T>.GetScope(out T) and introduces a dedicated test project to validate suppressor behavior.

Changes:

  • Add OwnedDisposableScopeSuppressor (suppresses CA2000 for Owned<T>.GetScope(out T) patterns).
  • Add suppressor test infrastructure and test cases for CA2000 suppression/non-suppression scenarios.
  • Introduce an analyzers project and update packaging/solution/config to include it.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Immediate.Cache.Analyzers/OwnedDisposableScopeSuppressor.cs New suppressor implementation for CA2000 around Owned<T>.GetScope(out T).
src/Immediate.Cache.Analyzers/Immediate.Cache.Analyzers.csproj New Roslyn component project for analyzers/suppressors.
tests/Immediate.Cache.Tests/SuppressorTests/SuppressorTestHelpers.cs Test helper utilities for running suppressor/analyzer tests.
tests/Immediate.Cache.Tests/SuppressorTests/OwnedDisposableScopeSuppressorTests.cs New test coverage validating suppression behavior.
tests/Immediate.Cache.Tests/Immediate.Cache.Tests.csproj New test project for analyzer/suppressor tests.
src/Immediate.Cache/Immediate.Cache.csproj Packs the analyzer DLL with the main package and references the analyzer project.
Directory.Packages.props Adds central package versions needed for analyzer testing / Roslyn dependencies.
Immediate.Cache.slnx Adds the new analyzers project and test project to the solution.
.editorconfig Updates analyzer severities and adds scoped rules (currently with a path typo).
tests/Immediate.Cache.FunctionalTests/.editorconfig Removes per-project editorconfig in favor of root configuration.

Copy link
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

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

@viceroypenguin viceroypenguin merged commit 2f435bf into master Feb 10, 2026
7 checks passed
@viceroypenguin viceroypenguin deleted the suppressor branch February 10, 2026 02:57
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