Skip to content
Sarj Code Standards

exact-config-comment-restatement

YAML or TOML comment exactly repeats the adjacent scalar assignment

Why

A comment that repeats the key and scalar value adds no information and can drift independently from the configuration it narrates.

Fix

Delete the restatement. If the entry is author-controlled and unclear, clarify its key or section; keep comments only for constraints or rationale absent from the value.

Examples

Before — flagged A YAML string containing a suppression marker retains the real comment diagnostic
config.yaml
payload: |
# sarj-noqa: SARJ306
# Retry count is 3
retry_count: 3
After — preferred A real local exact-code comment retains its waiver
config.yaml
# sarj-noqa: SARJ306
# Retry count is 3
retry_count: 3
Before — flagged A prose comment repeats the assignment
config.toml
# Retry count is 3
retry_count = 3
After — preferred A rationale adds information absent from the assignment
config.toml
# Keep three retries because the upstream API is eventually consistent.
retry_count = 3
Autofix output
config.toml
retry_count = 3

Files

**/*.yaml**/*.yml**/*.toml