Closed Stelzi79 closed 2 years ago
Cool idea! Tagging @jasonbock to review
I'm personally not a fan of persisting the generated files and then putting them into Git. Just not my thing.
In any project this library gets consumed I would concur that generated files generally don't have a place in Git BUT this project is about coding the generator.
For any decent sized project or open source like this you need a way to see with every PR if or what actually the changes to the generator changed to the generated files for review purposes. If these changes are easy to see in the diff unwanted (potential malicious) changes are seen at a first glance.
Another thing would be that with the generated output you can make fairly quick and cheap unit tests in a more end to end fashion. For example you always could "save away" the generated output into a folder in a test project and use them further.
I already have a test project in place to verify that the generated code is what is expected. Furthermore, the tests use the source generator testing libraries in NuGet to ensure they also compile.
Closing in favor of the unit tests @JasonBock has built for the Source Generators.
Thanks for the idea!
This add some configuration of Generators to
Test.csproj
andWorkingApi.csproj
in order to be able to check in the generated files into Git. It enables to review changes to the Generators in future better in PRs.