Repository navigation
fix: fixup parsing negative numbers and quoted strings - #6250
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6250 +/- ##
==========================================
+ Coverage 81.93% 82.12% +0.18%
==========================================
Files 64 64
Lines 4866 4922 +56
Branches 1100 1086 -14
==========================================
+ Hits 3987 4042 +55
- Misses 879 880 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5 tasks done
Member
Author
|
Without this fix, one new test is broken, and 11 others fail. Skipping the broken |
mark-wiemer
commented
Aug 29, 2026
mark-wiemer
commented
Aug 29, 2026
mark-wiemer
commented
Aug 29, 2026
mark-wiemer
commented
Aug 29, 2026
mark-wiemer
commented
Aug 29, 2026
mark-wiemer
commented
Aug 29, 2026
mark-wiemer
marked this pull request as ready for review
August 29, 2026 20:41
JoshuaKGoldberg
approved these changes
Aug 31, 2026
JoshuaKGoldberg
left a comment
Member
There was a problem hiding this comment.
This does seem like an unfortunate amount of code to take internally rather than just use something like yargs-parser 🙃. But yargs-parser is big and I couldn't find another parser that's (a) well-maintained (b) not big (c) handles the cases we need. Ah well.
LGTM! ✅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
status: accepting prsOverview
We naively split args on single spaces earlier, which ignored cases like quoted strings, tabs, and more.
We also rejected negative numbers and dash-prefixed option values (
--grep -foois rejected in 12 RC 6), where Mocha 11 does not reject these cases.This PR adds a
splitArgshelper to handle these cases better and the same as Mocha 11.