fix: include XML documentation files in NuGet packages#5565
Conversation
Enable GenerateDocumentationFile in Library.props so XML doc files are included in NuGet packages, providing IntelliSense documentation for consumers of TUnit libraries. Closes #5563
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Code Review
This is a clean, minimal fix for issue #5563. The approach — enabling GenerateDocumentationFile globally in Library.props while suppressing documentation-related warnings — is exactly right for a project of this scale that has partial XML doc coverage. Here are a few observations:
What's good
- Correct placement.
Library.propsis the right file; all 15+ packable library projects import it, so the XML files will be generated and automatically included in NuGet packages by SDK convention without any additional<None>packaging entries. $(NoWarn)accumulation is correct. Using$(NoWarn);...preserves existing suppressed codes (NU1507;NU1903;CS9107) rather than overwriting them.- Reasonable warning list. All 10 suppressed codes (
CS1591,CS1570,CS1572,CS1573,CS1574,CS1584,CS1587,CS1658,CS1734,CS0419) are XML-documentation-specific — nothing unrelated is being silenced.
Minor observations
-
CS1570is fairly broad. It covers malformed XML in doc comments, which includes genuinely broken tags. It is suppressed globally here, so any new malformed comment won't produce a diagnostic. This is acceptable givenTreatWarningsAsErrorsis on and full doc coverage isn't the goal yet, but it's worth tracking as a future cleanup target. -
Non-packable projects also get
GenerateDocumentationFile=true. Projects likeTUnit.Engine(which hasIsPackablenot explicitly set, so it defaults to the SDK'sIsTestingPlatformApplication-driven logic) and potentially others will also generate XML files on build. These files are harmless and won't be packed if the project isn't packable, but it does add minor I/O to every build. ACondition="'$(IsPackable)' != 'false'"guard onGenerateDocumentationFilewould prevent generating docs for internal-only projects, though this is a very minor concern. -
Analyzer/source-generator projects are unaffected. They use
Roslyn.propsrather thanLibrary.props, so their build is unchanged — good. -
No snapshot test impact expected. This change is purely in MSBuild configuration and doesn't touch source generation or public API surface, so no
.verified.txtfiles need updating.
Bottom line
The change is correct and complete for its stated purpose. The suppressed warning list is appropriately scoped. The only meaningful follow-up consideration would be eventually removing suppressions incrementally as XML docs are added (CS1591 being the highest-value one to eventually enforce), but that's a separate, larger effort — not a blocker for this PR.
Updated [TUnit](https://github.com/thomhurst/TUnit) from 1.33.0 to 1.35.2. <details> <summary>Release notes</summary> _Sourced from [TUnit's releases](https://github.com/thomhurst/TUnit/releases)._ ## 1.35.2 <!-- Release notes generated using configuration in .github/release.yml at v1.35.2 --> ## What's Changed ### Other Changes * fix: restore SourceLink and deterministic builds in published packages by @thomhurst in thomhurst/TUnit#5579 ### Dependencies * chore(deps): update tunit to 1.35.0 by @thomhurst in thomhurst/TUnit#5578 **Full Changelog**: thomhurst/TUnit@v1.35.0...v1.35.2 ## 1.35.0 <!-- Release notes generated using configuration in .github/release.yml at v1.35.0 --> ## What's Changed ### Other Changes * fix: support open generic transitive auto-mocks by @thomhurst in thomhurst/TUnit#5568 * refactor: separate test and lifecycle tracing by @thomhurst in thomhurst/TUnit#5572 * fix: expand nested And/Or expectations in failure messages (#5573) by @thomhurst in thomhurst/TUnit#5577 ### Dependencies * chore(deps): update tunit to 1.34.5 by @thomhurst in thomhurst/TUnit#5566 * chore(deps): bump follow-redirects from 1.15.11 to 1.16.0 in /docs by @dependabot[bot] in thomhurst/TUnit#5538 * chore(deps): update verify to 31.16.0 by @thomhurst in thomhurst/TUnit#5570 * chore(deps): update verify to 31.16.1 by @thomhurst in thomhurst/TUnit#5574 * chore(deps): update gittools/actions action to v4 by @thomhurst in thomhurst/TUnit#5575 **Full Changelog**: thomhurst/TUnit@v1.34.5...v1.35.0 ## 1.34.5 <!-- Release notes generated using configuration in .github/release.yml at v1.34.5 --> ## What's Changed ### Other Changes * fix: cap test output at 1M chars to prevent OOM by @thomhurst in thomhurst/TUnit#5561 * fix: handle explicit interface impl with different return types in mock generator by @thomhurst in thomhurst/TUnit#5564 * fix: include XML documentation files in NuGet packages by @thomhurst in thomhurst/TUnit#5565 ### Dependencies * chore(deps): update tunit to 1.34.0 by @thomhurst in thomhurst/TUnit#5562 **Full Changelog**: thomhurst/TUnit@v1.34.0...v1.34.5 ## 1.34.0 <!-- Release notes generated using configuration in .github/release.yml at v1.34.0 --> ## What's Changed ### Other Changes * refactor: move CorrelatedTUnitLogger to TUnit.Logging.Microsoft and auto-inject handlers by @thomhurst in thomhurst/TUnit#5532 * feat: add Dev Drive setup for Windows in CI workflow by @thomhurst in thomhurst/TUnit#5544 * fix: start session activity before discovery so discovery spans parent correctly by @thomhurst in thomhurst/TUnit#5534 * feat: cross-process test log correlation via OTLP receiver by @thomhurst in thomhurst/TUnit#5533 * refactor: use natural OTEL trace propagation instead of synthetic TraceIds by @thomhurst in thomhurst/TUnit#5557 * fix: route ITestOutput writes through synchronized ConcurrentStringWriter by @thomhurst in thomhurst/TUnit#5558 ### Dependencies * chore(deps): update tunit to 1.33.0 by @thomhurst in thomhurst/TUnit#5527 * chore(deps): update dependency dompurify to v3.4.0 by @thomhurst in thomhurst/TUnit#5537 * chore(deps): update dependency docusaurus-plugin-llms to ^0.3.1 by @thomhurst in thomhurst/TUnit#5541 * chore(deps): update dependency microsoft.sourcelink.github to 10.0.202 by @thomhurst in thomhurst/TUnit#5543 * chore(deps): update dependency microsoft.entityframeworkcore to 10.0.6 by @thomhurst in thomhurst/TUnit#5542 * chore(deps): update dependency microsoft.templateengine.authoring.templateverifier to 10.0.202 by @thomhurst in thomhurst/TUnit#5546 * chore(deps): update dependency microsoft.templateengine.authoring.cli to v10.0.202 by @thomhurst in thomhurst/TUnit#5545 * chore(deps): update dependency system.commandline to 2.0.6 by @thomhurst in thomhurst/TUnit#5547 * chore(deps): update microsoft.aspnetcore to 10.0.6 by @thomhurst in thomhurst/TUnit#5548 * chore(deps): update dependency nuget.protocol to 7.3.1 by @thomhurst in thomhurst/TUnit#5549 * chore(deps): update microsoft.extensions to 10.0.6 by @thomhurst in thomhurst/TUnit#5550 * chore(deps): update dependency dotnet-sdk to v10.0.202 by @thomhurst in thomhurst/TUnit#5551 * chore(deps): update opentelemetry by @thomhurst in thomhurst/TUnit#5552 * chore(deps): update microsoft.extensions to 10.5.0 by @thomhurst in thomhurst/TUnit#5554 **Full Changelog**: thomhurst/TUnit@v1.33.0...v1.34.0 Commits viewable in [compare view](thomhurst/TUnit@v1.33.0...v1.35.2). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Summary
GenerateDocumentationFileinLibrary.propsso all library projects generate XML doc filesTreatWarningsAsErrorsis enabledCloses #5563
Test plan
TUnit.Corebuilds clean with XML doc generation enabledTUnit.Assertionsbuilds cleanTUnit.Enginebuilds cleanTUnit.Core.xmlfile generated in output directory