Warn when :nodoc: appears on standalone line #1576
Closed
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.
I misused
:nodoc:and spent time debugging before finding my error. This patch adds a warning for others who might do the same.The problem:
I expected only the constant to be hidden. Instead,
visible_methodalso disappeared from my documentation.The documentation says
:nodoc:should be appended inline. This works correctly:Since the standalone form is accepted silently but produces surprising results, this patch emits a warning when the pattern is detected.
I am glad to adjust the implementation or wording. If this does not fit RDoc's direction, please close it.
This issue includes creative contributions from Claude (Anthropic).