-
Notifications
You must be signed in to change notification settings - Fork 55
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
fix: masterable check for modular parts and Pets #663
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe changes in this pull request enhance the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
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 (
|
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: 2
🧹 Outside diff range and nitpick comments (1)
build/parser.mjs (1)
1076-1078
: Consider splitting the complex regex pattern for better maintainabilityThe current regex pattern combines multiple conditions which may be hard to maintain. Consider splitting it into separate patterns or using constants for better readability.
- const regex = - /^((?=.*Amp)|(?=.*Modular))(?=.*Barrel).*$|^(?=.*Pet)(?=.*Head).*$|PetPowerSuit|PvPVariantTip|^(?=.*Hoverboard)(?=.*Deck).*$/; + const MASTERABLE_PATTERNS = { + MODULAR_BARREL: /^((?=.*Amp)|(?=.*Modular))(?=.*Barrel).*$/, + PET_HEAD: /^(?=.*Pet)(?=.*Head).*$/, + PET_POWER_SUIT: /PetPowerSuit/, + PVP_VARIANT: /PvPVariantTip/, + HOVERBOARD_DECK: /^(?=.*Hoverboard)(?=.*Deck).*$/ + }; + + item.masterable = Object.values(MASTERABLE_PATTERNS).some(pattern => + pattern.test(item.uniqueName) + );
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
build/parser.mjs
(1 hunks)
🧰 Additional context used
🪛 eslint
build/parser.mjs
[error] 1075-1075: Expected '===' and instead saw '=='.
(eqeqeq)
🪛 GitHub Check: Lint
build/parser.mjs
[failure] 1075-1075:
Expected '===' and instead saw '=='
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.
coderabbit covered my only concern, if you could fix the lint thing, probably good to go
Whoops my bad, was switching between languages |
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
build/parser.mjs
(1 hunks)config/masterableCategories.json
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- build/parser.mjs
🔇 Additional comments (1)
config/masterableCategories.json (1)
3-12
: Verify if categories array needs updates for new masterable items
The categories array should be reviewed to ensure it includes all relevant item types mentioned in the PR objectives.
Let's verify if we need categories for the new masterable items:
🎉 This PR is included in version 1.1265.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What did you fix?
Checks masterablity for more complicated parts
For pets there are a lot of items that belong to the
Pets
category and are alsoPet Resources
so the regex matches based on the uniquename containingPetPowerSuit
, this way we can target certain items in the category without breaking the previous implementation if we were to addPets
tomasterableCategories
For Modular parts only certain pieces contribute to mastery
Here is a break down of the regex with the unique names I tested against https://regex101.com/r/H7LXrd/1
Reproduction steps
Evidence/screenshot/link to line
Considerations
Summary by CodeRabbit
New Features
Bug Fixes
Tests