Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(svm): format docstrings #853

Merged
merged 2 commits into from
Jan 23, 2025
Merged

Conversation

Reinis-FRP
Copy link
Contributor

Anchor IDL generates docs from lines starting with tripple-slashes (///). Some of comments had these unnecessarily causing the IDL docs including information that is not specific to a given instruction or account. This fixes by formatting these lines as regular comments starting with double-slash (//).

Signed-off-by: Reinis Martinsons <[email protected]>
@@ -40,28 +40,28 @@ pub struct BridgeTokensToHubPool<'info> {
pub token_messenger_minter_sender_authority: UncheckedAccount<'info>,

/// CHECK: MessageTransmitter is checked in CCTP. Seeds must be \["message_transmitter"\] (CCTP Message Transmitter
/// program).
// program).
Copy link
Contributor

Choose a reason for hiding this comment

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

Turning these into double slashes doesn't remove them from docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it should remove them from the docs, aren't they?

Copy link
Contributor

@md0x md0x Jan 10, 2025

Choose a reason for hiding this comment

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

Okay, yes, before your change, Anchor was adding program). to the documentation.
Now, it doesn’t add documentation for this account (expected behavior).

Before your fix:

        {
          "name": "message_transmitter",
          "docs": [
            "program)."
          ],
          "writable": true
        },

After fix:

        {
          "name": "message_transmitter",
          "writable": true
        },

All good!

md0x
md0x previously approved these changes Jan 10, 2025
chrismaree
chrismaree previously approved these changes Jan 10, 2025
@Reinis-FRP Reinis-FRP dismissed stale reviews from chrismaree and md0x via e81d473 January 23, 2025 16:23
@Reinis-FRP Reinis-FRP merged commit 27ecada into master Jan 23, 2025
9 checks passed
@Reinis-FRP Reinis-FRP deleted the reinis-frp/format-docstrings branch January 23, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants