There are two cases where an inline comment is allowed without ending punctuation: when the comment ends with a URL, or with a function declaration.

Currently a regex is used for this which is very permissive: if a single non-alphanumeric character appears in the last word of the comment, then the test is skipped. Some examples:

  • // Missing space after "do"
  • // Descend into sub-directory

We also need to add the double colon (:) to the permitted line endings, these are used multiple times in the examples on API documentation and comment standards, here's an example:

/**
 * Example usage:
 * @code
 * mymodule_print('Hello World!');
 * @endcode
 * Text to immediately follow the code block.
 */

This case is currently also skipped because of the too permissive sniffing.

CommentFileSizeAuthor
#2 2567055-1.patch5 KBpfrenssen

Comments

pfrenssen created an issue. See original summary.

pfrenssen’s picture

Status: Active » Needs review
StatusFileSize
new5 KB
klausi’s picture

Status: Needs review » Fixed

Committed, thanks!

  • klausi committed 523b513 on 8.x-2.x authored by pfrenssen
    Issue #2567055 by pfrenssen: Make inline comment sniff more strict with...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.