Skip to content

fix: replace hand-rolled emoji regex with emoji library#37

Merged
fmueller merged 1 commit intomainfrom
fix/emoji-regex-codeql
Feb 25, 2026
Merged

fix: replace hand-rolled emoji regex with emoji library#37
fmueller merged 1 commit intomainfrom
fix/emoji-regex-codeql

Conversation

@fmueller
Copy link
Owner

Summary

  • Replaces the _EMOJI_PATTERN regex in feedback.py with the emoji library's replace_emoji() function
  • The hand-rolled regex used overly broad Unicode ranges (e.g. \U0001f300-\U0001f5ff) that include unassigned codepoints, triggering 10 CodeQL py/overly-large-range alerts
  • The emoji library maintains an up-to-date emoji database and avoids this issue entirely

Test plan

  • All existing strip_emojis tests pass unchanged (common emojis, flags, skin tones, empty strings, punctuation)
  • uv run ruff check clean
  • uv run mypy clean
  • uv run pytest — 196 tests pass

🤖 Generated with Claude Code

The _EMOJI_PATTERN regex used overly broad Unicode ranges that included
unassigned codepoints, triggering CodeQL py/overly-large-range alerts.
Use the emoji library's replace_emoji() instead, which maintains an
up-to-date emoji database.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fmueller fmueller merged commit 4e41940 into main Feb 25, 2026
6 checks passed
@fmueller fmueller deleted the fix/emoji-regex-codeql branch February 25, 2026 13:50
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