joomla/joomla-platform — pull request #785 by elkuku (2012-01-23 03:34:02+00:00)
Title: Code style: Single comment sniff

This will "sniff" the single line comments (```//```).
It is based on a document by @elinw: [Comment Rules](https://docs.google.com/document/d/1r7Axwc3EEYJcHtlwfroc4PG7cHt5aBPQqkaRN0CdEVc/edit).

The following rules have been applied:
* Hash comments (```#```) are not allowed.
* The first letter must be preceded by a space. (```//Bad``` -> ```// Good```)
* The first letter must be upper case, unless a sentence spans over multiple lines (```// bad``` -> ```// Good```)
* The comment must not be on the same line as the code. It should instead precede the code it refers to.
* If the comment is surrounded by code, it must be preceded by a blank line.
* If there are more than two single comment lines, those should be converted in a ```/* */``` style comment.

Occasionally the sniff hits commented out code. I have marked those findings with a TODO: remove code.