-
Notifications
You must be signed in to change notification settings - Fork 91
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
c8 upgrade from 8.0.0 to 8.0.1 seems to break --exclude on Windows when value is single-quoted in npm script #488
Comments
There weren't any significant changes to logic between Could you use npm overrides to experiment with the older version of |
Overriding Overriding Both Nothing relevant stands out for me in the release notes:
It would be nice for |
Oh, you're a |
FYI, overriding ONLY |
@DavidAnson sorry to keep giving you work, but out of curiosity does it break with yargs pinned to It might also be worth trying:
I'm wondering if, in Windows only, perhaps the tokens are being parsed as |
I think you meant to override and force https://github.com/DavidAnson/markdownlint/actions/runs/5697905729 Overriding it to https://github.com/DavidAnson/markdownlint/actions/runs/5697924507 Here’s the diff of those two releases; it includes the commit you called out: yargs/yargs-parser@yargs-parser-v20.2.9...yargs-parser-v21.0.0 Removing the single quotes around the glob paths on https://github.com/DavidAnson/markdownlint/actions/runs/5697947307 However, my understanding is that single-quoting glob paths as I do is a best practice because without the quotes, the user’s shell expands each glob and running on different shells/platforms can lead to unpredictable behavior. By single-quoting the path, it’s passed to the tool as-is and the tool can apply consistent globbing logic. |
@bcoe, I think you're right about that commit. Previously, On macOS (and presumably Linux), the npm script command line with single quotes comes in via |
Ironically, it turns out I don't need either |
@DavidAnson I think we're perhaps thinking the same thing, which is that the input still has quotes when passed to the glob engine? I think we'd probably be safe to do some preprocessing in c8 and remove wrapping quotes, what do you think? |
This kind of platform-specific stuff scares me. I maintain a CLI as well and include some pretty intricate directions for getting consistent behavior for arguments, but this issue makes me worry I missed something. https://github.com/DavidAnson/markdownlint-cli2#command-line I don't use a command-line parsing library in that project, but I thought this was one of the big reasons to do so. I'm bummed to find using something as prominent as yargs isn't an easy solution. |
Ooookay. This was bothering me, so I did more experimentation. Here's receipts: https://github.com/DavidAnson/markdownlint-cli2/actions/runs/5734878989/job/15541764773 I'd summarize the key points as follows (as observed in GitHub's Actions environment):
It's this last point that led to the failure behind this issue as my scenario invokes Do with this as you wish. :) My recommendation for |
I think that the best way to deal with this kind of inconsistencies (both glob patterns and quotes in the command line) would be passing Lines 37 to 45 in a13584d
That's basically the reason why |
We need to turn #488 (comment) into integration tests IMO, and then fix. |
c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --exclude 'test/**' --exclude 'micromark/**' npm test
Failing CI run for this change due to lack of 100% coverage for excluded test files:
https://github.com/DavidAnson/markdownlint/actions/runs/5664137721
Passing CI run with 8.0.0 for comparison:
https://github.com/DavidAnson/markdownlint/actions/runs/5664138479
The text was updated successfully, but these errors were encountered: