Skip to content

code health: enum_string_switch advisory - #668

Merged
dayfine merged 1 commit into
agentsfrom
agents-enum-string-lint
Nov 19, 2026
Merged

dayfine merged 1 commit into
agentsfrom
agents-enum-string-lint

Conversation

@dayfine

@dayfine dayfine commented Nov 19, 2026

Copy link
Copy Markdown
Owner

A hand-written enum-to-string switch (screen_event_name, warp_fade_name in #667) slipped through review. This adds an advisory enum_string_switch to review_rules.py: on added lines, a switch over Enum::VALUE cases whose every case returns a string literal is reported with a pointer to EnumStringMap<T>; the reverse direction is not checked. Tested with the code_health self-tests (one hit, one miss), on #667's ScreenEvents.cpp at 5ce86af (both functions fire, fade_events does not) and over origin/main (0 hits; int switches like HttpServer's status names are skipped).

…ing switches

A switch over Enum::VALUE cases whose every case returns a string literal
should use EnumStringMap<T>; it slipped through in fork #667
(screen_event_name, warp_fade_name).
@dayfine
dayfine marked this pull request as ready for review November 19, 2026 06:13
@dayfine
dayfine merged commit 06e7f0c into agents Nov 19, 2026
1 check passed
@dayfine
dayfine deleted the agents-enum-string-lint branch November 19, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant