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

Style guide for generated code #23

Open
jvliwanag opened this issue Nov 26, 2020 · 3 comments
Open

Style guide for generated code #23

jvliwanag opened this issue Nov 26, 2020 · 3 comments

Comments

@jvliwanag
Copy link
Member

I'm trying to have a go of #22 and finding out it's not a simple. :)

I'm trying to figure out how to best format the generated code, beyond what I specified on #22. In particular, what style guide we can adhere to.

Options I know of are:

Another option is to state that code formatting is outside of this project's scope and just to pass the output over to a separate tool such as purty.

What do you guys think?

@flip111
Copy link
Member

flip111 commented Nov 27, 2020

Maybe just start changing the style bit by bit where needed and allow for configuration to be passed in? That way over time the (total) style can be configured using a configuration file.

@paluh
Copy link
Member

paluh commented Nov 29, 2020

I should probably not comment on this as I'm not really familiar with cst and cst-simple.

@jvliwanag do you think that formatting is going bring a lot of complexity to these libs? If that is the case then from my perspective purty is the way to go (this trivial approach works fine in the case of mui bindings).

@jvliwanag
Copy link
Member Author

@paluh comments of course helpful. :)

Passing the generated code over to purty is indeed tempting. But when using a codegen lib, I'd prefer not to have to pull in an additional dependency.

@flip111 I'm going with hat approach thanks. I'll submit a pull req onto this lib that changes the way it formats for now. Then I can work on making it configurable.

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

3 participants