Ignore backticks in documentation abstracts#936
Conversation
ahoppen
left a comment
There was a problem hiding this comment.
Does this cause issues when you have a code block that contains a period and would thus recognize it as a multi-sentence first paragraph?
Eg.
/// The same as `Foo.foo()`.
func bar() {}
If not, could you add a test case for that?
|
We can assume that a sentence-ending period will never occur inside an inline code block, so I wonder if we should simply remove the content within backticks before doing this check, instead of removing just the backticks. Since the The only thing I'm not sure about is how the linguistic tagger would handle a space before the period, because I'm assuming that removing the would leave us with |
The linguistic tagger doesn't do a great job recognizing backticks as opening vs. closing quotes, so some valid abstracts that contain backticks were being rejected by the `BeginDocumentationCommentWithOneLineSummary` rule. This change removes any backtick- quoted sections from abstracts before processing, since they aren't important to that judgment.
92ddafd to
3df47cd
Compare
|
I would have sworn I updated this commit before opening the PR, but here we are. @allevato, I switched to use a |
allevato
left a comment
There was a problem hiding this comment.
This turned out super elegant. Thanks for the fix!
The linguistic tagger doesn't do a great job recognizing backticks as opening vs. closing quotes, so some valid abstracts that contain backticks were being rejected by the
BeginDocumentationCommentWithOneLineSummaryrule. This change removes anyInlineCodenodes from the abstract paragraph before processing, since they aren't important to that judgment.Fixes #924.