Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable CS1591 for projects that don't use intellisense package XML file #84917

Merged
merged 19 commits into from
Jun 17, 2023

Conversation

ViktorHofer
Copy link
Member

Noticed that while looking at the intellisense.targets file that projects like Microsoft.Extensions which don't use the Microsoft.Private.Intellisense intellisense package XML file still set NoWarn+=CS1591.

WIP: This will probably result in some projects raising errors that we need to fix.

@ViktorHofer ViktorHofer self-assigned this Apr 17, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Apr 17, 2023
@ViktorHofer ViktorHofer added bug area-Infrastructure-libraries and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Apr 18, 2023
@ViktorHofer ViktorHofer added this to the 8.0.0 milestone Apr 18, 2023
@carlossanlop
Copy link
Member

carlossanlop commented Apr 18, 2023

From our chat, you mentioned we can also ignore Microsoft.Extensions.Specifications.Tests because it isn't critical to offer API as it's just a test dependency tool.

BTW, I couldn't find System.Numerics.Tensors in dotnet-api-docs. Turns out it is non-shipping (Tanner confirmed), and we remove it on purpose from the ref assemblies drop we send to them.

I mention it because I was trying to backport the docs, but couldn't find anything. So I guess we need to ignore the CS warning in that assembly.

@carlossanlop
Copy link
Member

carlossanlop commented Apr 19, 2023

The RateLimiter APIs live in the ASP.NET API docs repo, and they are undocumented there. If we want to fill the missing documentation items, it'll have to be done manually in triple slash directly.

https://github.com/dotnet/AspNetApiDocs/blob/main/aspnet-core/xml/System.Threading.RateLimiting

Copy link
Member

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of unnecessary full namespaces.

@ghost ghost closed this May 24, 2023
@ghost
Copy link

ghost commented May 24, 2023

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

@ViktorHofer ViktorHofer reopened this May 25, 2023
@ViktorHofer
Copy link
Member Author

Reopening as we want to continue this work when we have free cycles again (soon).

@ViktorHofer ViktorHofer marked this pull request as ready for review June 15, 2023 10:08
@ViktorHofer ViktorHofer requested a review from carlossanlop June 15, 2023 10:38
Copy link
Member

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Left some comments.

/// </param>
/// <returns>
/// A task that represents the asynchronous stop operation.
/// </returns>
public Task StopAsync(CancellationToken cancellationToken)
{
return Task.CompletedTask;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added comments do not match what the method does. This is only returning the object that represents a completed task.

Copy link
Member Author

@ViktorHofer ViktorHofer Jun 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You added those in one of the commits. I assume they are just a straight port from docs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand. What commits are you referring to?

Copy link
Member Author

@ViktorHofer ViktorHofer Jun 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You contributed to this PR. See the commits tab.

3013103

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. I just noticed the date of this PR.

Yes, I ported them using the tool. They exist this way in MS Docs: https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.hosting.systemd.systemdlifetime.stopasync?view=dotnet-plat-ext-3.1

@gewarren I suppose the documentation of this API needs to say something along the lines of "This API does nothing except returning a completed task". Is this correct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ViktorHofer we can address it in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlossanlop Yes the summary could be something like "Returns a task that has already completed."

@@ -5,6 +5,9 @@

namespace Microsoft.Extensions.Hosting
{
/// <summary>
/// Options to configure the lifetime of a windows service.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Options to configure the lifetime of a windows service.
/// Options to configure the lifetime of a Windows service.

@@ -9,6 +9,8 @@
<IsTrimmable>false</IsTrimmable>
<EnableAOTAnalyzer>false</EnableAOTAnalyzer>
<NoWarn>$(NoWarn);CA1852</NoWarn>
<!-- Public API not fully documented. -->
<NoWarn>$(NoWarn);1591</NoWarn>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @dotnet/area-extensions-dependencyinjection area owners: This assembly is missing public documentation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -2,6 +2,8 @@
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- Public API not fully documented. -->
<NoWarn>$(NoWarn);1591</NoWarn>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @dotnet/area-system-numerics-tensors area owners, this assembly is missing public documentation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -7,6 +7,8 @@
<NoWarn>$(NoWarn);CS0649;SA1129;IDE0059;IDE0060;CA1822;CA1852</NoWarn>
<Nullable>annotations</Nullable>
<IsTrimmable>false</IsTrimmable>
<!-- Public API not fully documented. -->
<NoWarn>$(NoWarn);1591</NoWarn>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @dotnet/area-system-speech area owners: This assembly is missing public documentation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- the assembly is a PNSE assembly. -->
<NoWarn Condition="'$(IntellisensePackageXmlFilePath)' != '' or
'$(IsPrivateAssembly)' == 'true' or
'$(GeneratePlatformNotSupportedAssemblyMessage)' != ''">$(NoWarn);1591</NoWarn>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about IsPartialFacadeAssembly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compiler doesn't warn for undocumented types referenced via type forwards.

@ViktorHofer
Copy link
Member Author

@carlossanlop would you mind if we react to additional feedback in a follow-up change and meanwhile get this in? I would like to have this validation in place in main. I could imagine that with a new assembly or new API added to one of the source-of-truth assemblies, this PR would start failing again.

@ViktorHofer ViktorHofer merged commit 7d8db25 into main Jun 17, 2023
@ViktorHofer ViktorHofer deleted the ViktorHofer-patch-2 branch June 17, 2023 07:35
@ghost ghost locked as resolved and limited conversation to collaborators Jul 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants