Add more poisonable steps

This commit is contained in:
Alvaro Muñoz
2024-07-02 23:29:53 +02:00
parent 1281ca8e81
commit 45d51a4d00
2 changed files with 10 additions and 7 deletions

View File

@@ -29,7 +29,7 @@ class LocalScriptExecutionRunStep extends PoisonableStep, Run {
LocalScriptExecutionRunStep() {
exists(string line, string regexp, int group | line = this.getScript().splitAt("\n").trim() |
poisonableLocalScriptsDataModel(regexp, group) and
cmd = line.regexpCapture("(^|\\b|\\s+)" + regexp, group)
cmd = line.regexpCapture(".*(^|\\b|\\s+|\\$\\(|`)" + regexp + "(\\b|\\s+|;|\\)|`|$).*", group)
)
}

View File

@@ -35,6 +35,9 @@ extensions:
- ["npm i(nstall)?"]
- ["npm run"]
- ["npm ci"]
- ["pnpm i(nstall)?"]
- ["pnpm run"]
- ["pnpm ci"]
- ["pre-commit"]
- ["prettier"]
- ["pip install -r"]
@@ -54,10 +57,10 @@ extensions:
extensible: poisonableLocalScriptsDataModel
data:
# TODO: It could also be in the form of `dir/cmd`
- ["(\\.\\/)(.*)(\\s+|;|$)", 3]
- ["(source|sh|bash|zsh|fish)\\s+(.*)(\\s+|;|$)", 3]
- ["(node)\\s+(.*)(\\.js|\\.ts)(\\s+|;|$)", 3]
- ["(python)\\s+(.*)\\.py(\\s+|;|$)", 3]
- ["(ruby)\\s+(.*)\\.rb(\\s+|;|$)", 3]
- ["(go)\\s+(.*)\\.go(\\s+|;|$)", 3]
- ["(\\.\\/)(.*)", 3]
- ["(source|sh|bash|zsh|fish)\\s+(.*)", 3]
- ["(node)\\s+(.*)(\\.js|\\.ts)", 3]
- ["(python)\\s+(.*)\\.py", 3]
- ["(ruby)\\s+(.*)\\.rb", 3]
- ["(go)\\s+(.*)\\.go", 3]