Regular expression for matching Unix shebang lines at the beginning of files
88
{
"context": "This criteria evaluates how well the engineer uses the shebang-regex package to detect and extract shebang lines, particularly focusing on understanding the greedy capture pattern for complex interpreter specifications with arguments.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses shebangRegex",
"description": "Imports and uses the shebangRegex package to match shebang lines in the script content.",
"max_score": 20
},
{
"name": "Uses test method",
"description": "Uses the shebangRegex.test() method to check if a shebang exists at the beginning of the script content.",
"max_score": 15
},
{
"name": "Uses exec method",
"description": "Uses the shebangRegex.exec() method to extract the shebang line and capture groups from the script content.",
"max_score": 20
},
{
"name": "Extracts full shebang",
"description": "Correctly extracts the complete shebang line including #! using shebangRegex.exec()[0].",
"max_score": 10
},
{
"name": "Extracts interpreter path",
"description": "Correctly extracts the interpreter path without #! using the capture group shebangRegex.exec()[1].",
"max_score": 15
},
{
"name": "Parses greedy capture",
"description": "Correctly parses the greedy capture group content (the full interpreter directive with arguments) to separate the interpreter command from its arguments.",
"max_score": 20
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-shebang-regexdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9