-
Notifications
You must be signed in to change notification settings - Fork 74
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
feat: Support for marking "RUST-ATTRIBUTE" (type attribute) #405
Conversation
Great PR :) I have one request. Rather than passing raw rinf:
message:
rust_derive:
SampleFractal: "Default"
NumberInput:
- "Default"
- "extern_crate::ExternTrait" |
I agree, the request is reasonable. But the How about keeping both options at the same time? rinf:
message:
rust_derive:
SampleFractal: "Default"
NumberInput:
- "Default"
- "extern_crate::ExternTrait"
type_attribute:
SampleFractal: "#[derive(Trait)]"
NumberInput:
- "#[serde(rename_all = \"snake_case\")]"
- ... |
There's actually another option, which is the most ideal way in my opinion. It's allowing to write something like: // [RINF:DART-SIGNAL]
// [RINF:RUST-ATTRIBUTE(#[serde(rename_all = "camelCase")])]
message MyMessage {} What do you think? Do you mind orienting your PR this way? |
That's great. |
I tried to implement it using a method that was less logically disruptive to the code. If you want to implement it yourself, just feel free to close the PR or refactor it :) |
protoc
Looks good overall :D I will add documentations and refine some of the code later. Thank you for your effort and patience. |
Changes
Support pass extra args to
protoc
.Why
Sometimes, there is a need to add derives (#401) , if we use
protoc
to generate, we can pass some optional arguments,like
--prost_opt=type_attribute=Helloworld=#[derive(Foo)]
, but in rinf, we can't do the same.This PR allows you to pass extra args to
protoc
and you can configure the extra args inpubspec.yaml
.Usage
pubspec.yaml
.rinf message
FYI, https://github.com/neoeinstein/protoc-gen-prost/tree/main/protoc-gen-prost#options
Before Committing