Skip to content

docs: Add [package.metadata.docs.rs] and doc_auto_cfg - #350

Merged
joncinque merged 3 commits into
anza-xyz:masterfrom
joncinque:feats-doc
Oct 1, 2025
Merged

joncinque merged 3 commits into
anza-xyz:masterfrom
joncinque:feats-doc

Conversation

@joncinque

Copy link
Copy Markdown
Collaborator

Problem

A few packages aren't configured properly for the docs.rs build to handle features.

Summary of changes

Add [package.metadata.docs.rs] to Cargo.toml files that don't have it, and #![cfg_attr(docsrs, feature(doc_auto_cfg))] to lib.rs files that don't have it either.

Also, add a CI step to make sure that all Cargo.toml and lib.rs files have the proper annotations.

#### Problem

A few packages aren't configured properly for the docs.rs build to
handle features.

#### Summary of changes

Add `[package.metadata.docs.rs]` to Cargo.toml files that don't have it,
and `#![cfg_attr(docsrs, feature(doc_auto_cfg))]` to lib.rs files that
don't have it either.

Also, add a CI step to make sure that all Cargo.toml and lib.rs files
have the proper annotations.
@joncinque
joncinque requested a review from yihau September 30, 2025 11:59
@github-actions

Copy link
Copy Markdown
Contributor

If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client @solana/sysvars (example)
Thank you for keeping the JavaScript clients in sync with the Rust clients.

@github-actions

Copy link
Copy Markdown
Contributor

If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client @solana/sysvars (example)
Thank you for keeping the JavaScript clients in sync with the Rust clients.

yihau
yihau previously approved these changes Sep 30, 2025

@yihau yihau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔥

(nit: maybe we can add ^ to the regex in scripts/check-doc-features.sh or comments can trick the checker haha)

@joncinque

Copy link
Copy Markdown
Collaborator Author

Great idea, done!

@github-actions

Copy link
Copy Markdown
Contributor

If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client @solana/sysvars (example)
Thank you for keeping the JavaScript clients in sync with the Rust clients.

@joncinque
joncinque requested a review from yihau September 30, 2025 16:58

@yihau yihau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🚀

@joncinque
joncinque merged commit 5f52f96 into anza-xyz:master Oct 1, 2025
@joncinque
joncinque deleted the feats-doc branch October 1, 2025 15:39
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