{"record":{"id":"cae90338ba76946b","repo":"pbakaus/impeccable","slug":"pass-a-glob-e-g-impeccable-command-hooks-igno","errorCode":null,"errorMessage":"Pass a glob, e.g. ${IMPECCABLE_COMMAND} hooks ignore-file \"src/legacy/**\"","messagePattern":"Pass a glob, e\\.g\\. (.+?) hooks ignore-file \"src/legacy/\\*\\*\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"skill/scripts/hook-admin.mjs","lineNumber":621,"sourceCode":"      throw new Error(`Unknown ignore-file flag: ${arg}`);\n    } else {\n      positionals.push(arg);\n    }\n  }\n\n  if (shared && local) throw new Error('Pass only one scope flag: --shared or --local');\n  if (positionals.length > 1) throw new Error('Pass exactly one glob to ignore-file');\n\n  return {\n    glob: positionals[0],\n    local,\n  };\n}\n\nfunction addIgnoreFile(cwd, args) {\n  const parsed = parseIgnoreFileArgs(args);\n  const glob = parsed.glob;\n  if (!glob) throw new Error(`Pass a glob, e.g. ${IMPECCABLE_COMMAND} hooks ignore-file \"src/legacy/**\"`);\n  const config = mergeDetectorConfig(readRawDetectorConfig(cwd, { local: parsed.local }));\n  if (!config.ignoreFiles.includes(glob)) config.ignoreFiles.push(glob);\n  const target = writeDetectorConfig(cwd, config, { local: parsed.local });\n  const scope = parsed.local ? 'local detector.ignoreFiles' : 'shared detector.ignoreFiles';\n  return `Added \"${glob}\" to ${scope} (${path.relative(cwd, target) || target}). Current: ${config.ignoreFiles.join(', ')}`;\n}\n\n// An empty glob used to be dropped by filter(Boolean), so `--file=` reported\n// success and wrote an entry with no files: the user asked to scope a rule to one\n// file and silently got the project-wide suppression instead. Refuse it.\nfunction requireGlob(raw, flag) {\n  const glob = String(raw ?? '').trim();\n  if (!glob) throw new Error(`${flag} requires a non-empty glob`);\n  // A following flag is not a glob. `--file --reason \"why\"` consumed `--reason`\n  // as the scope and left the reason text to fold into the value, storing\n  // value=\"* why\" files=[\"--reason\"] and reporting success. Same silent-no-op\n  // class as an unknown flag folding into the value; refuse it the same way.\n  if (glob.startsWith('--')) throw new Error(`${flag} requires a glob, got the flag ${glob}`);","sourceCodeStart":603,"sourceCodeEnd":639,"githubUrl":"https://github.com/pbakaus/impeccable/blob/f88b2837a7d7c3182e46307bbbb091a1ed547571/skill/scripts/hook-admin.mjs#L603-L639","documentation":"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.","triggerScenarios":"`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.","commonSituations":"Running the bare subcommand to list current ignores (it does not list — it only adds); agent omitting the required argument.","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."],"exampleFix":"# before\nimpeccable hooks ignore-file --shared\n\n# after\nimpeccable hooks ignore-file \"src/legacy/**\" --shared","handlingStrategy":"validation","validationCode":"const positional = args.find(a => !a.startsWith('--'));\nif (!positional) { console.error('usage: hooks ignore-file <glob> [--shared|--local]'); process.exit(2); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["cli","missing-argument","hook-admin","ignore-file"],"backgroundTag":"missing-required-argument","analyzedSha":"f88b2837a7d7c3182e46307bbbb091a1ed547571","analyzedAt":"2026-08-18T04:58:36.608Z","contentChangedAt":"2026-08-18T04:58:36.608Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}