Skip to content
This repository was archived by the owner on Nov 10, 2026. It is now read-only.

feat: add options to the public API and include forwarded types - #47

Merged
vbreuss merged 3 commits into
mainfrom
feat/public-api-options
Oct 18, 2026
Merged

vbreuss merged 3 commits into
mainfrom
feat/public-api-options

Conversation

@vbreuss

@vbreuss vbreuss commented Oct 18, 2026

Copy link
Copy Markdown
Member

Removing a type forward breaks the consumers that were compiled against the assembly, but the forwards were not part of the public API, as they are stored in the metadata instead of as attributes. They are now written as [assembly: TypeForwardedTo(typeof(…))] and can be excluded with the new options overloads of the expectation and of PublicApiDeclarations.GenerateFrom, which further options can extend:

await Expect.That(typeof(MyType).Assembly).MatchesPublicApiSnapshot(o => o.ExcludingForwardedTypes());

@vbreuss vbreuss self-assigned this Oct 18, 2026
@github-actions

Copy link
Copy Markdown

👽 Mutation Results

Mutation testing badge

aweXpect.Snapshots

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Runtime Errors Total Detected Total Undetected Total Mutants

The final mutation score is NaN%

Coverage Thresholds: high:80 low:60 break:0

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 9V74 3.69GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.303
[Host] : .NET 8.0.32 (8.0.32, 8.0.3226.50405), X64 RyuJIT x86-64-v4
DefaultJob : .NET 8.0.32 (8.0.32, 8.0.3226.50405), X64 RyuJIT x86-64-v4

Method Mean Error StdDev Gen0 Allocated
Dummy_aweXpect 108.6 ns 1.19 ns 1.12 ns 0.0229 384 B

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Test Results

   31 files  ± 0     31 suites  ±0   1m 5s ⏱️ +30s
  884 tests + 6    883 ✅ + 6  1 💤 ±0  0 ❌ ±0 
5 254 runs  +36  5 253 ✅ +36  1 💤 ±0  0 ❌ ±0 

Results for commit 437fd90. ± Comparison against base commit 0543624.

♻️ This comment has been updated with latest results.

@vbreuss
vbreuss added this pull request to stack #49 October 18, 2026 06:33
Removing a type forward breaks the consumers that were compiled against the assembly, but the forwards were not part of the public API, as they are stored in the metadata instead of as attributes. They are now written as `[assembly: TypeForwardedTo(typeof(…))]` and can be excluded with the new options overloads of the expectation and of `PublicApiDeclarations.GenerateFrom`, which further options can extend:

```csharp
await Expect.That(typeof(MyType).Assembly).MatchesPublicApiSnapshot(o => o.ExcludingForwardedTypes());
```
They capture nothing, like the other non-capturing lambdas in the repository, and static keeps it that way.
Writing the forwarded types raised the cognitive complexity of writing the assembly above the limit of Sonar.
@vbreuss
vbreuss force-pushed the feat/public-api-options branch from 88c28bc to 437fd90 Compare October 18, 2026 06:48
@sonarqubecloud

Copy link
Copy Markdown

@vbreuss
vbreuss merged commit 3acd2b0 into main Oct 18, 2026
15 checks passed
@vbreuss
vbreuss deleted the feat/public-api-options branch October 18, 2026 08:12
@github-actions

Copy link
Copy Markdown

This is addressed in release v0.4.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant