Loading
chore: sharpen heredoc guidance in MR review instructions
Summary
Rule 19 (Command documentation → Examples) already told authors not to
hand-format multi-line strings, but it was thin enough that both a human
reviewer and Duo missed the same anti-pattern in
!3731: a Long field
built from "...\n" + "...\n" + ... concatenation, which produces
literal, un-reflowable line breaks in --help output and generated docs.
Compare:
- !3731 (comment 3727240023) — Duo's suggestion caught only the missing example comments (rule 17), not the underlying heredoc violation.
- !3731 (comment 3727312824) — the more useful catch, which reworked the field with
heredoc.Docf.
This MR expands rule 19 to:
- Show the hand-concatenated anti-pattern concretely, so it's recognizable even when it "looks fine" in source.
- Explain how to handle a literal backtick inside heredoc content (
heredoc.Docfwith a%[1]splaceholder), instead of splicing raw and interpreted string literals together. - Point to
internal/commands/mr/note/mr_note_create.goas the canonical reference.
Test plan
-
.gitlab/duo/mr-review-instructions.yamlstill parses as valid YAML. - Docs-only change; no Go code touched.