Skip to content

Change how Apply works#54

Merged
andrewcurioso merged 2 commits into
mainfrom
feature/apply-refactor
Feb 13, 2026
Merged

Change how Apply works#54
andrewcurioso merged 2 commits into
mainfrom
feature/apply-refactor

Conversation

@andrewcurioso

Copy link
Copy Markdown
Member

This is a significant change that removes the output argument from the Apply signature in favor of returning a type that is always the same type as the validator.

The old signature:

Apply(ctx context.Context, input, output any) errors.ValidationError

The new one:

Apply(ctx context.Context, input, output any) (T, errors.ValidationError)

This significant reduces code complexity since rule sets no longer need to worry about output being unknown at compile time.

As of this change, ProtoValidate can no longer be used to mutate between two data types, which was never the goal anyway, but it is now much easier to develop for and debug.

@codecov

codecov Bot commented Feb 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (fab5005) to head (54975b6).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main       #54    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           78        78            
  Lines         5126      4811   -315     
==========================================
- Hits          5126      4811   -315     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This is a significant change that removes teh output argument from
the Apply signature in favor of returning a type that is always the
same type as the validator.

This significant reduces code complexity since rule sets no longer
need to worry about output being unknown at compile time.

As of this change, ProtoValidate can no longer be used to mutate
between two data types, which was never the goal anyway, but it is
now much easier to develop for and debug.
@andrewcurioso andrewcurioso merged commit 88106bb into main Feb 13, 2026
4 checks passed
@andrewcurioso andrewcurioso deleted the feature/apply-refactor branch February 13, 2026 20:01
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