{"record":{"id":"17545a77451385e2","repo":"pbakaus/impeccable","slug":"pass-a-rule-id-e-g-impeccable-command-hooks-i-17545a","errorCode":null,"errorMessage":"Pass a rule id, e.g. ${IMPECCABLE_COMMAND} hooks ignore-rule side-tab","messagePattern":"Pass a rule id, e\\.g\\. (.+?) hooks ignore-rule side-tab","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skill/scripts/hook-admin.mjs","lineNumber":579,"sourceCode":"    } 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  }\n  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;","sourceCodeStart":561,"sourceCodeEnd":597,"githubUrl":"https://github.com/pbakaus/impeccable/blob/d14711ae3d1a1dd62dee61a358d27f107c51ccd0/skill/scripts/hook-admin.mjs#L561-L597","documentation":"Thrown by addIgnoreRule when no rule id was supplied (parsed.rule is falsy after normalizeRuleId). ignore-rule requires exactly one positional: the rule id to add to detector.ignoreRules. Running it with only flags, or with no arguments at all, is rejected with a concrete example.","triggerScenarios":"Running `impeccable hooks ignore-rule` with no positional; passing only --all-values or --reason; a rule id that normalizes to empty.","commonSituations":"Forgetting the rule id; assuming the command is interactive; a wrapper script that drops the positional.","solutions":["Pass a rule id as the first positional, e.g. `impeccable hooks ignore-rule side-tab`.","List available rule ids via the detector's rule set if unsure which id to pass."],"exampleFix":"# before\nimpeccable hooks ignore-rule\n\n# after\nimpeccable hooks ignore-rule side-tab","handlingStrategy":"validation","validationCode":"// Ensure a rule id positional is present before calling addIgnoreRule.\nfunction requireRuleId(positionals) {\n  if (!positionals[0]) {\n    throw new Error('Pass a rule id, e.g. impeccable hooks ignore-rule side-tab');\n  }\n  return positionals[0];\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass one rule id positional to ignore-rule.","If scripting the command, assert the positional is non-empty before invoking.","List valid rule ids from the detector before guessing."],"tags":["cli","hooks","validation","config","usage"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}