redline
MediumAI tellschangelog-comment

Change-log comment

Change-log comment. This comment narrates the edit (// Added). Git already records what changed; the comment will be wrong after the next edit.

This is how the comment reads inline, under the flagged line.

Why it matters

Comments like // Added retry or // now uses the new client describe the diff, not the code. They are true for one commit and misleading forever after.

What to do

Delete it, or rewrite it to say why the code is the way it is. Put the history in the commit message.

Examples

Flagged
// Updated to use the new retry helper
await withRetry(send);
Better
// The upstream drops the first request after idle, so retry once.
await withRetry(send);

What it catches

It reads a pattern on each line, aware of strings and comments. Languages: Any file. Scope: All files. These cases are the rule's own tests: the first set must be flagged and the second must not.

Flagged

// Added caching for speed
const c = new Map();
src/app.py
# Fixed the bug with empty lists
x = 1
// now uses the shared client

Left alone

// Cache by id: lookups repeat within one request.
const c = new Map();
const label = "Added";

Research

Comments that narrate the edit or its history ("Added retry", "now uses X", "previously"). They are true for one commit and wrong after the next, and git already holds the history.

Turn it off or change it

In a config file for the CLI, or in the API's rules field:

{
  "rules": {
    "disable": [
      "changelog-comment"
    ],
    "severity": {
      "changelog-comment": "low"
    }
  }
}

Read the source or report a false positive.