jmattheis / goverter

Generate type-safe Go converters by simply defining an interface
https://goverter.jmattheis.de/
MIT License
496 stars 46 forks source link

feat: extend with external packages and name regexp #14

Closed nissim-natanov-outreach closed 2 years ago

nissim-natanov-outreach commented 2 years ago

Hey Jannis, thanks for building this wonderful tool!

We would love to use the goverter in our projects in Outreach, and we already know we need to pass a LOT of extend methods in many places to enable custom conversions. The goal of this PR is to enable consolidation of multiple extend conversion methods in a set of dedicated 'packages', then passing this set as a one-line extend to the goverter by invoking goverter as a lib from inside our own codegen tool (or via goverter's command line - we have not decided yet).

This PR enables external packages and name regexp usage in the extend statements.

nissim-natanov-outreach commented 2 years ago

@jmattheis Janis, I was not able to add you as a code reviewer (option grayed out), hoping to grab your attention via mention here :).

nissim-natanov-outreach commented 2 years ago

Hey @nissim-natanov-outreach, thanks for your contribution. This is pretty cool, I like it (:. I mostly remarked error messages, and I think some test cases could be added. See sub comments.

Thanks!! I will be working on addressing the feedback today, hope to get new iteration out soon.

nissim-natanov-outreach commented 2 years ago

thanks a ton fro the feedback, comments addressed :), PTAL

codecov-commenter commented 2 years ago

Codecov Report

Merging #14 (6622c3c) into main (29ad199) will decrease coverage by 0.39%. The diff coverage is 90.56%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #14      +/-   ##
==========================================
- Coverage   93.77%   93.38%   -0.40%     
==========================================
  Files          20       22       +2     
  Lines         932     1043     +111     
==========================================
+ Hits          874      974     +100     
- Misses         43       52       +9     
- Partials       15       17       +2     
Impacted Files Coverage Δ
cmd/goverter/main.go 0.00% <0.00%> (ø)
example/mismatched/input.go 100.00% <ø> (ø)
generator/generator.go 97.26% <ø> (+0.46%) :arrow_up:
generator/packages.go 91.66% <91.66%> (ø)
generator/extends.go 94.95% <94.95%> (ø)
generator/generate.go 87.87% <100.00%> (+1.21%) :arrow_up:
runner.go 89.47% <100.00%> (+0.58%) :arrow_up:

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 29ad199...6622c3c. Read the comment docs.