-
-
Notifications
You must be signed in to change notification settings - Fork 18
Remove quotes in parsed reaper plugin name #385
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
WalkthroughThe PR fixes a parsing bug where REAPER project filenames containing spaces are incorrectly extracted. The parser now strips surrounding quotes from the filename field during extraction. Test resources are updated with test cases containing spaces in filenames, and assertions validate correct parsing. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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
🧹 Nitpick comments (1)
owlplug-parsers/src/main/java/com/owlplug/parsers/reaper/PluginNodeListener.java (1)
58-61: Fix correctly resolves issue #384.The quote-stripping logic now applies to the filename field, matching the existing approach used for the name field (line 56). This resolves the parsing issue where filenames with spaces (which must be quoted in .rpp files) were incorrectly parsed with leading quotes.
Consider stripping only surrounding quotes for precision.
The current
replaceAll("\"", "")removes ALL quote characters from the string, including any that might appear in the middle of a filename. While this is consistent with the name field handling and quotes in filenames are rare (often disallowed), a more precise approach would strip only surrounding quotes:- plugin.setFilename(ctx.value(1).getText().replaceAll("\"", "")); + String filename = ctx.value(1).getText(); + if (filename.startsWith("\"") && filename.endsWith("\"") && filename.length() > 1) { + filename = filename.substring(1, filename.length() - 1); + } + plugin.setFilename(filename);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
owlplug-parsers/src/main/java/com/owlplug/parsers/reaper/PluginNodeListener.java(1 hunks)owlplug-parsers/src/test/java/com/owlplug/parsers/reaper/ReaperProjectGrammarTest.java(2 hunks)owlplug-parsers/src/test/resources/reaper/reaper7.rpp(1 hunks)owlplug-parsers/src/test/resources/reaper/simpleReaperFile.rpp(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (5)
owlplug-parsers/src/test/resources/reaper/simpleReaperFile.rpp (1)
6-6: Good test case addition.The updated ATTRIBUTE line now includes both quoted and unquoted values, plus a value with spaces (
"test with spaces"), which provides better coverage for the quote-stripping logic.owlplug-parsers/src/test/resources/reaper/reaper7.rpp (1)
205-205: Excellent test case for the reported issue.The updated filename
"Dexed_x64-with space.dll"directly reproduces the issue #384 scenario where plugin names with spaces are enclosed in quotes in .rpp files. This validates the quote-stripping fix.owlplug-parsers/src/test/java/com/owlplug/parsers/reaper/ReaperProjectGrammarTest.java (2)
73-75: Comprehensive test coverage for the fix.The new filename assertions validate both simple filenames (line 73) and filenames with spaces (line 75). The assertion on line 75 specifically tests the fix for issue #384, confirming that
"Dexed_x64-with space.dll"(quoted in the .rpp file) is correctly parsed asDexed_x64-with space.dll(without quotes).
99-101: Good test validation for additional files.The filename assertions for the advanced reaper file ensure the fix works consistently across different test resources.
owlplug-parsers/src/main/java/com/owlplug/parsers/reaper/PluginNodeListener.java (1)
62-65: The review comment's concern is unfounded—the code is correct as-is.Verification confirms that rawId values in .rpp files are not quoted (e.g.,
2117771985{5653545466733474756E656669736834},1147500644<56535444657864646578656400000000>). The code correctly does not strip quotes from rawId because there are no quotes to strip. Unlike name and filename fields which are quoted in the format, rawId values are bare composite identifiers or numbers. The implementation is consistent with the actual .rpp file format.Likely an incorrect or invalid review comment.
Resolve #384