fix: prevent broken doc links from bare URLs in flag descriptions#870
Conversation
Reverts the backtick approach from #857 because pflag.UnquoteUsage treats backticks as value placeholder names, which caused --http-proxy to show the URL as its type and stripped backticks from the description. Instead, keep single quotes in the pflag usage string (for --help terminal output) and convert single-quoted URLs to backtick-wrapped inline code in the Mintlify doc generator. This prevents Mintlify from rendering the URL as a broken clickable link.
Reverts the backtick approach from #857 because pflag.UnquoteUsage treats backticks as value placeholder names, which caused --http-proxy to show the URL as its type and stripped backticks from the description. Instead, keep single quotes in the pflag usage string (for --help terminal output) and convert single-quoted URLs to backtick-wrapped inline code in the Mintlify doc generator. This prevents Mintlify from rendering the URL as a broken clickable link. Also standardize URL handling in flag descriptions: - Example URLs: single-quote them (doc generator wraps in backticks) - Real links: use markdown [text](url) syntax (rendered as clickable) - docs.kosli.com URLs: bare (auto-linkified by existing generator)
|
Claude finished @dangrondahl's task in 2m 0s —— View job PR Review: fix: prevent broken doc links from bare URLs in flag descriptions
Static AnalysisAll clear — ReviewOverall: Clean, well-structured fix. The approach of using single quotes as a convention for example URLs (converted to backtick inline code by the doc generator) is a good design choice — it avoids the Positives:
One observation (non-blocking): Re: the reviewer thread on No bugs, security issues, or correctness problems found. This is a solid fix that correctly addresses the |
Summary
pflag.UnquoteUsagetreats backticks as value placeholder names, which broke--http-proxy(showed URL as type, stripped backticks from description)singleQuotedURLPatternto the Mintlify doc generator: single-quoted URLs in flag descriptions are rendered as backtick-wrapped inline code in markdown output'http://proxy-server-ip:proxy-port'(generator wraps in backticks)[Bitbucket auth](https://...)(clickable in docs)linkifyKosliDocsURLs)bbPasswordFlag,bbAccessTokenFlag,excludeRegexFlagto markdown linksazureOrgUrlFlagfrom double-quotes to single-quotesCloses kosli-dev/docs#105
Test plan
make docs CMD="assert pullrequest bitbucket"— Bitbucket URLs render as clickable markdown linksmake docs CMD="attest snyk"—--http-proxyshowsstringtype and URL in backticksmake docs CMD="snapshot lambda"— RE2 syntax URL renders as clickable linkmake docs CMD="assert pullrequest azure"— Azure example URL in backticksinternal/docgenandcmd/koslidocs tests pass