Skip to content

Style guide for generated code #23

Description

@jvliwanag

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?

Activity

  1. flip111 commented on Nov 27, 2020

    @flip111
    Member

    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.

  2. paluh commented on Nov 29, 2020

    @paluh
    Member

    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).

  3. jvliwanag commented on Dec 9, 2020

    @jvliwanag
    MemberAuthor

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions