Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Turn on xml documentation validation globally. - #32934

Merged
danmoseley merged 36 commits into
dotnet:masterfrom
AraHaanOrg:AraHaan/global-xml-docs
Dec 9, 2018
Merged

danmoseley merged 36 commits into
dotnet:masterfrom
AraHaanOrg:AraHaan/global-xml-docs

Conversation

@AraHaan

@AraHaan AraHaan commented Oct 20, 2018

Copy link
Copy Markdown
Member

This is my fixes for issue #30177.

Note the BOM (byte order mark seems to not be friendly on some editors I have).

@danmoseley

Copy link
Copy Markdown

Trying again

@danmoseley danmoseley closed this Oct 21, 2018
@danmoseley danmoseley reopened this Oct 21, 2018
@danmoseley

Copy link
Copy Markdown

@safern I guess build is broken?

18:52:01 D:\j\workspace\windows-TGrou---2a8f9c29\eng\Tools.props(36,5): error MSB3073: The command "D:\j\workspace\windows-TGrou---2a8f9c29\.packages\/microsoft.dotnet.buildtools/3.0.0-preview1-03316-04/lib/init-tools.cmd D:\j\workspace\windows-TGrou---2a8f9c29\ D:\j\workspace\windows-TGrou---2a8f9c29\.dotnet\dotnet.exe D:\j\workspace\windows-TGrou---2a8f9c29\Tools D:\j\workspace\windows-TGrou---2a8f9c29\.packages\\ > D:\j\workspace\windows-TGrou---2a8f9c29\init-tools.log" exited with code 1. [D:\j\workspace\windows-TGrou---2a8f9c29\.packages\microsoft.dotnet.arcade.sdk\1.0.0-beta.18519.9\tools\Tools.proj]

@safern

safern commented Oct 22, 2018

Copy link
Copy Markdown
Member

@safern I guess build is broken?

No, the reason why the build is failing is because the properties that are being added need aren't within a statement.

@AraHaan please wrap them up inside a statement.

<PropertyGroup>
  <DocumentationFile Condition="'$(IsTestProject)' != 'true' AND '$(IsReferenceAssembly)' !='true'">$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
  <NoWarn Condition="'$(DocumentationFile)' != ''">1591</NoWarn>
</PropertyGroup>

Comment thread Directory.Build.props Resolved
Comment thread Directory.Build.props Resolved
@safern

safern commented Oct 22, 2018

Copy link
Copy Markdown
Member

Yes, github webhooks are down: https://status.github.com/messages that is why CI is not working now

Comment thread Directory.Build.props Resolved
@safern

safern commented Oct 22, 2018

Copy link
Copy Markdown
Member

I pulled your changes and did a full build and it failed. There is a bunch of docs issues. We might not be ready to turn this feature on for all projects: @weshaggard thoughts on doing this?

@AraHaan

AraHaan commented Oct 23, 2018

Copy link
Copy Markdown
Member Author

@safern I think this is because if badly formed xml documentation. Maybe someone needs to fix the xml documentations or suppressing them might be a better option for now.

@danmoseley

Copy link
Copy Markdown

I would fix any libraries where there are a handful of XML doc errors, and if there are any that will take a lot of time to fix, I would suppress the XML docs generation for those (in their own csproj) and open a new issue to fix and enalbe them.

@danmoseley

Copy link
Copy Markdown

@AraHaan still working on it?

@karelz karelz added this to the 3.0 milestone Nov 1, 2018
Comment thread Directory.Build.props Resolved
@AraHaan

AraHaan commented Nov 16, 2018

Copy link
Copy Markdown
Member Author

It seems on one of the errors is due to a documentation file missing. So it throws a file not found compile error. So I think the issue I opened to fix those got to be fixed by someone who has that file. Perhaps someone forgot to check it into source control?

@danmoseley

Copy link
Copy Markdown

@AraHaan the problem is that two projects wipe out the value you set of $(NoWarn):

Searching 683 files for "^\s+<NoWarn[^>]+>[^$]." (regex)

c:\git\corefx\src\System.Runtime.InteropServices\src\System.Runtime.InteropServices.csproj:
    8:     <NoWarn Condition="'$(TargetsAOT)' == 'true'">0436;3001</NoWarn>

c:\git\corefx\src\System.Security.Cryptography.Csp\src\System.Security.Cryptography.Csp.csproj:
    6:     <NoWarn Condition="'$(TargetsUnix)' == 'true'">CS0809</NoWarn>

In both cases they should append to $(NoWarn) ie

c:\git\corefx\src\System.Runtime.InteropServices\src\System.Runtime.InteropServices.csproj:
         <NoWarn Condition="'$(TargetsAOT)' == 'true'">$(NoWarn);0436;3001</NoWarn>

c:\git\corefx\src\System.Security.Cryptography.Csp\src\System.Security.Cryptography.Csp.csproj:
         <NoWarn Condition="'$(TargetsUnix)' == 'true'">$(NoWarn);0809</NoWarn>

@AraHaan

AraHaan commented Dec 8, 2018

Copy link
Copy Markdown
Member Author

Any idea about the test failure on OSX?

@danmoseley

Copy link
Copy Markdown

@AraHaan

AraHaan commented Dec 8, 2018

Copy link
Copy Markdown
Member Author

Odd on that build I see a CS0419 but in the project to it I see it suppressed already hmm I have no idea why.

@AraHaan

AraHaan commented Dec 8, 2018 •

Copy link
Copy Markdown
Member Author

Odd seems they still want to error depsite being suppressed on that job.

Edit: I might have to disable for System.Diagnostics.Process too.

@AraHaan

AraHaan commented Dec 8, 2018 •

Copy link
Copy Markdown
Member Author

Interesting, it seems just the disablement of the xml documentation for System.Diagnostics.Process fixed the OSX build.

Edit: @danmosemsft I just noticed and I will make another commit to change the NoWarn condition in that project as I do not like it overwriting the previous NoWarn values.

Also I might eventually open up a issue to ensure that all the suppressions get fixed so that way we can reenable the remaining xml documentations for Microsoft.VisualBasic, and for System.Diagnostics.Process, also because of that I might make a all in one solution file to Visual Studio for complete convienece for me to just go in and use the Visual Studio error list on all the projects at once compared to opening each and every solution at a time which would take too long. So if I push it it is only for people who want to go through a mass xml documentation fixtures (and maybe for a build from within Visual Studio itself).

@danmoseley

Copy link
Copy Markdown

Sounds good, or goal should be to fix all the errors and re-enable all warnings (except for entirely missing XML - many projects may never get XML docs)

@AraHaan

AraHaan commented Dec 8, 2018

Copy link
Copy Markdown
Member Author

Ok that should be ok too.

@danmoseley danmoseley left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM. Ideally we would be consistent about using CS prefixes on the error numbers.

Also probably it might have been better to define two flags that projects can set: <WarnForMissingXmlDoc>false</WarnForMissingXmlDoc> and <WarnForInvalidXmlDoc>false</WarnForInvalidXmlDoc>. Since the individual XML doc warning numbers aren't very interesting, and that would keep them all out of the project files. Then when each was cleaned up, the flags could be removed. It's fine, though.

@danmoseley

Copy link
Copy Markdown

For future reference, this is what I think are the complete set of XML doc warning codes:

For docs missing 

1573 WRN_MissingParamTag
1591 WRN_MissingXMLComment
1712 WRN_MissingTypeParamTag

For docs present but malformed

 419 WRN_AmbiguousXMLReference
1570 WRN_XMLParseError
1571 WRN_DuplicateParamTag
1572 WRN_UnmatchedParamTag
1574 WRN_BadXMLRef
1580 WRN_BadXMLRefParamType
1581 WRN_BadXMLRefReturnType
1584 WRN_BadXMLRefSyntax
1587 WRN_UnprocessedXMLComment
1589 WRN_FailedInclude
1590 WRN_InvalidInclude
1592 WRN_XMLParseIncludeError
1710 WRN_DuplicateTypeParamTag
1711 WRN_UnmatchedTypeParamTag
1723 WRN_BadXMLRefTypeVar
1734 WRN_UnmatchedParamRefTag
1735 WRN_UnmatchedTypeParamRefTag

@danmoseley
danmoseley merged commit 6abb4cd into dotnet:master Dec 9, 2018
@danmoseley

Copy link
Copy Markdown

Thanks @AraHaan . Do you plan to continue and maybe clean some of these projects so they don't need to disable warnings?

@AraHaan

AraHaan commented Dec 9, 2018

Copy link
Copy Markdown
Member Author

Ye, I also think the true/false values for the whole list to enable the suppressions is a good idea too.

@AraHaan
AraHaan deleted the AraHaan/global-xml-docs branch December 9, 2018 19:50
@safern

safern commented Dec 10, 2018

Copy link
Copy Markdown
Member

Also probably it might have been better to define two flags that projects can set: false and false. Since the individual XML doc warning numbers aren't very interesting, and that would keep them all out of the project files. Then when each was cleaned up, the flags could be removed. It's fine, though.

If we want csproj to be able to set this properties, just as an FYI, the work you did, would need to be moved to Directory.Build.targets or somewhere that is imported/evaluated after the csproj's properties. Directory.Build.props is the top of the stack.

@danmoseley

Copy link
Copy Markdown

Good point.

StanislavUshakov added a commit to StanislavUshakov/corefx that referenced this pull request Dec 14, 2018
CS3016 was added by mistake as part of dotnet#32934 so I removed it.
jlennox pushed a commit to jlennox/corefx that referenced this pull request Dec 16, 2018
* Turn on xml documentation validation globally.

* Ignore warning 1591 globally.

* Fixed build failures.

* Move the Original DocumentationFile Condition to the Group.

Now NoWarn has no Condition on it.

* Fixed NoWarn overwrite.

* Update Directory.Build.props

* Update System.Runtime.CompilerServices.Unsafe.ilproj

* Update file on github web.

Sadly it seems I can only do this on my phone now. RIP

* Update System.Security.Cryptography.Csp.csproj

* Update Directory.Build.props

* Suppress some warnings.

* Fixed remaining compile errors.

* Update System.Diagnostics.StackTrace.csproj

* Update System.Security.Cryptography.Xml.csproj

* Fixed xml documentation typo in Microsoft.VisualBasic.

* Fixed missing suppressions.

* Suppress more errors.

* Suppress more errors.

* Suppress more errors.

* Suppress even more errors.

* Suppress more errors.

* Update Directory.Build.props

* Suppress more errors.

Also fix a documentation issue specific to OSX.

* Suppress more errors.

* Suppress more errors.

* Disable xml documentation for System.Diagnostics.Process.

* Do not overwrite NoWarn.

* Enable docs for S.D.P
danmoseley pushed a commit that referenced this pull request Dec 17, 2018
* Fixed XML documentation tags for CoreFx.Private.TestUtilities

* Fixed XML documentation tags for System.Diagnostics.Process

* Fixed XML documentation tags for System.ComponentModel.Composition

* Fixed XML documentation tags for System.ComponentModel.Primitives

* Fixed XML documentation tags for System.ComponentModel.TypeConverter

* Fixed XML documentation tags for System.Data.Common

* Fixed XML documentation tags for System.Data.SqlClient

* Fixed XML documentation tags for System.Diagnostics.PerformanceCounter

* Fixed XML documentation tags for System.Diagnostics.StackTrace

* Fixed XML documentation for System.Diagnostics.TraceSource

* Fixed XML documentation for System.IO.Compression.ZipFile

* Fixed XML documentation for System.IO.Compression

* Fixed XMl documentation reference according to review notes

* Fixed XML documentation tags for System.IO.MemoryMappedFiles

* Fixed XML documentation tags for System.IO.Pipes

* Fixed XML documentation tag for OSX interop in System.Diagnostics.Process

* Fixed XML documentation tags for CoreFx.Private.TestUtilities for Unix

* Fixed XML documentation tags for System.Linq.Expressions

* Fixed XML documentation for System.Linq.Parallel

* Fixed XML documentationt ags for System.Linq

* Fixed XML documentation tags for System.Management

* Fixed XMl documentation tags for System.Net.Http (left CS1573)

* Fixed XMl documentation tags for System.Net.Mail

* Fixed XML documentation tags for System.Net.NameResolution

* Fixed XML documentation tags for System.Net.Primitives - added T prefix for Socket as Primitives do not reference System.Net.Sockets

* Fixed XML documentation tags for System.Net.Sockets

* Fixed XML documentation tags for Unix interop files

* Fixed XML documentation tags for System.Net.Http (Unix)

* Fixed XML documentation tags for PlatformDetection.Unix.cs according to review notes

* Fixed XML documentation tags for OSX interop

* Ignore CS1574 for System.Linq as there is no ConcatIterator{TSource}.ToList for uap.

* Fixed XML documentation tags for FreeBSD interop

* Fixed XML documentation tags for System.Net.WebSockets

* Fixed XMLm documentation tags for System.Transactions.Local

* Fixed XML documentation for System.Security.Principal.Windows

* Fixed XML documentation for System.Drawing.Common

* Fixed XML documentation for System.Net.NetworkInformation

* Fixed XML documentation tags for System.Private.XML (left CS1589)

* Fixed XML documentation tags for System.Security.Cryptography

* Fixed XML documentation for System.Runtime.WindowsRuntime

* Fixed XML documentation tags for System.Security.Cryptography.Xml

* Fixed XML documentation tags for System.Security.Cryptography.Primitives
CS3016 was added by mistake as part of #32934 so I removed it.

* Fixed XML documentation tags for System.Linq: added M to ToList method as it is not accessible by uap builds.

* Fixed XML documentation tags for System.IO.FileSystem

* Fixed XML documentation tags for System.Security.Cryptography.*

* Fixed XML documentation for System.IO.Ports

* Fixed XML documentation tags for System.Private.Reflection.Metadata.Ecma335

* Fixed XML documentation tags for System.Windows.Extensions

* Fixed XMl documentation tags for System.Console

* Fixed XML documentation for System.IO.FileSystem.DriveInfo

* Fixed XML documentation tags for System.Runtime.Extensions

* Fixed XML documentation tags for System.Drawing.Primitives.
Left CS1589 as there is no 'doc\KnownColor.uex' file.

* Fixed XMl documentation for System.Runtime.WindowsRuntime.
Had to add M prefix to 'Windows.Foundation.IAsyncAction' as Windows.Foundation is not accessible at compilation time.

* Fixed XML documentation tags for System.Private.Xml

* Fixed XML documentation tags for System.Private.Reflection.Metadata.Ecma335
Had to add a prefixes to: 'T:System.Collections.Immutable' and 'M:Enumerable.ToArray{TSource}' as they are not available for uap at compilation time.

* Fixed XML documentation tags for System.Net.WebSockets.WebSocketProtocol

* Fixed XML documentation tags for System.Net.WebSockets.WebSocketProtocol

* XML documentation tags fixes: changes after review.
macrogreg pushed a commit to open-telemetry/opentelemetry-dotnet-instrumentation that referenced this pull request Sep 24, 2020
* Turn on xml documentation validation globally.

* Ignore warning 1591 globally.

* Fixed build failures.

* Move the Original DocumentationFile Condition to the Group.

Now NoWarn has no Condition on it.

* Fixed NoWarn overwrite.

* Update Directory.Build.props

* Update System.Runtime.CompilerServices.Unsafe.ilproj

* Update file on github web.

Sadly it seems I can only do this on my phone now. RIP

* Update System.Security.Cryptography.Csp.csproj

* Update Directory.Build.props

* Suppress some warnings.

* Fixed remaining compile errors.

* Update System.Diagnostics.StackTrace.csproj

* Update System.Security.Cryptography.Xml.csproj

* Fixed xml documentation typo in Microsoft.VisualBasic.

* Fixed missing suppressions.

* Suppress more errors.

* Suppress more errors.

* Suppress more errors.

* Suppress even more errors.

* Suppress more errors.

* Update Directory.Build.props

* Suppress more errors.

Also fix a documentation issue specific to OSX.

* Suppress more errors.

* Suppress more errors.

* Disable xml documentation for System.Diagnostics.Process.

* Do not overwrite NoWarn.

* Enable docs for S.D.P


Commit migrated from dotnet/corefx@6abb4cd
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Turn on xml documentation validation globally.

* Ignore warning 1591 globally.

* Fixed build failures.

* Move the Original DocumentationFile Condition to the Group.

Now NoWarn has no Condition on it.

* Fixed NoWarn overwrite.

* Update Directory.Build.props

* Update System.Runtime.CompilerServices.Unsafe.ilproj

* Update file on github web.

Sadly it seems I can only do this on my phone now. RIP

* Update System.Security.Cryptography.Csp.csproj

* Update Directory.Build.props

* Suppress some warnings.

* Fixed remaining compile errors.

* Update System.Diagnostics.StackTrace.csproj

* Update System.Security.Cryptography.Xml.csproj

* Fixed xml documentation typo in Microsoft.VisualBasic.

* Fixed missing suppressions.

* Suppress more errors.

* Suppress more errors.

* Suppress more errors.

* Suppress even more errors.

* Suppress more errors.

* Update Directory.Build.props

* Suppress more errors.

Also fix a documentation issue specific to OSX.

* Suppress more errors.

* Suppress more errors.

* Disable xml documentation for System.Diagnostics.Process.

* Do not overwrite NoWarn.

* Enable docs for S.D.P


Commit migrated from dotnet/corefx@6abb4cd
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Fixed XML documentation tags for CoreFx.Private.TestUtilities

* Fixed XML documentation tags for System.Diagnostics.Process

* Fixed XML documentation tags for System.ComponentModel.Composition

* Fixed XML documentation tags for System.ComponentModel.Primitives

* Fixed XML documentation tags for System.ComponentModel.TypeConverter

* Fixed XML documentation tags for System.Data.Common

* Fixed XML documentation tags for System.Data.SqlClient

* Fixed XML documentation tags for System.Diagnostics.PerformanceCounter

* Fixed XML documentation tags for System.Diagnostics.StackTrace

* Fixed XML documentation for System.Diagnostics.TraceSource

* Fixed XML documentation for System.IO.Compression.ZipFile

* Fixed XML documentation for System.IO.Compression

* Fixed XMl documentation reference according to review notes

* Fixed XML documentation tags for System.IO.MemoryMappedFiles

* Fixed XML documentation tags for System.IO.Pipes

* Fixed XML documentation tag for OSX interop in System.Diagnostics.Process

* Fixed XML documentation tags for CoreFx.Private.TestUtilities for Unix

* Fixed XML documentation tags for System.Linq.Expressions

* Fixed XML documentation for System.Linq.Parallel

* Fixed XML documentationt ags for System.Linq

* Fixed XML documentation tags for System.Management

* Fixed XMl documentation tags for System.Net.Http (left CS1573)

* Fixed XMl documentation tags for System.Net.Mail

* Fixed XML documentation tags for System.Net.NameResolution

* Fixed XML documentation tags for System.Net.Primitives - added T prefix for Socket as Primitives do not reference System.Net.Sockets

* Fixed XML documentation tags for System.Net.Sockets

* Fixed XML documentation tags for Unix interop files

* Fixed XML documentation tags for System.Net.Http (Unix)

* Fixed XML documentation tags for PlatformDetection.Unix.cs according to review notes

* Fixed XML documentation tags for OSX interop

* Ignore CS1574 for System.Linq as there is no ConcatIterator{TSource}.ToList for uap.

* Fixed XML documentation tags for FreeBSD interop

* Fixed XML documentation tags for System.Net.WebSockets

* Fixed XMLm documentation tags for System.Transactions.Local

* Fixed XML documentation for System.Security.Principal.Windows

* Fixed XML documentation for System.Drawing.Common

* Fixed XML documentation for System.Net.NetworkInformation

* Fixed XML documentation tags for System.Private.XML (left CS1589)

* Fixed XML documentation tags for System.Security.Cryptography

* Fixed XML documentation for System.Runtime.WindowsRuntime

* Fixed XML documentation tags for System.Security.Cryptography.Xml

* Fixed XML documentation tags for System.Security.Cryptography.Primitives
CS3016 was added by mistake as part of dotnet/corefx#32934 so I removed it.

* Fixed XML documentation tags for System.Linq: added M to ToList method as it is not accessible by uap builds.

* Fixed XML documentation tags for System.IO.FileSystem

* Fixed XML documentation tags for System.Security.Cryptography.*

* Fixed XML documentation for System.IO.Ports

* Fixed XML documentation tags for System.Private.Reflection.Metadata.Ecma335

* Fixed XML documentation tags for System.Windows.Extensions

* Fixed XMl documentation tags for System.Console

* Fixed XML documentation for System.IO.FileSystem.DriveInfo

* Fixed XML documentation tags for System.Runtime.Extensions

* Fixed XML documentation tags for System.Drawing.Primitives.
Left CS1589 as there is no 'doc\KnownColor.uex' file.

* Fixed XMl documentation for System.Runtime.WindowsRuntime.
Had to add M prefix to 'Windows.Foundation.IAsyncAction' as Windows.Foundation is not accessible at compilation time.

* Fixed XML documentation tags for System.Private.Xml

* Fixed XML documentation tags for System.Private.Reflection.Metadata.Ecma335
Had to add a prefixes to: 'T:System.Collections.Immutable' and 'M:Enumerable.ToArray{TSource}' as they are not available for uap at compilation time.

* Fixed XML documentation tags for System.Net.WebSockets.WebSocketProtocol

* Fixed XML documentation tags for System.Net.WebSockets.WebSocketProtocol

* XML documentation tags fixes: changes after review.


Commit migrated from dotnet/corefx@f7539b7
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.

7 participants