[#519] Implement a golden generator executable #549
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements
gg
— a golden generator executable. It regenerates and updates on disk the content of all projects, scripts and default TOML config. It is useful when doing some massive boring updates (e.g. adding/removing GHC version support). Withgg
you can just change the mainSummoner
code and just runcrun gg
to update all the projects.The second commit in this PR shows an example of updating years in all projects using
gg
.It might be counter-intuitive to use
gg
to generate tests and then test against tests themselves. But the main idea is that you usually don't usegg
after each change. Golden tests ensure that nothing changes unexpectedly. However, when changing e.g. GHC version you expect changes in golden tests. So you can quickly regenerate them, check the diff to verify that the changes look ok and submit them 🙂 Ifgg
generated some unexpected results, you can always clean the mess withgit
because all the projects under the version control