-
Notifications
You must be signed in to change notification settings - Fork 63
fix(#837): filter umlaut-e, umlaut-a and * #838
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
Conversation
📝 WalkthroughWalkthroughUpdates the title-casing regex pattern in the parser to exclude additional special characters (é, ā, \*) from capitalization in addition to the previously excluded ö, addressing issues with game names containing these characters. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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: 1
🤖 Fix all issues with AI agents
In @build/parser.mjs:
- Line 30: The .replace call currently contains a malformed regex and misplaced
comma/callback; fix the call by closing the regex literal after \w, add the
global flag (g) to the regex, move the comma so the replacement callback is
passed as the second argument to .replace, and keep the existing callback logic
that uppercases the captured letter (the current anonymous (l) =>
l.toUpperCase() should remain as the second argument to .replace).
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
build/parser.mjs
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-items PR: 663
File: config/masterableCategories.json:1-2
Timestamp: 2024-12-03T23:47:24.677Z
Learning: In the 'warframe-items' repository, when suggesting changes to regex patterns in 'config/masterableCategories.json', ensure that added patterns only include items relevant to the current PR context, and avoid adding items not present in the context.
📚 Learning: 2025-11-28T01:41:19.914Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-items PR: 778
File: build/parser.mjs:568-574
Timestamp: 2025-11-28T01:41:19.914Z
Learning: In the WFCD/warframe-items repository, for Nightwave Act processing, the regex difference between `build/parser.mjs` (using `/[0-9]{1,3}$/` with anchor) and `build/build.mjs` (using `/[0-9]{1,3}/` without anchor) is intentional and serves different purposes in each file.
Applied to files:
build/parser.mjs
| str | ||
| .toLowerCase() | ||
| .replace(/(?<!ö)\b\w/g, (l) => l.toUpperCase()) | ||
| .replace(/(?<![öéā*])\b\w, (l) => l.toUpperCase()) |
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.
Critical syntax error in regex pattern.
The regex pattern is malformed and will cause a JavaScript error. The closing / delimiter is missing after \w, the g flag is missing, and the comma and callback function are incorrectly placed inside the pattern.
🐛 Fix the regex syntax
- .replace(/(?<![öéā*])\b\w, (l) => l.toUpperCase())
+ .replace(/(?<![öéā*])\b\w/g, (l) => l.toUpperCase())The correct syntax is:
- Close the regex pattern with
/after\w - Add the
gflag for global replacement - Place the comma after the regex, not inside it
- Then provide the replacement callback function
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| .replace(/(?<![öéā*])\b\w, (l) => l.toUpperCase()) | |
| .replace(/(?<![öéā*])\b\w/g, (l) => l.toUpperCase()) |
🤖 Prompt for AI Agents
In @build/parser.mjs at line 30, The .replace call currently contains a
malformed regex and misplaced comma/callback; fix the call by closing the regex
literal after \w, add the global flag (g) to the regex, move the comma so the
replacement callback is passed as the second argument to .replace, and keep the
existing callback logic that uppercases the captured letter (the current
anonymous (l) => l.toUpperCase() should remain as the second argument to
.replace).
|
Unfortunately, I made a mistake. I'm submitting a new pull request. |
What did you fix?
closes #837
Reproduction steps
See tests
Evidence/screenshot/link to line
Considerations
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.