Coder - alter requirements about no blank line following an inline comment

Created on 18 December 2013, almost 11 years ago
Updated 15 September 2023, about 1 year ago

There is a sniff that says that "There must be no blank line following an inline comment". I can't find any such requirement in our coding standards, so I assume it's a custom addition here and open to discussion. I would like to propose that it is overly restrictive--that there are valid use cases for an inline comment with a blank line beneath it. For example, suppose I want to leave a @todo to add a block of code in the future:

do_something();
 
// @todo This would be a good place to add logging.
 
do_something_else();

The text format here strips the line breaks from my code sample, but supposing that the @todo is not directly related to the do_something_else() function, it seems misleading to put it right above it as if it described it. Doubtless numerous other cases can be imagined which I will not belabor here.

I propose removing the sniff. Patch to follow.

πŸ“Œ Task
Status

Postponed

Version

2.1

Component

Coder Sniffer

Created by

πŸ‡ΊπŸ‡ΈUnited States traviscarden

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024