{"record":{"id":"e3f9f66488666323","repo":"pbakaus/impeccable","slug":"unknown-ignore-rule-flag-arg","errorCode":null,"errorMessage":"Unknown ignore-rule flag: ${arg}","messagePattern":"Unknown ignore-rule flag: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"skill/scripts/hook-admin.mjs","lineNumber":564,"sourceCode":"\nfunction normalizeRuleId(rule) {\n  return String(rule || '').trim().toLowerCase();\n}\n\nfunction parseIgnoreRuleArgs(args) {\n  const positionals = [];\n  let allValues = false;\n\n  for (let i = 0; i < args.length; i++) {\n    const arg = String(args[i] || '');\n    if (arg === '--all-values') {\n      allValues = true;\n    } else if (arg === '--reason') {\n      while (i + 1 < args.length && !String(args[i + 1]).startsWith('--')) i++;\n    } else if (arg.startsWith('--reason=')) {\n      // Accepted for command symmetry; ignoreRules stores rule ids only.\n    } else if (arg.startsWith('--')) {\n      throw new Error(`Unknown ignore-rule flag: ${arg}`);\n    } else {\n      positionals.push(arg);\n    }\n  }\n\n  return {\n    rule: normalizeRuleId(positionals[0]),\n    allValues,\n  };\n}\n\nfunction addIgnoreRule(cwd, args) {\n  const parsed = parseIgnoreRuleArgs(args);\n  const rule = parsed.rule;\n  if (!rule) throw new Error(`Pass a rule id, e.g. ${IMPECCABLE_COMMAND} hooks ignore-rule side-tab`);\n  if (rule === 'overused-font' && !parsed.allValues) {\n    throw new Error(`overused-font is value-specific by default. Use ${IMPECCABLE_COMMAND} hooks ignore-value overused-font <font> for a confirmed font, or ${IMPECCABLE_COMMAND} hooks ignore-rule overused-font --all-values only when the user asked to ignore overused fonts generally.`);\n  }","sourceCodeStart":546,"sourceCodeEnd":582,"githubUrl":"https://github.com/pbakaus/impeccable/blob/f88b2837a7d7c3182e46307bbbb091a1ed547571/skill/scripts/hook-admin.mjs#L546-L582","documentation":"Thrown while parsing arguments for the `hooks ignore-rule` subcommand. The parser accepts only --all-values, --reason <text>, and --reason=<text>; any other token starting with `--` is rejected instead of being silently ignored or folded into the rule id. This is a deliberate guard: a typo'd flag used to be stored as part of the rule name and the command reported success while suppressing nothing.","triggerScenarios":"`hooks ignore-rule side-tab --al-values` (typo for --all-values); `hooks ignore-rule side-tab --force` or `--silent` (flags that do not exist for this subcommand); `hooks ignore-rule side-tab --local` (scope flags are not supported for ignore-rule, unlike ignore-file/ignore-value); `--reason=text` variants of any misspelled reason flag.","commonSituations":"Muscle memory from the ignore-file/ignore-value subcommands carrying --shared/--local into ignore-rule; agents synthesizing plausible-looking flags; shell tab-completion inserting a wrong flag.","solutions":["Remove the unknown flag — ignore-rule supports only --all-values and --reason.","If you meant --all-values (needed for overused-font), fix the spelling.","If you meant to scope to files, switch subcommand: `hooks ignore-value <rule> <value> --file <glob>`.","If you meant a scope flag, note ignore-rule writes to shared detector config only and has no --shared/--local."],"exampleFix":"# before\nimpeccable hooks ignore-rule side-tab --local\n\n# after\nimpeccable hooks ignore-rule side-tab\nimpeccable hooks ignore-value low-contrast \"#eee\" --file \"src/legacy/**\" --local","handlingStrategy":"validation","validationCode":"const KNOWN = new Set(['--all-values', '--reason']);\nfunction validateIgnoreRuleArgs(args) {\n  const hasRule = args.some(a => !a.startsWith('--'));\n  if (!hasRule) throw new Error('rule id required');\n  for (const a of args) {\n    if (a.startsWith('--') && !KNOWN.has(a) && !a.startsWith('--reason=')) {\n      throw new Error(`unsupported flag ${a}; allowed: --all-values, --reason`);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  addIgnoreRule(cwd, args);\n} catch (err) {\n  // Usage error: surface the message verbatim to the operator; do not retry.\n  console.error(String(err.message));\n  process.exit(2);\n}","preventionTips":["Treat each ignore subcommand as having its own flag vocabulary; ignore-rule takes only --all-values and --reason.","When generating commands programmatically, validate flags against an allowlist per subcommand before execution.","Prefer copy-pasting a known-good invocation over reconstructing flags from memory."],"tags":["cli","unknown-flag","hook-admin","ignore-rule"],"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"}