30 lines
1.1 KiB
YAML
30 lines
1.1 KiB
YAML
# AGENTS.md: "Comments explain why, not what the code already says.
|
|
# No migration history, phase names or issue narration in code."
|
|
extends: existence
|
|
message: "Avoid migration or plan narration ('%s') in code comments. Explain what the code does or why."
|
|
level: warning
|
|
scope: comment.go
|
|
ignorecase: true
|
|
nonword: true
|
|
tokens:
|
|
- '\b(?:phase|wave|slice|sprint)\s+\d+\b'
|
|
- '\bepic\s+#\d+\b'
|
|
- '\b(?:formerly|previously)\s+(?:called|named|known as)\b'
|
|
- '\b(?:migrated|moved|extracted|ported)\s+from\b'
|
|
|
|
tests:
|
|
- name: flags migration narration in Go comments
|
|
format: go
|
|
input: |
|
|
// Phase 2 moved from internal/legacy.
|
|
package demo
|
|
want: |
|
|
1:4:Archie.NoMigrationNarration:Avoid migration or plan narration ('Phase 2') in code comments. Explain what the code does or why.
|
|
1:12:Archie.NoMigrationNarration:Avoid migration or plan narration ('moved from') in code comments. Explain what the code does or why.
|
|
- name: allows normal rationale comments
|
|
format: go
|
|
input: |
|
|
// Verify the HMAC before parsing so malformed payloads cannot trigger work.
|
|
package demo
|
|
want: ""
|