Skip to content

build: adopt PublicApiSharp.Analyzers for public API tracking - #4428

Open
glennawatson wants to merge 2 commits into
mainfrom
chore/adopt-publicapisharp-analyzers
Open

build: adopt PublicApiSharp.Analyzers for public API tracking#4428
glennawatson wants to merge 2 commits into
mainfrom
chore/adopt-publicapisharp-analyzers

Conversation

@glennawatson

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Build.

What is the new behavior?

Public API tracking moves to PublicApiSharp.Analyzers (PAS0001-PAS0005), matching Splat.

  • One PublicAPI.txt per project per target framework, holding nested C# that reads like source. Always current - no shipped/unshipped split and no promotion step, so an API change is reviewed as the diff itself.
  • Wired through EnablePublicApiBaseline; the package resolves the per-TFM baseline, so the AdditionalFiles glob is gone.
  • PAS0004 is enabled, so a target framework with no baseline cannot pass unnoticed.
  • 232 baselines, covering every target framework including Apple.

What is the current behavior?

Microsoft.CodeAnalysis.PublicApiAnalyzers with a PublicAPI.Shipped.txt / PublicAPI.Unshipped.txt pair per target framework, and tools/generate-publicapi.* to fold one into the other.

What might this PR break?

  • No product code changed and no public API changed; the baselines are a re-expression of the existing surface in the new format.
  • tools/generate-publicapi.sh / .ps1 are removed. Regenerate with dotnet format analyzers <proj> -f <tfm> --diagnostics PAS0001 PAS0003 --severity info.
  • The generated *_wpftmp projects are excluded from tracking: they sit in the real project's directory and resolve the same baseline path, so they overwrote it.

Checklist

  • I have read the Contribute guide
  • Tests have been added or updated (for bug fixes / features)
  • Docs have been added or updated (for bug fixes / features)
  • Changes target the main branch
  • PR title follows Conventional Commits

Additional information

Baselines were generated on Windows, which has the Apple and Android workloads. The 168 that Linux can also produce came back byte-identical, so the rendering is host-independent.

- An XML comment cannot contain '--', so the regeneration note broke
  every MSBuild import of src/Directory.Build.props.
- Reword the note without the literal command-line switches.
@sonarqubecloud

sonarqubecloud Bot commented Aug 2, 2026

Copy link
Copy Markdown

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