Skip to content

ALL-COMM0001 · comment_length

Normalize the longest contiguous implementation comment.

This is a deterministic rule for all languages. Read its implementation.

Consecutive ordinary comment lines form one group, measure chooses what a group’s size is counted in, and the largest group in the file that is not a legal notice is the one measured. Documentation comments belong to the prose rules because their job is to explain a public contract rather than an implementation decision. That raw size is divided by normalization_max and stated as a percentage, so a group at or past the normalization maximum reads as one hundred and everything shorter scales beneath it.

A license is left out because it is not a comment about this code. It is the same words in every file of the project, put there by policy, and the fifteen-line notice one library opens all of its two hundred and six files with made this rule fail every one of them, which tells a reader nothing at all. notice_markers names what a notice opens with, so a project spelling one differently configures it rather than turning the rule off.

The normalization is what makes the number comparable. A raw token count means nothing across two repositories with different comment habits, and a share of an agreed ceiling means the same thing in both. The rule states the share and a project policy decides which share is too much, since a protocol citation and a restated line of code are the same length and worth very different things.

Continue with evidence and references, or open the examples.