{"record":{"id":"4b189de2f3d86df4","repo":"pbakaus/impeccable","slug":"unknown-ignore-file-flag-arg-4b189d","errorCode":null,"errorMessage":"Unknown ignore-file flag: ${arg}","messagePattern":"Unknown ignore-file flag: (.+?)","errorType":"validation","errorClass":"Error","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/d14711ae3d1a1dd62dee61a358d27f107c51ccd0/skill/scripts/hook-admin.mjs#L585-L621","documentation":"Thrown by parseIgnoreFileArgs when an argument starts with '--' but is not --shared, --local, or --reason (which gets its own dedicated error in [96]). The ignore-file flag surface is just two scope flags; anything else is rejected rather than silently dropped. Notably --all-values belongs to ignore-rule, not ignore-file.","triggerScenarios":"Passing --all-values to ignore-file (it is an ignore-rule flag); passing --force, --recursive, or a typo like --shard; passing a flag meant for ignore-value.","commonSituations":"Copy-pasting flags from an ignore-rule command; assuming ignore-file and ignore-rule share flags; a typo.","solutions":["For ignore-file, use only --shared or --local (and exactly one positional glob).","If you meant --all-values, you are on the wrong subcommand — use ignore-rule.","If you need a value-specific exception, use ignore-value."],"exampleFix":"# before\nimpeccable hooks ignore-file \"src/legacy/**\" --all-values\n\n# after (ignore-file takes only scope flags)\nimpeccable hooks ignore-file \"src/legacy/**\" --shared","handlingStrategy":"validation","validationCode":"// Validate ignore-file args before dispatch.\nconst FILE_FLAGS = new Set(['--shared', '--local']);\nfunction validateIgnoreFileArgs(args) {\n  for (const a of args) {\n    if (a.startsWith('--') && !FILE_FLAGS.has(a)) {\n      throw new Error(`Unknown ignore-file flag: ${a}`);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["ignore-file accepts only --shared and --local.","--all-values is for ignore-rule; --reason is rejected (see [96]).","When in doubt, run the command with --help."],"tags":["cli","hooks","validation","config","arg-parsing"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}