Skip to content

refactor(pass): extract multi-line Long descriptions to embedded mark down#533

Merged
joe0BAB merged 1 commit into
mainfrom
feat/pass-docs
May 28, 2026
Merged

refactor(pass): extract multi-line Long descriptions to embedded mark down#533
joe0BAB merged 1 commit into
mainfrom
feat/pass-docs

Conversation

@joe0BAB
Copy link
Copy Markdown
Collaborator

@joe0BAB joe0BAB commented May 28, 2026

Matches the existing pattern used for examples (*_example.md, examples.md). Touches the three commands whose Long was a multi-line concatenated string: root, run, and set. Single-line Long fields on get/ls/rm are left inline.

…down

Matches the existing pattern used for examples (`*_example.md`,
`examples.md`). Touches the three commands whose Long was a multi-line
concatenated string: root, `run`, and `set`. Single-line Long fields on
`get`/`ls`/`rm` are left inline.
@joe0BAB joe0BAB marked this pull request as ready for review May 28, 2026 08:10
@joe0BAB joe0BAB merged commit 82c7740 into main May 28, 2026
19 checks passed
@joe0BAB joe0BAB deleted the feat/pass-docs branch May 28, 2026 08:13
Copy link
Copy Markdown

@docker-agent docker-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

Clean mechanical refactor extracting multi-line Long descriptions into embedded .md files, matching the existing *_example.md pattern. All //go:embed paths are correct, embedded content is semantically equivalent to the removed inline strings, and imports are in order. Two minor style notes left as inline comments.

"started and exits non-zero.",
Use: "run -- CMD [ARGS...]",
Short: "Run a command with `se://` environment references resolved.",
Long: strings.Trim(runLong, "\n"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW: Inconsistent whitespace trimming — only newlines stripped, \r and spaces would survive

strings.Trim(runLong, "\n") strips only newline characters from both ends of the embedded string, while command.go uses strings.TrimSpace(rootLong) which also removes carriage-returns, spaces, and tabs.

If run_long.md ever gains a trailing \r (e.g. committed from a Windows editor before git normalises line endings), it will appear verbatim in the Cobra Long help output. Consider using strings.TrimSpace here to match the root command and be robust to accidental whitespace.

"Pass `--force` to overwrite an existing secret. On Linux and Windows the\n" +
"replacement is performed atomically. On macOS the Keychain API requires\n" +
"a delete-then-add sequence.",
Long: strings.Trim(setLong, "\n"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW: Inconsistent whitespace trimming — only newlines stripped, \r and spaces would survive

strings.Trim(setLong, "\n") strips only newline characters from both ends of the embedded string, while command.go uses strings.TrimSpace(rootLong).

Same concern as run.go: a trailing carriage-return or a stray space/tab in set_long.md would survive this trim and appear in the Cobra Long help output. Using strings.TrimSpace consistently across all three call sites would eliminate this fragility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants