_codegen: copy dependency github.com/ernesto-jimenez/gogen/imports#1782
_codegen: copy dependency github.com/ernesto-jimenez/gogen/imports#1782dolmen merged 2 commits intostretchr:masterfrom
Conversation
|
This doesn't bring the commit history from source repo, just the files. Should we bring in a subtree instead, or do you think this is a better approach? I know the subtree has proven extremely difficult to re-base. |
ccoVeille
left a comment
There was a problem hiding this comment.
LGTM 👍
A few remarks anyway
|
@brackendawson wrote:
I don't think we need the history for the file. My goal is to get rid of the code we don't need in that package, and may be ultimately move the few things we use into Also we don't need a test suite for that package: we just need the code generation to work with the minimum maintainable code, so the code generation output is the test suite. |
|
Code is always more maintainable when it has tests. The code you've copied in verbatim had one test which you have not vendored. Why are we not bringing that too? |
Copy code from dependency github.com/ernesto-jimenez/gogen/imports (which hasn't evolved since 2018) as package _codegen/internal/imports. This is imported from https://github.com/ernesto-jimenez/gogen at commit d7d4131e6607813977e78297a6060f360f056a97. See https://github.com/ernesto-jimenez/gogen/tree/d7d4131e6607813977e78297a6060f360f056a97/imports The license block is added to match the LICENSE file from the source repository.
Use our imported copy of package github.com/ernesto-jimenez/gogen/imports to remove one external dependency.
cf02e22 to
242e746
Compare
Merge code from package internal/imports (recently copied from package github.com/ernesto-jimenez/gogen/imports) into the codegen program itself. Also copy the license attached to it into the _codegen/main.go source, as _codegen/main.go was originally by the same author (Ernesto Jimenez) as the imported code and matches the license terms of the global Testify project. Also: Ernesto, who was queried about this project, didn't block it. #1782 (comment)
Summary
Remove external dependency on module
github.com/ernesto-jimenez/gogenby copying its packagegithub.com/ernesto-jimenez/gogen/imports(MIT license) as_codegen/internal/imports.Changes
github.com/ernesto-jimenez/gogen/imports/imports.goas_codegen/internal/imports/imports.goand add a license block to the file_codegen/main.goand_codegen/go.mod.Motivation
The removal of this external dependency (by duplicating its code) improves the control of our source code. It will also allow more refactoring of the codegen steps (in particular this now allow to remove the separate go module).
Cc: @ernesto-jimenez