dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.73k stars 1.07k forks source link

[ApiCompat] Include description in generated suppression file output #39892

Open jpobst opened 7 months ago

jpobst commented 7 months ago

When you generate a suppression file, it is largely unreadable by humans, requiring a lot of investigation to determine what the issues are.

Example:

<Suppression>
  <DiagnosticId>CP0005</DiagnosticId>
  <Target>M:Android.Net.Wifi.WifiManager.WpsCallback.OnFailed(Android.Net.Wifi.WpsFailureReason)</Target>
</Suppression>

The "old" internal Microsoft.DotNet.ApiCompat provided a much more human readable suppression file format:

CannotAddAbstractMembers : Member 'public void Android.Net.Wifi.WifiManager.WpsCallback.OnFailed(Android.Net.Wifi.WpsFailureReason)' is abstract in the implementation but is missing in the contract.

It would be nice to (optionally) include the human readable version in the generated XML suppression file:

<Suppression>
  <DiagnosticId>CP0005</DiagnosticId>
  <Target>M:Android.Net.Wifi.WifiManager.WpsCallback.OnFailed(Android.Net.Wifi.WpsFailureReason)</Target>
  <Description>CannotAddAbstractMembers : Member 'public void Android.Net.Wifi.WifiManager.WpsCallback.OnFailed(Android.Net.Wifi.WpsFailureReason)' is abstract in the implementation but is missing in the contract.</Description>
</Suppression>
dotnet-policy-service[bot] commented 7 months ago

@dotnet/area-infrastructure-libraries a new issue has been filed in the ApiCompat area, please triage

ericstj commented 7 months ago

@ViktorHofer @joperezr - I too find this challenge - especially when reviewing PRs. Remind me the reason why we didn't include the friendly text in the suppression file - was it localization concerns? Could we allow folks to opt in to it?

ViktorHofer commented 7 months ago

I agree, this makes it hard to reason about the contents of a suppression file and is a UX downgrade to what we previously had with the non-shipping APICompat tool. The reason for this predates me working on this project but I'm pretty sure this was due to localization and suppression file size concerns.