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

Validate Modifier for Predicates #42

Merged
merged 5 commits into from
Aug 13, 2024
Merged

Conversation

Supereg
Copy link
Member

@Supereg Supereg commented Aug 12, 2024

Validate Modifier for Predicates

♻️ Current situation & Problem

SpeziValidation currently provides the validate(input:rules:) modifier to validate String-based inputs using SpeziValidation. This PR extends this functionality to Bool expressions. The new validate(_:message:) modifier can be used to validate all sorts of boolean conditions and supply a validation failure reason with it.

⚙️ Release Notes

  • New validate(_:message:) modifier to validate bool expressions.

📚 Documentation

Documentation was updated to highlight the new modifier.

✅ Testing

TBA

📝 Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@Supereg Supereg requested a review from PSchmiedmayer August 12, 2024 10:38
@Supereg
Copy link
Member Author

Supereg commented Aug 12, 2024

CC: @AdritRao, this might be helpful for StanfordSpezi/SpeziOnboarding#54

Copy link

codecov bot commented Aug 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.12%. Comparing base (4a8245e) to head (18ae445).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #42      +/-   ##
==========================================
+ Coverage   80.37%   81.12%   +0.75%     
==========================================
  Files          44       44              
  Lines        1304     1308       +4     
==========================================
+ Hits         1048     1061      +13     
+ Misses        256      247       -9     
Files Coverage Δ
Sources/SpeziValidation/ValidationModifier.swift 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a8245e...18ae445. Read the comment docs.

Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing; what a great addition @Supereg!

This will be really helpful for the consent PR that @AdritRao is working on, thank you!

Last thing seems like the builds on the latest Xcode release seem to fail; would be great to address this before we merge the PR.

@PSchmiedmayer PSchmiedmayer added the enhancement New feature or request label Aug 13, 2024
@Supereg Supereg merged commit 427f4f3 into main Aug 13, 2024
13 checks passed
@Supereg Supereg deleted the feature/validate-predicate branch August 13, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants