pbakaus/impeccable · error
Pass a glob, e.g. hooks ignore-file "src/legacy/**
Error message
Pass a glob, e.g. ${IMPECCABLE_COMMAND} hooks ignore-file "src/legacy/**" What it means
Thrown by addIgnoreFile when no positional glob was provided. The command needs a glob to append to detector.ignoreFiles; with none there is nothing to write, and refusing keeps the user from believing a suppression was added when it was not.
Solutions
- Pass one glob positional: `hooks ignore-file "src/legacy/**"`.
- Remember the glob is positional, not a --file flag (that flag belongs to ignore-value).
- To inspect current ignores instead of adding one, read the detector config file directly.
Example fix
# before impeccable hooks ignore-file --shared # after impeccable hooks ignore-file "src/legacy/**" --shared
Defensive patterns
Strategy: validation
Validate before calling
const positional = args.find(a => !a.startsWith('--'));
if (!positional) { console.error('usage: hooks ignore-file <glob> [--shared|--local]'); process.exit(2); } Prevention
- ignore-file adds; it does not list — read the detector config to inspect current globs.
- The glob is a positional argument; --file belongs to ignore-value.
When it happens
Trigger: `hooks ignore-file` with no arguments; `hooks ignore-file --shared` (scope flag but no glob); `hooks ignore-file --local --reason=` style inversions where the glob was expected to come from a flag.
Common situations: Running the bare subcommand to list current ignores (it does not list — it only adds); agent omitting the required argument.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Pass a rule id and value, e.g.
- Pass a rule id, e.g.
- Pass exactly one glob to ignore-file
- Pass only one scope flag: --shared or --local
- --reason is not supported for ignore-file because…
AI-assisted analysis of pbakaus/impeccable@f88b2837a7 (2026-08-18).
Data as JSON: /api/errors/cae90338ba76946b.
Report an issue: GitHub.
Appendix: source
Thrown at skill/scripts/hook-admin.mjs:621
throw new Error(`Unknown ignore-file flag: ${arg}`);
} else {
positionals.push(arg);
}
}
if (shared && local) throw new Error('Pass only one scope flag: --shared or --local');
if (positionals.length > 1) throw new Error('Pass exactly one glob to ignore-file');
return {
glob: positionals[0],
local,
};
}
function addIgnoreFile(cwd, args) {
const parsed = parseIgnoreFileArgs(args);
const glob = parsed.glob;
if (!glob) throw new Error(`Pass a glob, e.g. ${IMPECCABLE_COMMAND} hooks ignore-file "src/legacy/**"`);
const config = mergeDetectorConfig(readRawDetectorConfig(cwd, { local: parsed.local }));
if (!config.ignoreFiles.includes(glob)) config.ignoreFiles.push(glob);
const target = writeDetectorConfig(cwd, config, { local: parsed.local });
const scope = parsed.local ? 'local detector.ignoreFiles' : 'shared detector.ignoreFiles';
return `Added "${glob}" to ${scope} (${path.relative(cwd, target) || target}). Current: ${config.ignoreFiles.join(', ')}`;
}
// An empty glob used to be dropped by filter(Boolean), so `--file=` reported
// success and wrote an entry with no files: the user asked to scope a rule to one
// file and silently got the project-wide suppression instead. Refuse it.
function requireGlob(raw, flag) {
const glob = String(raw ?? '').trim();
if (!glob) throw new Error(`${flag} requires a non-empty glob`);
// A following flag is not a glob. `--file --reason "why"` consumed `--reason`
// as the scope and left the reason text to fold into the value, storing
// value="* why" files=["--reason"] and reporting success. Same silent-no-op
// class as an unknown flag folding into the value; refuse it the same way.
if (glob.startsWith('--')) throw new Error(`${flag} requires a glob, got the flag ${glob}`);View on GitHub (pinned to f88b2837a7)