-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor custom function execution #150
Merged
Merged
Conversation
This file contains 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
- make DRY code - add roxygen skeleton - split logical vectors into separate variables - insert explanatory comments
- add sentinel boolean variables - add roxygen skeleton - insert explanatory comments - unwrap calls that don't need to be wrapped
annakrystalli
approved these changes
Nov 1, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this refactor!
I have to be honest, I feel the level of commenting is a bit much. But I like the extra tests and checks and some of the sentinel variables do make it easier to follow.
Overall definitely an improvement in robustness and readability 👍
Co-authored-by: Anna Krystalli <[email protected]>
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.
I've refactored the custom function execution functions. This refactor is mainly for the purposes of debugging and readability. I find this especially important when navigating a function that works with variables in other environments. Having the comments and the sentinel variables reduces the cognative load necessary to walk through the function during a debugging session.
During my refactor, I found that there was an untested error and a dangling else condition that should have resulted in an error in the case of a malformed config file. I added classes to those errors and added tests for them.
Note that this PR does not need to ship with the next version of hubValidations if we want to ship the new features immediately.
This will fix #148