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

chore: Add DoesntEndWithValidator to validate that a string doesn't end with a given suffix #209

Merged

Conversation

bangadam
Copy link
Contributor

References

Issue(s): #203
Discussion: None

Description

This validator ensures that the string under validation does not end with the specified suffix. The main benefits of this addition are:

  • It provides a simple and efficient way to validate that a string does not end with a given suffix, enhancing data validation and integrity.
  • It reduces the need for custom validation logic in individual projects, promoting code reusability and maintainability.

Possible Drawbacks

  • The DoesntEndWith validator assumes the validated object is a string. If the context value is not of this type, the validation will fail

@System-Glitch System-Glitch self-requested a review June 18, 2024 07:49
Copy link
Member

@System-Glitch System-Glitch left a comment

Choose a reason for hiding this comment

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

You forgot to add the default language lines in lang/default.go.

validation/string_end.go Outdated Show resolved Hide resolved
validation/string_end.go Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Jun 18, 2024

Pull Request Test Coverage Report for Build 9556065104

Details

  • 7 of 15 (46.67%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 97.188%

Changes Missing Coverage Covered Lines Changed/Added Lines %
validation/string_end.go 7 15 46.67%
Totals Coverage Status
Change from base Build 9526951349: -0.1%
Covered Lines: 6049
Relevant Lines: 6224

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 19, 2024

Pull Request Test Coverage Report for Build 9573361869

Details

  • 14 of 14 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.006%) to 97.316%

Totals Coverage Status
Change from base Build 9526951349: 0.006%
Covered Lines: 6056
Relevant Lines: 6223

💛 - Coveralls

@System-Glitch System-Glitch merged commit fbcd0d6 into go-goyave:master Jun 19, 2024
4 checks passed
@System-Glitch
Copy link
Member

Thank you very much! 🎉

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