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

feat(util/gvalid): add new rule required-if-all #3455

Merged
merged 11 commits into from
Apr 11, 2024

Conversation

cococolanosugar
Copy link
Contributor

added rules:

  1. required-if-any-eq Required if any given field and its value are equal.
  2. required-if-all-eq: Required if all given field and its value are equal.

added rules:
1. required-if-any-eq
Required if any given field and its value are equal.
2. required-if-all-eq:
Required if all given field and its value are equal.
@gqcn
Copy link
Member

gqcn commented Apr 7, 2024

@cococolanosugar
Hello, thanks for your contribution for the project!
The being added rule required-if-any-eq performs exactly as the existing rule required-if. It's better update the comments of the rule required-if instead of adding new rule.
The new rule required-if-all-eq is awsome, but it's better using name required-if-all which would be related to the onther rule reuired-if for the users.

Remove rule required-if-any-eq.
And rename required-if-all-eq to required-if-all, which means:
Required if all given field and its value are equal.
@cococolanosugar
Copy link
Contributor Author

@gqcn
Hi, thanks for your advice. I have updated the commits. If you have time, please review it.

@gqcn
Copy link
Member

gqcn commented Apr 9, 2024

@cococolanosugar Hello, I've made a pr for some improvement for your pr hah cococolanosugar#1

@gqcn gqcn changed the title feat(gvalid): add new rules for gvalid feat: add new rule required-if-all for gvalid Apr 9, 2024
@gqcn gqcn changed the title feat: add new rule required-if-all for gvalid feat: add new rule required-if-all for package gvalid Apr 9, 2024
enhance: some improvement for new `require-if-all` rule
@gqcn gqcn merged commit 91f449d into gogf:master Apr 11, 2024
23 checks passed
@gqcn gqcn changed the title feat: add new rule required-if-all for package gvalid feat(util/gvalid): add new rule required-if-all Jun 27, 2024
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.

3 participants