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

Handle names via the Named rule #1511

Merged
merged 1 commit into from
Dec 26, 2024
Merged

Conversation

henriquemoody
Copy link
Member

@henriquemoody henriquemoody commented Dec 26, 2024

Because of how the validation engine works now 1, there's no reason to keep adding names to each rule. Instead, create a single rule that handles naming rules with a few other accessories. This change is not necessarily simple, but it shrinks the Rule interface, and it's more aligned with how the library works right now.

Personally, I think this API is much more straightforward than the setName() method, as it's way more explicit about which rule we're naming. Because of this change, the behaviour changed slightly, but it's for the best.

Because of this change, I managed to remove a lot of code, but unfortunately, it's quite a big-bang commit. It would be too complicated to make it atomic since names are an intrinsic part of the library.

Copy link

codecov bot commented Dec 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.53%. Comparing base (9dac855) to head (a3c197f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1511      +/-   ##
============================================
- Coverage     96.54%   96.53%   -0.01%     
- Complexity      972      976       +4     
============================================
  Files           202      200       -2     
  Lines          2400     2398       -2     
============================================
- Hits           2317     2315       -2     
  Misses           83       83              

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

@henriquemoody henriquemoody force-pushed the core/named branch 2 times, most recently from fd7dcff to 4db95a1 Compare December 26, 2024 21:10
@henriquemoody henriquemoody force-pushed the core/named branch 4 times, most recently from 1a03bf7 to 0a5418d Compare December 26, 2024 21:56
@henriquemoody henriquemoody marked this pull request as ready for review December 26, 2024 21:57
@henriquemoody henriquemoody changed the title Create "Named" rule Handle names via the "Named" rule Dec 26, 2024
@henriquemoody henriquemoody changed the title Handle names via the "Named" rule Handle names via the Named rule Dec 26, 2024
@henriquemoody henriquemoody force-pushed the core/named branch 3 times, most recently from f9d6cb8 to 5db45f4 Compare December 26, 2024 22:08
Because of how the validation engine works now [1], there's no reason to
keep adding names to each rule. Instead, create a single rule that
handles naming rules with a few other accessories. This change is not
necessarily simple, but it shrinks the `Rule` interface, and it's more
aligned with how the library works right now.

Personally, I think this API is much more straightforward than the
`setName()` method, as it's way more explicit about which rule we're
naming. Because of this change, the behaviour changed slightly, but it's
for the best.

Because of this change, I managed to remove a lot of code, but
unfortunately, it's quite a big-bang commit. It would be too complicated
to make it atomic since names are an intrinsic part of the library.

[1]: 238f2d5
@henriquemoody henriquemoody merged commit a3c197f into Respect:main Dec 26, 2024
8 checks passed
@henriquemoody henriquemoody deleted the core/named branch December 26, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant