Skip to content

fix(config): split domainKeyRe into separate domain and key regexes#54

Merged
fullstackjam merged 1 commit intomainfrom
fix/split-macos-domain-key-regex
May 5, 2026
Merged

fix(config): split domainKeyRe into separate domain and key regexes#54
fullstackjam merged 1 commit intomainfrom
fix/split-macos-domain-key-regex

Conversation

@fullstackjam
Copy link
Copy Markdown
Collaborator

Summary

Context

#53 correctly allowed spaces in macOS preference keys (e.g. NSStatusItem Visible Sound), but because the same regex was used for both domains and keys, spaces became valid in domains too (e.g. com.apple dock). This follow-up fixes the over-permissiveness without changing any user-facing behaviour.

Test plan

  • go test -run TestValidateMacOSPrefs ./internal/config/... passes
  • TestValidateMacOSPrefs_InvalidDomainCharacters now uses a space in the domain (correctly rejected)
  • TestValidateMacOSPrefs_KeyWithSpaces still passes (spaces in keys still allowed)

Spaces are valid in macOS preference keys (e.g. "NSStatusItem Visible Sound")
but not in domains. The shared domainKeyRe introduced in #53 allowed spaces
in both. Split into domainRe (no spaces) and keyRe (spaces allowed), and
restore the domain-with-space test case that was inadvertently dropped.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

👋 Thanks for opening this pull request!

Before merging:

  • Code follows existing patterns in the codebase
  • go build ./... and go vet ./... pass
  • Commit message is clear and descriptive

@fullstackjam will review this soon. Thanks for contributing! 🚀

@github-actions github-actions Bot added the tests Tests only label May 5, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullstackjam fullstackjam merged commit a246be4 into main May 5, 2026
10 checks passed
@fullstackjam fullstackjam deleted the fix/split-macos-domain-key-regex branch May 5, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant