pbakaus/impeccable · error · Error
${arg} requires a glob
Error message
${arg} requires a glob What it means
Thrown by parseIgnoreValueArgs() when `--file` or `--files` is the very last argument (no token follows it at all). Distinct from the empty-glob case: here there is no next value to inspect, so Impeccable refuses rather than reading past the end.
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 d14711ae3d)
Solutions
- Append a glob after the flag: `... --file "src/widget.css"`.
- Switch to the equals form `--file="src/widget.css"` so a missing value is caught earlier and unambiguously.
- Audit the script/alias that builds the command to confirm the glob token is always emitted after --file.
Example fix
// before impeccable hooks ignore-value overused-font Inter --file // after impeccable hooks ignore-value overused-font Inter --file "src/widget.css"
Defensive patterns
Strategy: validation
Validate before calling
// Ensure --file is never the last token.
const i = args.indexOf('--file');
if (i !== -1 && (i + 1 >= args.length || String(args[i + 1]).startsWith('--'))) {
throw new Error('--file must be followed by a glob');
} Type guard
function hasValueAfter(args, flag) {
const i = args.indexOf(flag);
return i !== -1 && i + 1 < args.length && !String(args[i + 1]).startsWith('--');
} Prevention
- Construct commands so --file is always paired with its value in one step.
- Use the equals form --file=<glob> to avoid the dangling-flag case.
When it happens
Trigger: A command that ends in `--file` or `--files` with nothing after it, e.g. `impeccable hooks ignore-value overused-font Inter --file`.
Common situations: Truncated command (terminal line-wrap, copy-paste cut off), or a script that conditionally appends `--file` but forgets to append the value.
Related errors
- ${flag} requires a non-empty glob
- ${flag} requires a glob, got the flag ${glob}
- Unknown ignore-value flag: ${arg}
- Pass a rule id and value, e.g. ${IMPECCABLE_COMMAND} hooks i
- Wildcard value ignores must be scoped with --file <glob>, e.
AI-assisted analysis of pbakaus/impeccable@d14711ae3d (2026-08-13).
Data as JSON: /api/errors/9aca7376ae58859f.
Report an issue: GitHub.