Draft
Conversation
…th-core' into typed-valueOrNull
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #9049 +/- ##
=========================================
Coverage 85.14% 85.14%
+ Complexity 4392 4388 -4
=========================================
Files 569 568 -1
Lines 12260 12214 -46
Branches 2648 2633 -15
=========================================
- Hits 10439 10400 -39
+ Misses 676 675 -1
+ Partials 1145 1139 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9fc64f3 to
a79218e
Compare
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.
Config.valueOrNullimplementations where doing something like thisas T. That cast isn't safe. The function could return aMapbut saying that it's aList. It will fail as soon as you try to access it because the functions that you are looking for aren't there but that fail will happen too late and it's difficult to understand what happened. With this implementation if something like that happens the exception is thrown as soon as possible so it's easier to fix.Also, this open the option to a similar refactor over
ConfigPropertyto make it safer and easier to make it support more types. For example, the current implementation ofValueWithReasonatConfigProperty.ktis really fragile.Also this simplifies A LOT
YamlConfig. No moreBaseConfig(that was just code fromYamlConfigmoved to another file). And all theConfigimplemementations too. Now you don't need to implement two different functions. You just need to implement one. The other is implemented as an extension function over the other.More context at #9035
Sorry for this PR, I know that it's big but I don't know how to make it smaller.
Waiting for:
YamlConfig.load(Path)#9047YamlConfig#9048Config.parentPath#9036Extra: We could rename this function
getOrNullto align with the standard library but that can be done in another PR.