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

Avoid adding unnecessary imports to generated source files #717

Merged
merged 2 commits into from
Dec 9, 2019

Conversation

cb372
Copy link
Member

@cb372 cb372 commented Dec 9, 2019

When generating Scala from protobuf files, only add imports for things that are actually referenced in that file.

Also refactor ProtoSrcGenerator for consistency with the other generators. It now returns a list of the lines in the generated file instead of a singleton list containing the whole file contents.

TODO in a later PR: pass skeuomorph some kind of flag to tell it whether to use fs2 Stream or Monix Observable when generating service code.

What this does?

Fixes #637

Checklist

  • Reviewed the diff to look for typos, println and format errors.
  • Updated the docs accordingly.

cb372 added 2 commits December 9, 2019 14:51
When generating Scala from protobuf files, only add imports for things
that are actually referenced in that file.
Refactor for consistency with the other generators. It now returns a
list of the lines in the generated file instead of a singleton list
containing the whole file contents.
Copy link
Member

@BenFradet BenFradet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@juanpedromoreno juanpedromoreno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@codecov
Copy link

codecov bot commented Dec 9, 2019

Codecov Report

Merging #717 into master will increase coverage by 0.12%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #717      +/-   ##
==========================================
+ Coverage   81.55%   81.67%   +0.12%     
==========================================
  Files          73       73              
  Lines        1160     1168       +8     
  Branches       15       17       +2     
==========================================
+ Hits          946      954       +8     
  Misses        214      214
Impacted Files Coverage Δ
...ndness/mu/rpc/idlgen/proto/ProtoSrcGenerator.scala 96.15% <100%> (+1.7%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a25c508...27d87c1. Read the comment docs.

@cb372 cb372 merged commit c19526d into master Dec 9, 2019
@cb372 cb372 deleted the fix-extraneous-imports branch December 9, 2019 15:34
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

Successfully merging this pull request may close these issues.

Extraneous imports
3 participants