Skip to content
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 C code without changing message/signal name case #644

Open
timrulebosch opened this issue Jan 17, 2024 · 1 comment
Open

Generate C code without changing message/signal name case #644

timrulebosch opened this issue Jan 17, 2024 · 1 comment

Comments

@timrulebosch
Copy link

We are looking over PR #513 and #255 and would like to propose a different solution. The idea would be to replace the variable snake_name with code_name (or c_name) in the code base, and then modify the object initialization to set that variable appropriately. That would result in a much more concise operation.

Something along these lines:

 def __init__(self, message):
    ...
    self.code_name = self.name if keepdbcnames else camel_to_snake_case(self.name)
    ...

Would anyone have some feedback, before we go to the trouble of developing the PR. Thanks!

@timrulebosch
Copy link
Author

We developed a commit for this that we are using. Based on the experience, I would suggest two changes:

  • rename self.snake_name to self.code_name
  • refactor/rename camel_to_snake_case() to gen_code_name() with additional changes to trigger the desired behaviour - triggered from a global flag (set via cli option).

Aside from the renaming, which is only a suggestion, that results in a compact change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant