Regular expression for matching Unix shebang lines at the beginning of files
88
{
"context": "This criteria evaluates the engineer's ability to use the shebang-regex package to detect shebang lines in script content. The focus is on proper import/require of the package and correct usage of the regex test() method for shebang presence detection.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Package import",
"description": "Correctly imports or requires the shebang-regex package (e.g., `const shebangRegex = require('shebang-regex')` or `import shebangRegex from 'shebang-regex'`)",
"max_score": 15
},
{
"name": "test() method usage",
"description": "Uses the shebangRegex.test() method to check for shebang presence in the hasShebang function",
"max_score": 30
},
{
"name": "Correct return type",
"description": "Returns a boolean value from hasShebang function based on shebang-regex test result",
"max_score": 15
},
{
"name": "Array filtering implementation",
"description": "Uses shebangRegex.test() within the filterScriptsWithShebang function to filter the array of files",
"max_score": 25
},
{
"name": "Proper content access",
"description": "Correctly accesses the 'content' property from file objects when testing for shebangs in filterScriptsWithShebang",
"max_score": 15
}
]
}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