- Notifications
You must be signed in to change notification settings - Fork 3.8k
chore: upgrade tap@21 #8085
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
chore: upgrade tap@21 #8085
Conversation
| @@ -70,7 +70,7 @@ | |||
| | |||
| t.ok(PJ_CALLED.endsWith('/pkg')) | |||
| t.strictSame(RUN_SCRIPT_EXEC, 'shell-command') | |||
| t.match(output, /Exploring \{CWD\}\/[\w-_/]+\nType 'exit' or \^D when finished/) | |||
| t.match(output, /Exploring \{CWD\}\/(.+)+\nType 'exit' or \^D when finished/) | |||
Check failure
Code scanning / CodeQL
Inefficient regular expression High test
Show autofix suggestion Hide autofix suggestion
Copilot Autofix
AI 9 months ago
To fix the problem, we need to modify the regular expression to remove the ambiguity that causes exponential backtracking. Specifically, we can replace the .+ pattern with a more specific pattern that avoids ambiguity. In this case, we can use [^/]+ to match one or more characters that are not a forward slash, which aligns with the intended use of the regular expression.
- Modify the regular expression on line 73 to use
[^/]+instead of.+. - Ensure that the new pattern still matches the intended strings without causing performance issues.
-
Copy modified line R73
| @@ -72,3 +72,3 @@ | ||
| t.strictSame(RUN_SCRIPT_EXEC, 'shell-command') | ||
| t.match(output, /Exploring \{CWD\}\/(.+)+\nType 'exit' or \^D when finished/) | ||
| t.match(output, /Exploring \{CWD\}\/([^/]+)+\nType 'exit' or \^D when finished/) | ||
| }) |
| @@ -83,7 +83,7 @@ | |||
| | |||
| t.ok(PJ_CALLED.endsWith('/pkg')) | |||
| t.strictSame(RUN_SCRIPT_EXEC, 'shell-command') | |||
| t.match(output, /Exploring \{CWD\}\/[\w-_/]+\nType 'exit' or \^D when finished/) | |||
| t.match(output, /Exploring \{CWD\}\/(.+)+\nType 'exit' or \^D when finished/) | |||
Check failure
Code scanning / CodeQL
Inefficient regular expression High test
Show autofix suggestion Hide autofix suggestion
Copilot Autofix
AI 9 months ago
To fix the problem, we need to modify the regular expression to remove the nested quantifiers that cause exponential backtracking. The best way to do this is to replace (.+)+ with a more specific pattern that avoids ambiguity. In this case, we can use ([^/]+) to match one or more characters that are not a forward slash, which achieves the same goal without the risk of catastrophic backtracking.
-
Copy modified line R73 -
Copy modified line R86
| @@ -72,3 +72,3 @@ | ||
| t.strictSame(RUN_SCRIPT_EXEC, 'shell-command') | ||
| t.match(output, /Exploring \{CWD\}\/(.+)+\nType 'exit' or \^D when finished/) | ||
| t.match(output, /Exploring \{CWD\}\/([^/]+)\nType 'exit' or \^D when finished/) | ||
| }) | ||
| @@ -85,3 +85,3 @@ | ||
| t.strictSame(RUN_SCRIPT_EXEC, 'shell-command') | ||
| t.match(output, /Exploring \{CWD\}\/(.+)+\nType 'exit' or \^D when finished/) | ||
| t.match(output, /Exploring \{CWD\}\/([^/]+)\nType 'exit' or \^D when finished/) | ||
| |
| the core cli tests are passing but these aren't represented now in their own |
apart of: npm/statusboard#913
Outline of Changes (all of these don't need to be in this PR and can be broken down individually)
t.mocktot.mockRequiretap.excludein package.jsonnode_modulesis dirty and needs updates fromnpa(should be in another pr)./node_modules/minipass/dist/commonjs/index.js.mapchecked in to run correctly.mapfiles withinnode_modules, currently we don't check in.md,.ts, and.map(should be in another pr)