Skip to content

Releases: nobl9/govy

v0.8.0

06 Nov 18:23
78d44fd
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • feat: Add AssertErrorContains (#47) @nieomylnieja

    Added govytest.AssertErrorContains function which helps test govy rules by checking if a produced govy.ValidatorError contains specified error.

v0.7.0

05 Nov 15:17
c2b1093
Compare
Choose a tag to compare

What's Changed

⚠️ Breaking Changes

  • feat: Add cascade mode setting to Validator (#43) @nieomylnieja

    govy.CascadeMode enum now starts from 1 (previously 0).

  • feat: Allow converting rules for pointers (#42) @nieomylnieja

    govy.NewRuleSet now only accepts govy.Rule. Previously passing anything else into it would not work either.

🚀 Features

  • feat: Add benchmark report (#41) @nieomylnieja

    Benchmarks for govy can now be easily inspected and tracked over time.

  • feat: Add cascade mode setting to Validator (#43) @nieomylnieja

    Added govy.Validator.Cascade which allows controlling error handling on govy.Validator level and propagating the setting to govy.PropertyRules. For more details on cascade mode read this.

  • feat: Allow converting rules for pointers (#42) @nieomylnieja

    Added two functions: govy.RuleToPointer and govy.RuleSetToPointer which both convert respectively govy.Rule[T] and govy.RuleSet[T] to work on pointers of the same type: govy.Rule[*T] and govy.RuleSet[*T].
    govytest.ExpectedRuleError no longer requires PropertyName to be provided, this allows testing properties which have no name.

🧰 Maintenance

4 changes

v0.6.0

03 Nov 16:34
b366bbd
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • feat: Add StringCrontab rule (#40) @nieomylnieja

    Added StringCrontab rule which verifies if a string is a valid crontab schedule expression according to the rules defined by crontab.

  • feat: Add StringRegexp rule (#38) @nieomylnieja

    Added StringRegexp validation rule which verifies if a string is a valid regular expression according to https://pkg.go.dev/regexp/syntax rules.

v0.5.0

29 Oct 14:16
a1ec895
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • feat: Add file system rules (#37) @nieomylnieja

    Added 4 new rules: StringFileSystemPath, StringFilePath, StringDirPath and StringMatchFileSystemPath, which help verify file system paths and patterns.

  • feat: Add StringGitRef rule (#35) @nieomylnieja

    Added StringGitRef validation rule which checks if a string is a valid git reference according to the rules defined by git-check-ref-format.

  • feat: Add benchmarks (#32) @nieomylnieja

    Added benchmarks to builtin rules.

  • feat: Support validating slices of objects (#30) @nieomylnieja

    Added new validator function for slices: govy.Validator.ValidateSlice. It can be used to validate a slice of values, where each value has the same type as the validator's type constraint. Internally it calls govy.Validator.Validate on each element and returns govy.ValidatorErrors.

🧰 Maintenance

4 changes

v0.4.0

02 Oct 13:47
364a5a5
Compare
Choose a tag to compare

What's Changed

⚠️ Breaking Changes

  • chore: Simplify StringDNSLabel rule (#29) @nieomylnieja

    StringDNSLabel is no longer a RuleSet, instead it's now a single Rule.

🚀 Features

  • feat: Add WithNameFunc to Validator (#28) @nieomylnieja

    Added Validator.WithNameFunc function which can be used to dynamically set the validator's name per-instance.

🧰 Maintenance

v0.3.0

30 Sep 21:13
74b9792
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • feat: Add test utilities (#25) @nieomylnieja

    Added govytest package which exposes utilities which help test govy validation rules.
    It comes with two functions AssertNoError, which ensures no error was produced, and AssertError which checks that the expected errors are equal to the actual govy.ValidatorError.
    Added OneOfProperties rule which checks if at least one of the properties is set.

🧰 Maintenance

v0.2.0

20 Sep 14:41
667a8b4
Compare
Choose a tag to compare

What's Changed

⚠️ Breaking Changes

  • chore: Update README and add coverage report (#22) @nieomylnieja

    Changed NameInferDefaultRule to NameInferDefaultFunc.
    The change can be easily applied with the following command: gofmt -r 'govyconfig.NameInferDefaultRule -> govyconfig.NameInferDefaultFunc'.

  • feat: Improve development docs and SliceUnique, remove gomarkdoc (#11) @nieomylnieja

    SliceUnique error message has been changed.
    Before: elements are not unique, index 0 collides with index 2.
    After: elements are not unique, 1st and 3rd elements collide.

🚀 Features

  • feat: Add network rules (#21) @nieomylnieja

    New network rules for MAC, IP and CIDR (includes IPv4 and IPv6) along with StringEmail (based on RFC 5322) and StringExcludes which complements existing StringContains rule.

  • feat: Remove stretchr/testify dependency (#20) @nieomylnieja

    Govy no longer relies on stretchr/testify library for unit testing, thus limiting its module's dependency tree size significantly.

  • feat: Add lazy loading to regular expressions (#16) @nieomylnieja

    All regular expressions are now lazy loaded, once when the corresponding rule is used.

  • feat: Improve development docs and SliceUnique, remove gomarkdoc (#11) @nieomylnieja

    SliceUnique now reports more readable error messages using ordinal slice index form (e.g. 1st, 2nd, 11th) instead of 0-based slice index.

🧰 Maintenance

6 changes

v0.1.1

28 Aug 16:01
bb894ac
Compare
Choose a tag to compare

What's Changed

  • chore: Add LICENSE

v0.1.0

28 Aug 14:33
Compare
Choose a tag to compare

This is the first official release of govy!