feat: add color string format rules - #251
Open
nieomylnieja wants to merge 12 commits into
Open
Conversation
|
Test coverage changes:
|
Collaborator
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Govy Go Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: 0a3eca4 | Previous: ab7dfb6 | Ratio |
|---|---|---|---|
BenchmarkStringRGB (github.com/nobl9/govy/pkg/rules) |
71380 ns/op 84.00 validations/op 43077 B/op 694 allocs/op |
9545 ns/op 8096 B/op 132 allocs/op |
7.48 |
BenchmarkStringRGB (github.com/nobl9/govy/pkg/rules) - ns/op |
71380 ns/op |
9545 ns/op |
7.48 |
BenchmarkStringRGB (github.com/nobl9/govy/pkg/rules) - B/op |
43077 B/op |
8096 B/op |
5.32 |
BenchmarkStringRGB (github.com/nobl9/govy/pkg/rules) - allocs/op |
694 allocs/op |
132 allocs/op |
5.26 |
BenchmarkStringHSL (github.com/nobl9/govy/pkg/rules) |
50296 ns/op 68.00 validations/op 28992 B/op 470 allocs/op |
7919 ns/op 6672 B/op 108 allocs/op |
6.35 |
BenchmarkStringHSL (github.com/nobl9/govy/pkg/rules) - ns/op |
50296 ns/op |
7919 ns/op |
6.35 |
BenchmarkStringHSL (github.com/nobl9/govy/pkg/rules) - B/op |
28992 B/op |
6672 B/op |
4.35 |
BenchmarkStringHSL (github.com/nobl9/govy/pkg/rules) - allocs/op |
470 allocs/op |
108 allocs/op |
4.35 |
BenchmarkStringFileSystemPath (github.com/nobl9/govy/pkg/rules) |
45467 ns/op 9913 B/op 117 allocs/op |
22627 ns/op 9801 B/op 117 allocs/op |
2.01 |
BenchmarkStringFileSystemPath (github.com/nobl9/govy/pkg/rules) - ns/op |
45467 ns/op |
22627 ns/op |
2.01 |
BenchmarkStringFilePath (github.com/nobl9/govy/pkg/rules) |
46366 ns/op 10458 B/op 129 allocs/op |
23333 ns/op 10457 B/op 129 allocs/op |
1.99 |
BenchmarkStringFilePath (github.com/nobl9/govy/pkg/rules) - ns/op |
46366 ns/op |
23333 ns/op |
1.99 |
BenchmarkStringDirPath (github.com/nobl9/govy/pkg/rules) |
45534 ns/op 10169 B/op 124 allocs/op |
23277 ns/op 10169 B/op 124 allocs/op |
1.96 |
BenchmarkStringDirPath (github.com/nobl9/govy/pkg/rules) - ns/op |
45534 ns/op |
23277 ns/op |
1.96 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @nieomylnieja
# Conflicts: # internal/messagetemplates/templatekey_string.go # internal/messagetemplates/templates.go # pkg/rules/error_codes.go # pkg/rules/regex.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
pkg/ruleswas missing common color string format validators that users otherwise had to reimplement in application code.Summary
Added color string format rules with exported error codes, message templates, validation-plan descriptions, and focused tests.
Testing
Added rule tests covering accepted examples, invalid messages, and error-code assertions.
Release Notes
Added
rules.StringHexColor,rules.StringRGB,rules.StringRGBA,rules.StringHSL,rules.StringHSLA, andrules.StringCMYK.