G-Research / ParquetSharp

ParquetSharp is a .NET library for reading and writing Apache Parquet files.
Apache License 2.0
185 stars 49 forks source link

Set up Roslyn Public API Analyzer #449

Closed adamreeve closed 6 months ago

adamreeve commented 6 months ago

Set up the Roslyn Public API analyzer which should detect changes that break the API or ABI.

We need per-target public API files due to having some methods that use the Half, DateOnly and TimeOnly types that are only available for targets >= net6.

I've had to disable some warnings about overloaded methods that have optional arguments. We can't change those now that they've been shipped.

Any local changes can be automatically added to the unshipped API txt file with:

dotnet restore
dotnet format analyzers --diagnostics=RS0016 --no-restore

(Others might not need the separate restore and --no-restore argument but I had to do it that way to work around a bug)

Then when we make a release we should manually move anything in the unshipped files over to the shipped files.

There are more details in https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md