Skip to content
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

Add new validation infrastructure #1279

Merged
merged 6 commits into from
Oct 26, 2022
Merged

Add new validation infrastructure #1279

merged 6 commits into from
Oct 26, 2022

Conversation

hannobraun
Copy link
Owner

Validation code is currently split into two different types of code:

  1. The "official" validation code that runs only when a complete shape is constructed, and is not run in test code.
  2. Some ad-hoc validation code that runs when objects are constructed, but panics when it fails.

Both of these are not satisfying. Type 1 doesn't provide enough coverage, especially in test code, letting potential issues slip through. Type 2 panics, which is fine for now, but since validation errors can be the result of user error and shouldn't crash everything, won't be fine for much longer.

This pull request adds new validation infrastructure, in parallel to the existing one, that is designed to be run on object construction, and returns Result. It is meant to eventually subsume and unify the two existing types of validation code. No actual validation code is ported to the new infrastructure yet. I have started doing this in a local branch, but (surprise, surprise) the increased coverage has unearthed new issues which I'm currently working on fixing.

I have plans to revamp the validation infrastructure a bit, and this new
trait is intended to replace the current one.
These make it possible to get the infrastructure in place before
implementing any validation code for real.
It doesn't really belong in `algorithms`, seeing how it's part of the
core object infrastructure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant