{"record":{"id":"c462647951aca393","repo":"pbakaus/impeccable","slug":"reason-is-not-supported-for-ignore-file-because","errorCode":null,"errorMessage":"--reason is not supported for ignore-file because detector.ignoreFiles stores globs only; use ignore-value when a documented rule-specific exception fits","messagePattern":"--reason is not supported for ignore-file because detector\\.ignoreFiles stores globs only; use ignore-value when a documented rule-specific exception fits","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/skills/impeccable/scripts/hook-admin.mjs","lineNumber":601,"sourceCode":"  const config = mergeDetectorConfig(readRawDetectorConfig(cwd));\n  if (!config.ignoreRules.includes(rule)) config.ignoreRules.push(rule);\n  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);","sourceCodeStart":583,"sourceCodeEnd":619,"githubUrl":"https://github.com/pbakaus/impeccable/blob/d14711ae3d1a1dd62dee61a358d27f107c51ccd0/plugin/skills/impeccable/scripts/hook-admin.mjs#L583-L619","documentation":"ignore-file stores file/path globs in detector.ignoreFiles and has no reason field. Passing `--reason` would be silently dropped (data loss), so the parser rejects it explicitly and points the user to ignore-value, which does persist a reason when a documented rule-specific exception applies.","triggerScenarios":"Running `hooks ignore-file \"<glob>\" --reason \"...\"` (space form) or `--reason=...`.","commonSituations":"User wants to record why a file is ignored and reaches for the reason flag that ignore-value supports; copy-pasting an ignore-value invocation pattern onto ignore-file.","solutions":["Drop --reason from the ignore-file invocation (store the rationale elsewhere, e.g. a commit message or comment).","If a documented rule-specific exception with a reason is what you need, use `hooks ignore-value <rule> <value> --reason \"...\"` instead."],"exampleFix":"# before\nimpeccable hooks ignore-file \"src/legacy/**\" --reason \"legacy\"\n\n# after\ncd /tmp/errlookup-RbNU9j && impeccable hooks ignore-file \"src/legacy/**\"","handlingStrategy":"validation","validationCode":"if (args.some(a => a === '--reason' || String(a).startsWith('--reason='))) {\n  throw new Error('--reason is not supported for ignore-file; use ignore-value for a documented exception');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember ignore-file stores only globs — there is no reason field to populate.","If a reason matters, check whether a documented ignore-value exception fits instead."],"tags":["cli","argument-parsing","detector-config"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}