- Notifications
You must be signed in to change notification settings - Fork3.5k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:latest
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
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 suggestionHide autofix suggestion
Copilot Autofix
AI 5 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.
@@ -72,3 +72,3 @@ | ||
t.strictSame(RUN_SCRIPT_EXEC,'shell-command') | ||
t.match(output,/Exploring\{CWD\}\/(.+)+\nType'exit'or\^Dwhenfinished/) | ||
t.match(output,/Exploring\{CWD\}\/([^/]+)+\nType'exit'or\^Dwhenfinished/) | ||
}) |
@@ -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 suggestionHide autofix suggestion
Copilot Autofix
AI 5 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.
@@ -72,3 +72,3 @@ | ||
t.strictSame(RUN_SCRIPT_EXEC,'shell-command') | ||
t.match(output,/Exploring\{CWD\}\/(.+)+\nType'exit'or\^Dwhenfinished/) | ||
t.match(output,/Exploring\{CWD\}\/([^/]+)\nType'exit'or\^Dwhenfinished/) | ||
}) | ||
@@ -85,3 +85,3 @@ | ||
t.strictSame(RUN_SCRIPT_EXEC,'shell-command') | ||
t.match(output,/Exploring\{CWD\}\/(.+)+\nType'exit'or\^Dwhenfinished/) | ||
t.match(output,/Exploring\{CWD\}\/([^/]+)\nType'exit'or\^Dwhenfinished/) | ||
the core cli tests are passing but these aren't represented now in their own |
Uh oh!
There was an error while loading.Please reload this page.
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.mock
tot.mockRequire
tap.exclude
in package.jsonnode_modules
is dirty and needs updates fromnpa
(should be in another pr)./node_modules/minipass/dist/commonjs/index.js.map
checked in to run correctly.map
files withinnode_modules
, currently we don't check in.md
,.ts
, and.map
(should be in another pr)