Repository navigation
Skip blank doc crefs and refuse null doc tags before writing [patch] - #211
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
A whitespace InheritDocCref, a blank SeeAlso entry and a blank Exceptions name were written as cref="" (CS1584). They are now skipped, and a whitespace InheritDocCref writes a bare <inheritdoc/>. A null SeeAlso entry or exception name is skipped the same way. A null DocTag, or a param/typeparam with a null name, is refused by ValidateAttributes before anything is written, rather than throwing NullReferenceException with the class half written. Fixes #208 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW2P5xiJJTm9Z4wJwcH
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



DocCommentwrote a whitespaceInheritDocCref, a blankSeeAlsoentry and a blankExceptions[i].Nameascref=""orcref=" ". The compiler reports each of these as CS1584/CS1658. A nullSeeAlsoentry orDocTagthrew aNullReferenceExceptionpartway through writing, which left the class without that member.Changes
InheritDocCrefwrites a bare<inheritdoc/>, the same as an empty one.SeeAlsoentries are skipped (throughTemplateRendering.NonBlank), and so areExceptionsentries whoseNameis null, empty or whitespace.IsEmptycounts only the entries that get written.ValidateAttributesrefuses a nullDocTaginTypeParams,ParamsorExceptions, and aparamortypeparamwith a nullName, by throwingArgumentExceptionbefore anything is written. This matches Refuse a null parameter, member or nested type before writing [patch] #199. A container'sValidatealready calls it, so the class is never left half written.Tests
cref=""lines, and the non-blank entries are kept.IsEmptyand writes nothing.SeeAlsoentry inside a class renders the whole class.WriteToand throughAddClass.mainand pass with the fix. Full suite: 382 passed, 0 failed.Fixes #208
Generated by Claude Code