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

improve the readability of the generated code #771

Closed
devoncarew opened this issue Nov 9, 2022 · 2 comments
Closed

improve the readability of the generated code #771

devoncarew opened this issue Nov 9, 2022 · 2 comments

Comments

@devoncarew
Copy link
Collaborator

Hi; I have some ideas for changes that could improve the readability of the generated code. These would all be non-functional changes; they wouldn't effect the compiled size of the code or the runtime performance.

The readability of the generated code probably isn't a critical consideration here, so I thought I'd open an issue to discuss before sending PRs. Some potential changes:

  • move the n copies of const $core.bool.fromEnvironment('protobuf.omit_field_names') in the generated files into a single _omitFieldNames const in each file
  • address a few of the ~12 lints we ignore in the generated code

cc @osa1

osa1 pushed a commit that referenced this issue Nov 14, 2022
This improves the readability of the generated code (see #771 for context).

- use shared consts to reduce the number of repeated bool.fromEnvironment()
  expressions (all the bool.fromEnvironment() expressions are gathered up
  while generated the file and written as consts at the end of the file)

- turn on a few additional lints

- update the changelog
@osa1
Copy link
Member

osa1 commented Jun 9, 2023

@devoncarew we merged a few PRs about this, can this be closed as complete or do you have more changes planned?

@devoncarew
Copy link
Collaborator Author

I think we're good to close this - any other things we notice wrt readability can just be tackled at the time / filed as separate issues.

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

2 participants