Releases: nobl9/govy
v0.8.0
What's Changed
🚀 Features
- feat: Add AssertErrorContains (#47) @nieomylnieja
Added
govytest.AssertErrorContains
function which helps test govy rules by checking if a producedgovy.ValidatorError
contains specified error.
v0.7.0
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 acceptsgovy.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 ongovy.Validator
level and propagating the setting togovy.PropertyRules
. For more details on cascade mode read this. - feat: Allow converting rules for pointers (#42) @nieomylnieja
Added two functions:
govy.RuleToPointer
andgovy.RuleSetToPointer
which both convert respectivelygovy.Rule[T]
andgovy.RuleSet[T]
to work on pointers of the same type:govy.Rule[*T]
andgovy.RuleSet[*T]
.
govytest.ExpectedRuleError
no longer requiresPropertyName
to be provided, this allows testing properties which have no name.
🧰 Maintenance
4 changes
- chore: Update README.md (#46) @nieomylnieja
- chore: Split test workflows for pushes to main (#45) @nieomylnieja
- chore: Fix benchamrk action (#44) @nieomylnieja
- chore: Update dependency cspell to v8.15.7 (#39) @renovate
v0.6.0
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
What's Changed
🚀 Features
- feat: Add file system rules (#37) @nieomylnieja
Added 4 new rules:
StringFileSystemPath
,StringFilePath
,StringDirPath
andStringMatchFileSystemPath
, 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 callsgovy.Validator.Validate
on each element and returnsgovy.ValidatorErrors
.
🧰 Maintenance
v0.4.0
What's Changed
⚠️ Breaking Changes
- chore: Simplify StringDNSLabel rule (#29) @nieomylnieja
StringDNSLabel
is no longer aRuleSet
, instead it's now a singleRule
.
🚀 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
- chore: Simplify StringDNSLabel rule (#29) @nieomylnieja
- chore: Update README.md (#27) @nieomylnieja
- chore: Update kskitek/coverdiff action to v0.6.0 (#26) @renovate
v0.3.0
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 functionsAssertNoError
, which ensures no error was produced, andAssertError
which checks that the expected errors are equal to the actualgovy.ValidatorError
.
AddedOneOfProperties
rule which checks if at least one of the properties is set.
🧰 Maintenance
- chore: Update dependency markdownlint-cli to v0.42.0 (#24) @renovate
- chore: Create coverage-pr-report.yml (#23) @nieomylnieja
v0.2.0
What's Changed
⚠️ Breaking Changes
- chore: Update README and add coverage report (#22) @nieomylnieja
Changed
NameInferDefaultRule
toNameInferDefaultFunc
.
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) andStringExcludes
which complements existingStringContains
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
- chore: Update README and add coverage report (#22) @nieomylnieja
- chore: Update devbox and cspell config (#19) @nieomylnieja
- chore: Update dependency yaml to v2.5.1 (#14) @renovate
- chore: Correct go.mod replace clause in validator comparison (#15) @nieomylnieja
- chore: Add comparison with go-playground/validator (#13) @nieomylnieja
- chore: Update README.md (#9) @nieomylnieja
v0.1.1
What's Changed
- chore: Add LICENSE
v0.1.0
This is the first official release of govy!