-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[Rust] Generated code produces warnings about snake case / camel case #5053
Comments
Since FlatBuffers started with C++, it was assumed that schemas would be written in snake_case for fields (which corresponds to most C++ style guides), and then we added ways to convert those to various camels for Java/C# etc. But yes, we don't enforce this, and we don't do the reverse if someone writes their schemas in a camel case. Maybe we should. |
@andygrove You can see here that we already emit these directives in some cases: flatbuffers/tests/monster_test_generated.rs Line 1252 in 980a6d6
Would you be able to point out where else the directives should be emitted? Thanks! |
Also note the FlatBuffers style guide says things like field names should already be snake_case: https://google.github.io/flatbuffers/flatbuffers_guide_writing_schema.html (under "style guide"). Which identifiers have the wrong case? |
I generated the IPC code after installing the flatbuffers release available via conda but still had to manually modify the code to make it compile due to these issues with flatbuffers: google/flatbuffers#5052 google/flatbuffers#5053 google/flatbuffers#5054 I think this is the best we can do for now. Author: Andy Grove <[email protected]> Closes #4021 from andygrove/rust-ipc and squashes the following commits: 7a549be <Andy Grove> encode field data type ab769bb <Andy Grove> delete file a81bee9 <Andy Grove> fix CI 1bbc4a7 <Andy Grove> Update README 83f3b4c <Andy Grove> Add generated IPC code
This issue has been automatically marked as stale because it has not had activity for 6 months. It will be closed if no further activity occurs. Thank you for your contributions. |
I generated the IPC code after installing the flatbuffers release available via conda but still had to manually modify the code to make it compile due to these issues with flatbuffers: google/flatbuffers#5052 google/flatbuffers#5053 google/flatbuffers#5054 I think this is the best we can do for now. Author: Andy Grove <[email protected]> Closes #4021 from andygrove/rust-ipc and squashes the following commits: 7a549be9e <Andy Grove> encode field data type ab769bba5 <Andy Grove> delete file a81bee9b3 <Andy Grove> fix CI 1bbc4a76b <Andy Grove> Update README 83f3b4c06 <Andy Grove> Add generated IPC code
Language: Rust
OS: Ubuntu 16.04
GCC: 5.4.0
Because flatbuffers files are intended for use across multiple languages, there is no guarantee that the generated code will use Rust style snake case etc, leading to compiler warnings.
It would be good to have the option of either generating idiomatic Rust code, or generating these directives to disable the warnings:
The text was updated successfully, but these errors were encountered: