Repository navigation
Conversation
A method without a comment of its own counts as documented when the method it aliases, or the method it overrides, is documented (MethodAttr#documented?). But `rdoc -C1` only parsed the method's own (empty) comment when checking parameters, so it reported every parameter of such a method as undocumented. Follow the same chain as #documented? (is_alias_for, then see) to the first method with a comment, so aliases of aliases and overrides several levels down are covered too. Fixes ruby#1567
Documentation previewCommit: |
This branch has not been deployed
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.
Fixes #1567.
A method without a comment of its own counts as documented when the method it aliases, or the method it overrides, is documented (
MethodAttr#documented?followsis_alias_forand thensee). ButStats#undoc_paramsparsed only the method's own, empty comment. Sordoc -C1listed every parameter of such a method as undocumented, even when the original documents all of them.undoc_paramsnow takes the comment from the first method with one, following the sameis_alias_for/seechain asdocumented?all the way up, not just one level (the question raised in the review of #1780). That covers aliases of aliases and overrides several classes down. A guard stops the walk if the chain loops back on itself. A method that has its own comment is still checked against that comment.With the example from the issue (plus an alias of an alias),
rdoc -C1now reportsParameters: 8 (0 undocumented)instead of 6 undocumented, and undocumented overrides of a documented superclass method are no longer flagged either, matching whatrdoc -Calready counts as documented. Only the coverage report changes.