pbakaus/impeccable · error · Error
requires a glob
Error message
${arg} requires a glob What it means
Thrown by parseIgnoreValueArgs when --file or --files is the very last token of the `hooks ignore-value` argument list — there is no next argument to consume as a glob. The parser checks `i + 1 >= args.length` before consuming, so a trailing value-taking flag is rejected instead of reading undefined.
Solutions
- Append the glob after the flag: `--file "src/legacy/**"`.
- Or switch to the attached form `--file="src/legacy/**"` which cannot be separated from its value.
- Audit generated command lines for value-taking flags at the last position before executing them.
Example fix
# before impeccable hooks ignore-value overused-font Inter --file # after impeccable hooks ignore-value overused-font Inter --file "src/legacy/**"
Defensive patterns
Strategy: validation
Validate before calling
function finalizeArgs(args) {
const last = args[args.length - 1];
if (last === '--file' || last === '--files' || last === '--reason') {
throw new Error(`trailing value-taking flag ${last}; attach the value with = instead`);
}
return args;
} Prevention
- Prefer attached forms (--file=x, --reason=x) in generated command lines — they cannot be split from their values.
- Validate that no value-taking flag is the final token before executing a built command.
When it happens
Trigger: `hooks ignore-value overused-font Inter --file` (command truncated or glob forgotten); scripts appending --file conditionally while always omitting the value when a variable is empty; `--files` at end of a long command that was line-wrapped and lost its argument.
Common situations: Truncated command lines in logs or chat relays; agents emitting the flag skeleton before filling in values; copy-paste losing the last token.
Related errors
- requires a glob, got the flag
- requires a non-empty glob
- Pass a rule id and value, e.g.
- Unknown ignore-value flag
- Wildcard value ignores must be scoped with --file
AI-assisted analysis of pbakaus/impeccable@f88b2837a7 (2026-08-18).
Data as JSON: /api/errors/9aca7376ae58859f.
Report an issue: GitHub.
Appendix: source
Thrown at skill/scripts/hook-admin.mjs:665
let local = false;
let reason = '';
for (let i = 0; i < args.length; i++) {
const arg = String(args[i] || '');
if (arg === '--shared') {
shared = true;
} else if (arg === '--local') {
local = true;
} else if (arg === '--reason') {
const chunks = [];
while (i + 1 < args.length && !String(args[i + 1]).startsWith('--')) {
chunks.push(args[++i]);
}
reason = chunks.join(' ').trim();
} else if (arg.startsWith('--reason=')) {
reason = arg.slice('--reason='.length).trim();
} else if (arg === '--file' || arg === '--files') {
if (i + 1 >= args.length) throw new Error(`${arg} requires a glob`);
files.push(requireGlob(args[++i], arg));
} else if (arg.startsWith('--file=')) {
files.push(requireGlob(arg.slice('--file='.length), '--file'));
} else if (arg.startsWith('--files=')) {
files.push(requireGlob(arg.slice('--files='.length), '--files'));
} else if (arg.startsWith('--')) {
// Otherwise a typo folds into the value: `ignore-value overused-font Inter
// --shard` stored the value "inter --shard", which matches no finding, and
// reported success. Matches `impeccable ignores add-value`.
throw new Error(`Unknown ignore-value flag: ${arg}`);
} else {
positionals.push(arg);
}
}
const [rule, ...valueParts] = positionals;
return {
rule: String(rule || '').trim().toLowerCase(),View on GitHub (pinned to f88b2837a7)