Skip to content

Tighten colour validation and deduplicate config defaults - #3

Merged
tombell merged 2 commits into
mainfrom
config-validation-fixes
Oct 24, 2026
Merged

tombell merged 2 commits into
mainfrom
config-validation-fixes

Conversation

@tombell

@tombell tombell commented Oct 24, 2026

Copy link
Copy Markdown
Member

Summary

  • Reject hex colours with a sign prefix. `UInt32(_:radix:)` accepts a leading `+`, so `#+FFFFFFF` passed validation and was read as `0x0FFFFFFF`.
  • Make `Configuration.init(from:)` read its defaults from `Configuration()`, so the property initialisers are the only place defaults are defined.

Testing

  • Added `#+FFFFFFF` to the existing invalid configuration cases.
  • `make lint` and `make test` pass.

🤖 Generated with Claude Code

tombell and others added 2 commits October 24, 2026 14:21
UInt32(_:radix:) accepts a leading sign, so #+FFFFFFF passed validation
and was read as a different colour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Defaults were declared twice and could drift apart silently.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tombell
tombell merged commit 1befeff into main Oct 24, 2026
1 check passed
@tombell
tombell deleted the config-validation-fixes branch October 24, 2026 21:00
@tombell tombell added type: bug Broken behavior and regressions area: configuration Config parsing, validation, schema, defaults, reload, and runtime overrides labels Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: configuration Config parsing, validation, schema, defaults, reload, and runtime overrides type: bug Broken behavior and regressions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant