{"record":{"id":"177804a8504a2e09","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":"plugin/skills/impeccable/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/d14711ae3d1a1dd62dee61a358d27f107c51ccd0/plugin/skills/impeccable/scripts/hook-admin.mjs#L585-L621","documentation":"parseIgnoreFileArgs() accepts exactly two flags: `--shared` and `--local` (plus the explicitly-rejected --reason handled by error 27). Any other `--` token is an unknown flag and is refused, so a typo cannot be absorbed into the stored glob.","triggerScenarios":"Running `hooks ignore-file \"<glob>\"` with a flag like `--global` (meant to be `--shared`), `--all-values`, or any token not in {--shared, --local}.","commonSituations":"Guessing the scope flag name; mixing in flags from ignore-rule/ignore-value; stale documentation suggesting a flag that was renamed.","solutions":["Use `--shared` (default, committed config) or `--local` (gitignored) for scope.","Remove any unrelated flags."],"exampleFix":"# before\nimpeccable hooks ignore-file \"src/legacy/**\" --global\n\n# after\nimpeccable hooks ignore-file \"src/legacy/**\" --shared","handlingStrategy":"validation","validationCode":"const IGNORE_FILE_FLAGS = new Set(['--shared', '--local', '--reason']);\nfor (const a of args) {\n  if (String(a).startsWith('--') && !IGNORE_FILE_FLAGS.has(a) && !String(a).startsWith('--reason=')) {\n    throw new Error(`Unknown ignore-file flag: ${a}`);\n  }\n}","typeGuard":"function isKnownIgnoreFileFlag(arg) {\n  return arg === '--shared' || arg === '--local';\n}","tryCatchPattern":null,"preventionTips":["ignore-file accepts only --shared and --local for scope.","Use --shared (not --global) for the committed config."],"tags":["cli","argument-parsing"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}