{"record":{"id":"4b189de2f3d86df4","repo":"pbakaus/impeccable","slug":"unknown-ignore-file-flag-arg","errorCode":null,"errorMessage":"Unknown ignore-file flag: ${arg}","messagePattern":"Unknown ignore-file flag: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"skill/scripts/hook-admin.mjs","lineNumber":603,"sourceCode":"  writeDetectorConfig(cwd, config);\n  return `Added \"${rule}\" to detector.ignoreRules. Current: ${config.ignoreRules.join(', ')}`;\n}\n\nfunction parseIgnoreFileArgs(args) {\n  const positionals = [];\n  let shared = false;\n  let local = false;\n\n  for (const raw of args) {\n    const arg = String(raw || '');\n    if (arg === '--shared') {\n      shared = true;\n    } else if (arg === '--local') {\n      local = true;\n    } else if (arg === '--reason' || arg.startsWith('--reason=')) {\n      throw new Error('--reason is not supported for ignore-file because detector.ignoreFiles stores globs only; use ignore-value when a documented rule-specific exception fits');\n    } else if (arg.startsWith('--')) {\n      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/**\"`);","sourceCodeStart":585,"sourceCodeEnd":621,"githubUrl":"https://github.com/pbakaus/impeccable/blob/f88b2837a7d7c3182e46307bbbb091a1ed547571/skill/scripts/hook-admin.mjs#L585-L621","documentation":"Thrown while parsing `hooks ignore-file` arguments when a `--`-prefixed token is neither --shared nor --local (nor --reason, which gets its own more specific error). Unknown flags are rejected rather than ignored so a typo cannot masquerade as a successful suppression.","triggerScenarios":"`hooks ignore-file \"src/**\" --force`; `--glob \"src/**\"` (inventing a flag for the positional glob); `--reasonx=...`; carrying over flags from other subcommands like --all-values.","commonSituations":"Agents guessing flag names; users assuming every ignore subcommand shares one flag vocabulary; autocomplete inserting --global instead of --shared.","solutions":["Remove the unknown flag — ignore-file accepts only --shared and --local.","The glob itself is positional, not a flag: `hooks ignore-file \"src/legacy/**\"`.","Use --shared or --local to pick which config file the glob is written to."],"exampleFix":"# before\nimpeccable hooks ignore-file --glob \"src/legacy/**\" --shared\n\n# after\nimpeccable hooks ignore-file \"src/legacy/**\" --shared","handlingStrategy":"validation","validationCode":"const IGNORE_FILE_FLAGS = new Set(['--shared', '--local']);\nfunction sanitize(args) {\n  const bad = args.filter(a => a.startsWith('--') && !IGNORE_FILE_FLAGS.has(a));\n  if (bad.length) throw new Error(`remove ${bad.join(', ')}: ignore-file supports only --shared/--local`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["The glob is positional — never invent a --glob flag.","Scope flags are --shared/--local, not --global/--project.","Validate generated command lines against a per-subcommand allowlist before executing them."],"tags":["cli","unknown-flag","hook-admin","ignore-file"],"backgroundTag":"unknown-cli-flag","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"}