This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add feature: no-metadata-doc
which removes doc from metadata and full-metadata
which build metadata with all doc
#10493
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
A3-in_progress
Pull request is in progress. No review needed at this stage.
label
Dec 15, 2021
github-actions
bot
added
A0-please_review
Pull request needs code review.
and removed
A3-in_progress
Pull request is in progress. No review needed at this stage.
labels
Dec 16, 2021
gui1117
added
B3-apinoteworthy
C1-low
PR touches the given topic and has a low impact on builders.
D5-nicetohaveaudit ⚠️
PR contains trivial changes to logic that should be properly reviewed.
labels
Dec 16, 2021
gui1117
changed the title
Add feature:
Add feature: Dec 16, 2021
no-metadata-doc
which removes doc from metadatano-metadata-doc
which removes doc from metadata and full-metadata
which build metadata with all doc
shawntabrizi
approved these changes
Jan 12, 2022
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.
makes sense to me
sorpaas
approved these changes
Jan 12, 2022
dvdplm
approved these changes
Jan 12, 2022
kianenigma
approved these changes
Jan 12, 2022
kianenigma
reviewed
Jan 12, 2022
@@ -137,6 +137,8 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream { | |||
let count = COUNTER.with(|counter| counter.borrow_mut().inc()); | |||
let macro_ident = syn::Ident::new(&format!("__is_call_part_defined_{}", count), span); | |||
|
|||
let capture_docs = if cfg!(feature = "no-metadata-docs") { "never" } else { "always" }; |
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.
would have liked a test that would fail if the rust team decided to change these two pairs to Never
and Always
, but I guess that's extremely unlikely at this point.
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 is scale-info crate, I think if they do such change, they will do compile-time error for invalid input
bkchr
approved these changes
Jan 17, 2022
grishasobol
pushed a commit
to gear-tech/substrate
that referenced
this pull request
Mar 28, 2022
…ull-metadata` which build metadata with all doc (paritytech#10493) * add features to remove or add doc * fmt * add test for event/error/call * fmt
ark0f
pushed a commit
to gear-tech/substrate
that referenced
this pull request
Feb 27, 2023
…ull-metadata` which build metadata with all doc (paritytech#10493) * add features to remove or add doc * fmt * add test for event/error/call * fmt
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
A0-please_review
Pull request needs code review.
C1-low
PR touches the given topic and has a low impact on builders.
D5-nicetohaveaudit ⚠️
PR contains trivial changes to logic that should be properly reviewed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #9235
Currently the metadata contains some doc for some types.
This PR add 2 new features:
no-metadata-docs
which most docs from types. and docs from storage and constant. Note: this doesn't remove docs from other types which definescale_info(capture_doc = "always")
if some other types make use of such attribute, their crate should provide a feature to remove their doc as well. (in substrate I'm not aware of other types always capturing docs).full-metadata-docs
which will add the doc for most types. It simply activate the featurescale_info/docs
which enables docs on types by default. So all types that end up in the metadata will have their documentation.Note: this PR is not a breaking change, current behavior is still the default behavior.
TODO: