NaingAungLuu / form-conductor

A declarative form validation for Jetpack Compose
https://formconductor.naingaungluu.me
MIT License
59 stars 5 forks source link

Stateless and State based validation rules #38

Closed NaingAungLuu closed 1 year ago

NaingAungLuu commented 1 year ago

We can now use two different types of validation rules namely the StatelessValidationRule and StateBasedValidationRule, where the former will validate just the input and the latter will include form's current data while validating. Library consumers can now decide on whether to use form data on validation or not.

Changes

codecov[bot] commented 1 year ago

Codecov Report

Base: 33.92% // Head: 28.73% // Decreases project coverage by -5.19% :warning:

Coverage data is based on head (05e492b) compared to base (61ea328). Patch coverage: 5.35% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #38 +/- ## ============================================= - Coverage 33.92% 28.73% -5.20% Complexity 19 19 ============================================= Files 20 23 +3 Lines 224 261 +37 Branches 44 47 +3 ============================================= - Hits 76 75 -1 - Misses 134 172 +38 Partials 14 14 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `28.73% <5.35%> (-5.20%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/NaingAungLuu/form-conductor/pull/38?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [.../java/me/naingaungluu/formconductor/FieldResult.kt](https://codecov.io/gh/NaingAungLuu/form-conductor/pull/38/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y29yZS9zcmMvbWFpbi9qYXZhL21lL25haW5nYXVuZ2x1dS9mb3JtY29uZHVjdG9yL0ZpZWxkUmVzdWx0Lmt0) | `16.66% <0.00%> (ø)` | | | [...n/java/me/naingaungluu/formconductor/FormResult.kt](https://codecov.io/gh/NaingAungLuu/form-conductor/pull/38/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y29yZS9zcmMvbWFpbi9qYXZhL21lL25haW5nYXVuZ2x1dS9mb3JtY29uZHVjdG9yL0Zvcm1SZXN1bHQua3Q=) | `14.28% <0.00%> (ø)` | | | [...e/naingaungluu/formconductor/builder/FormObject.kt](https://codecov.io/gh/NaingAungLuu/form-conductor/pull/38/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y29yZS9zcmMvbWFpbi9qYXZhL21lL25haW5nYXVuZ2x1dS9mb3JtY29uZHVjdG9yL2J1aWxkZXIvRm9ybU9iamVjdC5rdA==) | `0.00% <0.00%> (ø)` | | | [...formconductor/validation/rules/EmailAddressRule.kt](https://codecov.io/gh/NaingAungLuu/form-conductor/pull/38/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y29yZS9zcmMvbWFpbi9qYXZhL21lL25haW5nYXVuZ2x1dS9mb3JtY29uZHVjdG9yL3ZhbGlkYXRpb24vcnVsZXMvRW1haWxBZGRyZXNzUnVsZS5rdA==) | `0.00% <ø> (ø)` | | | [...u/formconductor/validation/rules/FloatRangeRule.kt](https://codecov.io/gh/NaingAungLuu/form-conductor/pull/38/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y29yZS9zcmMvbWFpbi9qYXZhL21lL25haW5nYXVuZ2x1dS9mb3JtY29uZHVjdG9yL3ZhbGlkYXRpb24vcnVsZXMvRmxvYXRSYW5nZVJ1bGUua3Q=) | `0.00% <ø> (ø)` | | | [...formconductor/validation/rules/IntegerRangeRule.kt](https://codecov.io/gh/NaingAungLuu/form-conductor/pull/38/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y29yZS9zcmMvbWFpbi9qYXZhL21lL25haW5nYXVuZ2x1dS9mb3JtY29uZHVjdG9yL3ZhbGlkYXRpb24vcnVsZXMvSW50ZWdlclJhbmdlUnVsZS5rdA==) | `0.00% <ø> (ø)` | | | [...uu/formconductor/validation/rules/IsCheckedRule.kt](https://codecov.io/gh/NaingAungLuu/form-conductor/pull/38/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y29yZS9zcmMvbWFpbi9qYXZhL21lL25haW5nYXVuZ2x1dS9mb3JtY29uZHVjdG9yL3ZhbGlkYXRpb24vcnVsZXMvSXNDaGVja2VkUnVsZS5rdA==) | `0.00% <ø> (ø)` | | | [...uu/formconductor/validation/rules/MaxLengthRule.kt](https://codecov.io/gh/NaingAungLuu/form-conductor/pull/38/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y29yZS9zcmMvbWFpbi9qYXZhL21lL25haW5nYXVuZ2x1dS9mb3JtY29uZHVjdG9yL3ZhbGlkYXRpb24vcnVsZXMvTWF4TGVuZ3RoUnVsZS5rdA==) | `0.00% <ø> (ø)` | | | [...uu/formconductor/validation/rules/MinLengthRule.kt](https://codecov.io/gh/NaingAungLuu/form-conductor/pull/38/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y29yZS9zcmMvbWFpbi9qYXZhL21lL25haW5nYXVuZ2x1dS9mb3JtY29uZHVjdG9yL3ZhbGlkYXRpb24vcnVsZXMvTWluTGVuZ3RoUnVsZS5rdA==) | `0.00% <ø> (ø)` | | | [...luu/formconductor/validation/rules/OptionalRule.kt](https://codecov.io/gh/NaingAungLuu/form-conductor/pull/38/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y29yZS9zcmMvbWFpbi9qYXZhL21lL25haW5nYXVuZ2x1dS9mb3JtY29uZHVjdG9yL3ZhbGlkYXRpb24vcnVsZXMvT3B0aW9uYWxSdWxlLmt0) | `0.00% <ø> (ø)` | | | ... and [8 more](https://codecov.io/gh/NaingAungLuu/form-conductor/pull/38/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.