-
Notifications
You must be signed in to change notification settings - Fork 114
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
Generate an Erlang module from a CSV of message/code mappings. #63
Conversation
This replaces the manual maintenance of the mappings in riak_pb_codec and opens the door for generating the appropriate code for the same information in other languages. This also updates the encoding_test to cover the entire message code space, since we now have gaps in it. NOTE: I hacked the 'preprocess' callback in the plugin to do the generation, instead of more appropriately calling it at the beginning of the compile phase. This deserves more investigation, as I'm probably doing it wrong.
|| Line <- Lines]. | ||
|
||
generate_module(Name, Tuples) -> | ||
%% TODO: Add generated doc comment at the top |
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.
TODO?
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.
Woops, willfix
+1, nice work as always @seancribbs might cause a deps issue after merging as |
also, all tests pass. Not riak_tested.
|
one more thing, just giving a heads up for https://github.com/basho/riak_repl_pb_api, I think it should be fine. |
@metadave One more look, please? I added some doc comments for the generated module. |
Confirmed that this comment appeared at the top of riak_pb_messages.erl:
And test results look good:
|
👍 |
Thanks @metadave! |
Generate an Erlang module from a CSV of message/code mappings.
This replaces the manual maintenance of the mappings in
riak_pb_codec
and opens the door for generating the appropriate code for the same information in other languages.This also updates the encoding_test to cover the entire message code space, since we now have gaps in it.
NOTE: I hacked the
preprocess
callback in the plugin to do the generation, instead of more appropriately calling it at the beginning of the compile phase. This deserves more investigation, as I'm probably doing it wrong.