-
Notifications
You must be signed in to change notification settings - Fork 258
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
Opt out from default derives and attributes #925
Opt out from default derives and attributes #925
Conversation
A couple more naming nits for consistency with DerivesForType etc but otherwise looks great! |
cli/src/commands/codegen.rs
Outdated
/// Additional derives for a given type. | ||
/// | ||
/// Example `--derive-for-type my_module::my_type=serde::Serialize`. | ||
#[clap(long = "derive-for-type", value_parser = derive_for_type_parser)] | ||
derives_for_type: Vec<(String, String)>, | ||
/// Additional attributes for a given type. | ||
/// | ||
/// Example `--attribute-type my_module::my_type=#[allow(clippy::all)]`. |
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.
/// Example `--attribute-type my_module::my_type=#[allow(clippy::all)]`. | |
/// Example `--attributes-for-type my_module::my_type=#[allow(clippy::all)]`. |
Typo on docs.
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.
Good spot; thank you!
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.
fixed, thanks!
This PR aims at giving the
subxt
user full control over derived traits and attributes for generated types. Until now, every new type was given:This in particular meant that
subxt
was assumed to be available when working with justsubxt_macro
crate. In order to allow some flexibility, we add (both to the macro and CLI):