Code review D: A1 PublicAPI baseline#140
Merged
Merged
Conversation
…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.
Contributor
There was a problem hiding this comment.
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.txtcontaining 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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Turns on
Microsoft.CodeAnalysis.PublicApiAnalyzersfor this repo by adding thePublicAPI.Shipped.txtandPublicAPI.Unshipped.txtfiles 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 Releaseis clean, 0 warnings, 0 errors. Stacked on vNext (PR #129).