-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
*: Use auto_doc_cfg
instead of doc(cfg)
attributes
#2983
*: Use auto_doc_cfg
instead of doc(cfg)
attributes
#2983
Conversation
Could you add the |
I'm quite unsure about the changelogs here. We probably have to add an entry to every crate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need changelog entries for this.
Can you please:
- Investigate, whether we can now remove the existing
doc(cfg(...)
uses - Post some screenshots of what the docs now look like compared to before
In reading about doc_auto_cfg
, I've seen multiple uses of doc_cfg_hide
feature as well which I think is used to fine-tune the output. Can you please spot-check some of our more complex cfg
uses (e.g. in the root libp2p
crate) and verify that it doesn't look horrendous or try to fix it if it does?
Thanks for working on this 😊
"Looking horrendous" is a quite difficult standard. If we remove all custom doc(cfg( we get more complicated flags, but they are also more representative of the truth. So I think it's hard to judge here. I would be in favor of just abolishing You requested some screenshots, so here we go: Just
|
Okay, thanks a lot for this work! Given the screenshots, I am in favor of removing all |
Anything to do for me? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, just two more comments 😊
Done 🙂 |
auto_doc_cfg
instead of doc(cfg)
attributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!
@mxinden Any objections in merging this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Soo do I need to make any changes or not? 😐 |
Co-authored-by: João Oliveira <hello@jxs.pt>
Co-authored-by: João Oliveira <hello@jxs.pt>
src/lib.rs
Outdated
@@ -182,20 +169,16 @@ pub mod tcp { | |||
pub use libp2p_tcp::*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if that was already discussed, but could you explain again why the #[cfg_attr(docsrs, doc(cfg(feature = "..")))]
flag is not removed for the crates that have extra features (like tcp/ dns / ..)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It hasn't been discussed, well spotted!
I think those should be removed too, yes! Line 166 here for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be in favor. Especially with tokio, it is important that the socket is polled on a thread with an active reactor. Can you add put the transport into a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments but otherwise ready I believe!
Thank you!
src/lib.rs
Outdated
@@ -182,20 +169,16 @@ pub mod tcp { | |||
pub use libp2p_tcp::*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It hasn't been discussed, well spotted!
I think those should be removed too, yes! Line 166 here for example.
done in f7c8ab5 |
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor comments, otherwise LGTM!
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks @umgefahren and @thomaseizinger for the work.
I suggest we tackle libp2p/test-plans#59 before merging here. Otherwise good to go from my end.
Includes necessary package metadata to improve documentation on docs.rs (shows which items are behind a cfg). Read more on: libp2p#2983 Pull-Request: libp2p#4599.
Co-authored-by: João Oliveira <hello@jxs.pt> Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Description
In developing #2975 we discovered that doc_cfg_auto is ready for use by our crate. Therefore we are using it to document items behind feature flags.
Links to any relevant issues
This closes #2950.
Open Questions
Change checklist