Refactoring name generating functions in TH#1218
Merged
parsonsmatt merged 29 commits intoyesodweb:masterfrom Apr 20, 2021
Merged
Refactoring name generating functions in TH#1218parsonsmatt merged 29 commits intoyesodweb:masterfrom
parsonsmatt merged 29 commits intoyesodweb:masterfrom
Conversation
parsonsmatt
approved these changes
Apr 19, 2021
Collaborator
|
this is great, thanks! 😄 i'm going to make a 2.12.1.1 patch release soon, do you want to add a note in the changelog for this? |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Before submitting your PR, check that you've:
@sincedeclarations to the HaddockAfter submitting your PR:
(unreleased)on the ChangelogRefactors the
THmodule, specifically themed around generatingTHNames, orExpvalues that use those names.Now I think this module is a lot dry'er, where we have some duplication currently scattered around this module dealing with how names are generated.
For example, the Entity name when using
mpsGenericwas duplicated in 3 different places, this change has DRY'd this up into a single function.I considered moving these functions out and into their own module, and adding some HSpec tests for each name generating function, for the key name generating functions at least, such as the constructor name/field accessor names, but thought this might be over kill. I think this functionality is largely covered in
persistent-testso thought best of doing that. I have grouped these functions at the bottom of the module anyway.I think there is probably more we can do here to make this module a bit easier to follow in line with #1156 while also trying to balance out not changing too much in a single change request. Hopefully there are some values/functions in here now with some slightly clearer names too.
I took a very incremental approach to this change, so there are a lot of commits here. I've left them as they are for now, but if it is preferred that they're squashed into a single commit I can do so 👍