Skip to content

Code review D: A1 PublicAPI baseline#140

Merged
Chris-Wolfgang merged 2 commits into
vNextfrom
stack/cr-d-publicapi-baseline
Jun 3, 2026
Merged

Code review D: A1 PublicAPI baseline#140
Chris-Wolfgang merged 2 commits into
vNextfrom
stack/cr-d-publicapi-baseline

Conversation

@Chris-Wolfgang
Copy link
Copy Markdown
Owner

Turns on Microsoft.CodeAnalysis.PublicApiAnalyzers for this repo by adding the PublicAPI.Shipped.txt and PublicAPI.Unshipped.txt files alongside the src csproj.

Shipped lists the two public extension methods + the containing static class — the v1.1.0 baseline. Unshipped is empty since no surface changes are queued.

After this merges, accidentally changing the public surface (rename, new method, removed method) will fail the Release build with RS0016/RS0017 instead of silently shipping.

Verified: dotnet build -c Release is clean, 0 warnings, 0 errors. Stacked on vNext (PR #129).

…up D)

Microsoft.CodeAnalysis.PublicApiAnalyzers is wired up in DBP but stays
inert until PublicAPI.Shipped.txt / PublicAPI.Unshipped.txt exist
alongside the src csproj (the AdditionalFiles include is conditional
on Exists(...)).

Adding the two files turns the analyzer on. Once tracked:
- Adding a new public method without a matching line in
  PublicAPI.Unshipped.txt fails RS0016 at build time.
- Removing a public method without removing the corresponding
  Shipped line fails RS0017.

PublicAPI.Shipped.txt is the baseline for the v1.1.0 public surface
(the two IsBetween/IsInRange methods + the containing static class).
PublicAPI.Unshipped.txt is empty modulo the #nullable enable header —
no surface changes are queued for the v1.1.2 release.

Build clean in Release, 0 warnings, 0 errors.
Copilot AI review requested due to automatic review settings June 2, 2026 17:24
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 establishes the v1.1.0 public API baseline for Wolfgang.Extensions.IComparable by adding PublicAPI.Shipped.txt and PublicAPI.Unshipped.txt next to the library csproj, enabling Microsoft.CodeAnalysis.PublicApiAnalyzers to enforce API-surface stability in Release builds.

Changes:

  • Added PublicAPI.Shipped.txt containing the shipped public surface (static extensions + containing type).
  • Added PublicAPI.Unshipped.txt (currently empty aside from nullable context) to track future API additions/removals prior to release.

Reviewed changes

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

File Description
src/Wolfgang.Extensions.IComparable/PublicAPI.Shipped.txt Defines the shipped public API baseline for the library.
src/Wolfgang.Extensions.IComparable/PublicAPI.Unshipped.txt Provides the unshipped API tracking file (currently no pending surface changes).

@Chris-Wolfgang Chris-Wolfgang merged commit d2b0651 into vNext Jun 3, 2026
1 check passed
@Chris-Wolfgang Chris-Wolfgang deleted the stack/cr-d-publicapi-baseline branch June 3, 2026 00:56
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.

2 participants