Skip to content

feat: add color string format rules - #251

Open
nieomylnieja wants to merge 12 commits into
mainfrom
format-colors
Open

feat: add color string format rules#251
nieomylnieja wants to merge 12 commits into
mainfrom
format-colors

Conversation

@nieomylnieja

@nieomylnieja nieomylnieja commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Motivation

pkg/rules was 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, and rules.StringCMYK.

@github-actions github-actions Bot added enhancement New feature or request go Pull requests that update Go code minor New functionality with at most minor brekaing changes labels Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Test coverage changes:

Package Before After Diff
github.com/nobl9/govy/cmd/govy 0% 0% ✔️
github.com/nobl9/govy/internal 73% 73% ✔️
github.com/nobl9/govy/internal/collections 100% 100% ✔️
github.com/nobl9/govy/internal/inferpath 76% 76% ✔️
github.com/nobl9/govy/internal/messagetemplates 89% 89% ✔️
github.com/nobl9/govy/internal/stringconvert 86% 86% ✔️
github.com/nobl9/govy/internal/typeinfo 94% 94% ✔️
github.com/nobl9/govy/pkg/govy 93% 93% ✔️
github.com/nobl9/govy/pkg/govytest 100% 100% ✔️
github.com/nobl9/govy/pkg/jsonpath 85% 85% ✔️
github.com/nobl9/govy/pkg/rules 98% 98% ✔️

@nieomylnieja nieomylnieja changed the title feat: add color format rules feat: add color string format rules Jul 9, 2026

@n9-machine-user n9-machine-user left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

⚠️ 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update Go code minor New functionality with at most minor brekaing changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants