Skip to content

Does built_value format generated code? #730

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

Closed
kentcb opened this issue Oct 23, 2019 · 2 comments
Closed

Does built_value format generated code? #730

kentcb opened this issue Oct 23, 2019 · 2 comments
Assignees
Labels

Comments

@kentcb
Copy link

kentcb commented Oct 23, 2019

Hi,

I'm trying to get to the bottom of this issue. In short, code generated by built_value does not align with my project's code formatting, so either I need to ignore .g.dart files during formatting (my first preference, but per the linked issue, not currently practical) or I need built_value to format generated code according to my project standards.

My suspicion is that built_value does format code, but it uses the standard line length (80). My project uses 120 character width.

@davidmorgan davidmorgan self-assigned this Oct 24, 2019
@davidmorgan
Copy link
Collaborator

You have it exactly right, it does format code and it uses the standard line length.

built_value uses source_gen which formats automatically. It does not appear to have options for line length:

https://github.com/dart-lang/source_gen/blob/master/source_gen/lib/src/builder.dart#L299

Even if it did, piping through the option would be annoying; I'm not convinced that's a good path. I think figuring out how to format only the non-generated files it the way to go.

@kentcb
Copy link
Author

kentcb commented Oct 24, 2019

Thanks for the info!

@kentcb kentcb closed this as completed Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants