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

Prepare library for the next major version #1518

Closed
wants to merge 4 commits into from

Conversation

henriquemoody
Copy link
Member

Version 3.0 will include a few crucial deprecations. This commit adds some soft deprecations to warn users about these changes.

Some of the biggest changes are:

  • The method validate() will be renamed to isValid().

  • The method validate() will be repurposed to return an object with failures.

  • It won't be possible to handle rules directly; users will need to use the Validator class to validate with any rule.

  • It won't be possible to catch specific exceptions; users will need to catch ValidationException.

There will some more changes, but those are some of the most important ones, and are the ones that are easy to deprecate right now.

@henriquemoody henriquemoody added this to the 2.4 milestone Jan 6, 2025
@henriquemoody henriquemoody force-pushed the 2.4 branch 8 times, most recently from 5c422b3 to b851bf3 Compare January 6, 2025 23:53
Version 3.0 will include a few crucial deprecations. This commit adds
some soft deprecations to warn users about these changes.

Some of the biggest changes are:

* The method `validate()` will be renamed to `isValid()`.

* The method `validate()` will be repurposed to return an object with
  failures.

* It won't be possible to handle rules directly; users will need to use
  the `Validator` class to validate with any rule.

There will some more changes, but those are some of the most important
ones, and are the ones that are easy to deprecate right now.
It won't be possible to catch specific exceptions; users will need to
catch `ValidationException`. The `NestedValidationException` will be
removed in the next major version, but there's no alternative to it
right now, so I didn't deprecate it.
This commit will deprecate some classes in favor of a couple of news
ones. If there are no customisations to `assert()`, `check()`, and other
methods, the migration should be pretty easy on users.
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.03%. Comparing base (37736c4) to head (8d989a7).

Additional details and impacted files
@@             Coverage Diff              @@
##                2.3    #1518      +/-   ##
============================================
- Coverage     95.04%   94.03%   -1.01%     
+ Complexity      981      448     -533     
============================================
  Files           195       97      -98     
  Lines          2299     1240    -1059     
============================================
- Hits           2185     1166    -1019     
+ Misses          114       74      -40     

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

@henriquemoody
Copy link
Member Author

This merge request got merged as branch 2.4

@henriquemoody henriquemoody deleted the 2.4 branch January 7, 2025 00:50
@henriquemoody
Copy link
Member Author

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