-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add comma to boundary for domains #1116
Conversation
WalkthroughThe changes in this pull request involve modifications to the Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Performance Comparison ReportSignificant Changes To DurationThere are no entries Meaningless Changes To DurationShow entries
Show details
Render Count ChangesThere are no entries Render IssuesThere are no entries Added ScenariosThere are no entries Removed ScenariosThere are no entries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
utils/regex.ts (2)
1-1
: Update the comment to include the comma boundary.The regex pattern has been correctly updated to include a comma as a valid boundary character, but the inline comment should be updated to reflect this change.
-const BOUNDARY_START_LOOKBEHIND = /(\s|\(|"|'|,)/.source; // Either a space or a (, or a " or a ' +const BOUNDARY_START_LOOKBEHIND = /(\s|\(|"|'|,)/.source; // Either a space, (, ", ', or ,
3-3
: Update the comment to include the comma boundary.The regex pattern has been correctly updated to include a comma as a valid boundary character, but the inline comment should be updated to reflect this change.
-const BOUNDARY_END_LOOKAHEAD = /(\s|\)|$|\.|!|\?|\r\n|\r|\n|"|'|,)/.source; // Either a space, the end of the text, or a ), a ., a !, a ?, a line break, or a " or a ' +const BOUNDARY_END_LOOKAHEAD = /(\s|\)|$|\.|!|\?|\r\n|\r|\n|"|'|,)/.source; // Either a space, end of text, ), ., !, ?, line break, ", ', or ,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- utils/conversation.ts (1 hunks)
- utils/regex.ts (1 hunks)
🔇 Additional comments (3)
utils/regex.ts (1)
1-3
: Verify the impact on domain matching behavior.The addition of commas as valid boundaries appears correct for supporting comma-separated lists of domains. Let's verify this doesn't introduce any regressions.
utils/conversation.ts (2)
274-274
: LGTM: Error message translation looks good!The error message translation is properly implemented, maintaining consistency with the error handling flow and correctly including the peer's identity in the message.
274-274
: Request for additional files to reviewThe PR title mentions adding comma to boundary for domains, but the regex changes in
utils/regex.ts
are not included in the files for review. Could you please includeutils/regex.ts
in the review to ensure the boundary changes are properly implemented?✅ Verification successful
Regex changes for domain boundaries are properly implemented
The changes in
utils/regex.ts
show that comma (,
) is correctly included in both boundary definitions:
BOUNDARY_START_LOOKBEHIND
includes comma in its pattern:(\s|\(|"|'|,)
BOUNDARY_END_LOOKAHEAD
includes comma in its pattern:(\s|\)|$|\.|!|\?|\r\n|\r|\n|"|'|,)
These changes ensure proper handling of comma-separated domain names in the text.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check the regex changes in utils/regex.ts # Test: Look for BOUNDARY related constants rg -l 'BOUNDARY_(START_LOOKBEHIND|END_LOOKAHEAD)'Length of output: 66
Script:
#!/bin/bash # Let's check the actual content of utils/regex.ts to see the regex changes cat utils/regex.tsLength of output: 1917
Summary by CodeRabbit
New Features
Bug Fixes
These updates aim to enhance user experience by ensuring more informative alerts and refining text processing capabilities.