Default states#80
Merged
Merged
Conversation
added 2 commits
June 5, 2023 12:20
This commit hides the "state" attribute of partial results and implements a Setter for it. This way it can remember if the state was set explicitely or not. In combination with the default state, it is now possible to set a default state which is used, if NO partial results and NO explicit states are set later. An example: var subcheck PartialResult subcheck.SetDefaultState(check.Warning) will create a PartialResult which returns Warning if nothing else happens. If I now, later in the code either add PartialResults or set the state explicitely, this is overriden. This way application code does not need to remember in what state it put a PartialResult previously, but can just set a sane default at the beginning.
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.
Allow setting of default states for partial results.
This solves a problem where partialResults are generated dynamically
later in the code and a program would need to remember the state itself outside
of this library to generate the results correctly