Skip to content

style(bindings): standardize doc links to monospaced format#5791

Open
mvanhorn wants to merge 3 commits intoaws:mainfrom
mvanhorn:fix-doc-link-format
Open

style(bindings): standardize doc links to monospaced format#5791
mvanhorn wants to merge 3 commits intoaws:mainfrom
mvanhorn:fix-doc-link-format

Conversation

@mvanhorn
Copy link
Copy Markdown

Summary

Standardizes all Rust doc comment links from [s2n_xxx] to [`s2n_xxx`] across 14 files in the Rust bindings, and updates grep_simple_mistakes.sh to match.

Why this matters

Doc links were inconsistently formatted (#5095). The monospaced backtick format ([`s2n_xxx`]) matches the convention used by tokio, the rustdoc book, and most Rust ecosystem crates.

Changes

  • 200 link replacements across 14 .rs files in bindings/rust/extended/s2n-tls/src/
  • Updated codebuild/bin/grep_simple_mistakes.sh to recognize the new format and print updated guidance

Only doc comment lines (///) were modified. No code changes.

Testing

Verified with git diff that no non-doc-comment lines were touched. The [s2n_security_policy_selection] array type in lib.rs was correctly left untouched.

Fixes #5095

This contribution was developed with AI assistance (Claude Code).

Replace [s2n_xxx] with [`s2n_xxx`] in all Rust doc comments to render
links in monospaced font, matching tokio and rustdoc conventions.

Also updates grep_simple_mistakes.sh to recognize the new format.

Fixes aws#5095
@mvanhorn mvanhorn requested a review from dougch as a code owner March 20, 2026 06:47
@jmayclin
Copy link
Copy Markdown
Contributor

jmayclin commented Mar 20, 2026

Also, I personally consider style to be a valid conventional commit heading. Let me check with the team about changing that CI job.

CALLS=`grep -ro "$api(" $BINDINGS | wc -l`
if [ "$CALLS" == 0 ]; then continue; fi
DOCS=`grep -ro "///.* \[$api\]" $BINDINGS | wc -l`
DOCS=`grep -ro "///.* \[\`\?$api\`\?\]" $BINDINGS | wc -l`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I understand correctly, this regex would match either [`s2n_api`] or [s2n_api]? If we're enforcing the monospaced format, we should probably remove \?.

printf "\e[1;34mRust bindings are missing documentation links:\e[0m "
printf "Where possible, the Rust bindings should link to existing documentation. "
printf "Links can be written like \"[s2n_connection_new]\".\n"
printf "Links can be written like \"[\\\`s2n_connection_new\\\`]\".\n"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We don't need an explicit \ in the printf output, right? Maybe just do

\"[\`s2n_connection_new\`]\"

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.

bindings: standardize link format

3 participants