-
Notifications
You must be signed in to change notification settings - Fork 825
Add automated XML documentation validation test for FSharp.Core .fsi files #18789
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
Conversation
…files Co-authored-by: T-Gro <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now make a dummy change somewhere in FSharp.Core .fsi file that will show how this new test can fail.
I want to see it fail.
E.g. make a XML invalid crossing like this:
/// <sumary>
/// Text
/// <remarks>
/// Text
/// </summary>
/// more text
/// </remarks>
Co-authored-by: T-Gro <[email protected]>
Done! I've introduced an intentional XML documentation error in When I tested the validation, it correctly failed with the error:
The test successfully demonstrates how the XML documentation validation catches malformed XML and provides precise error location information. Commit: c8f0f09 |
Co-authored-by: T-Gro <[email protected]>
✅ No release notes required |
@copilot : Now manually ammend the commit to show me (T-Gro) as the author, not you. |
This PR adds an automated test to validate that all XML documentation comments in FSharp.Core signature files are well-formed and valid XML. The test ensures documentation quality and prevents malformed XML from being introduced.
What this adds
FSharp.Core.UnitTests.XmlDocumentationValidation
that scans all .fsi files in the FSharp.Core directorySystem.Xml
to parse and validate each XML documentation block for well-formednessHow it works
The test extracts XML documentation comments (lines starting with
///
) from each .fsi file, groups them into logical blocks, and validates each block by:XmlDocument.LoadXml()
XmlException
with precise location informationTesting and demonstration
The implementation has been verified to:
The test's effectiveness was demonstrated by temporarily introducing an intentional XML documentation error with crossing tags, which the validation correctly caught with detailed error messages. The error was then reverted to maintain clean code.
This ensures that any future changes to XML documentation in FSharp.Core .fsi files will be automatically validated for correctness, preventing documentation build issues and maintaining high documentation quality standards.
This pull request was created as a result of the following prompt from Copilot chat.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.