Add validation to cog configs #512
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.

Adds an abstract a
validate!method toCog::Configthat will get called once a cog instance's configs are merged. A config that fails validation will raise an exception before the workflow begins running.This also allows config validation logic to take the full state of the config into account, if necessary (vs the previous pattern of validating individual args when they were set on the config object)
Introduces a
valid_<param>andvalid_<param>!accessor pattern for config class attributes. The convention I'm imagining is this:exit_on_error!andno_exit_on_error!)exit_on_error?)parallel 3)valid_prefix (valid_parallel!)!suffix if it performs validation and might thrownils.