{"record":{"id":"17545a77451385e2","repo":"pbakaus/impeccable","slug":"pass-a-rule-id-e-g-impeccable-command-hooks-i","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":null,"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/f88b2837a7d7c3182e46307bbbb091a1ed547571/skill/scripts/hook-admin.mjs#L561-L597","documentation":"Thrown by addIgnoreRule when the positional rule id is empty after parsing. parseIgnoreRuleArgs collects non-flag tokens as positionals and normalizes the first one; if none is present (or it normalizes to empty), the command cannot know which detector rule to suppress and refuses rather than writing a blank entry into detector.ignoreRules.","triggerScenarios":"`hooks ignore-rule` with no arguments at all; `hooks ignore-rule --all-values` (flag present but no rule id); `hooks ignore-rule --reason \"too noisy\"` (only the reason flag given); passing the rule after a flag token that swallows it, e.g. `--reason side-tab` where 'side-tab' is consumed as the reason text.","commonSituations":"User runs the bare subcommand expecting an interactive prompt; agent omits the rule id; the rule id got absorbed by a preceding --reason value.","solutions":["Pass a detector rule id as the first positional: `hooks ignore-rule side-tab`.","Take the exact id from the finding output of the detector run — ids are kebab-case like side-tab, low-contrast, flat-type-hierarchy.","If the id vanished into --reason, reorder: rule id first, flags after."],"exampleFix":"# before\nimpeccable hooks ignore-rule --reason \"agreed to skip\"\n\n# after\nimpeccable hooks ignore-rule side-tab --reason \"agreed to skip\"","handlingStrategy":"validation","validationCode":"function hasRuleId(args) {\n  const flagsWithValues = new Set(['--reason']);\n  for (let i = 0; i < args.length; i++) {\n    const a = args[i];\n    if (a.startsWith('--')) { if (flagsWithValues.has(a)) i++; continue; }\n    return true; // first positional = rule id\n  }\n  return false;\n}\nif (!hasRuleId(args)) throw new Error('rule id missing before calling addIgnoreRule');","typeGuard":null,"tryCatchPattern":"try { addIgnoreRule(cwd, args); } catch (e) { if (/^Pass a rule id/.test(e.message)) printUsage(); else throw e; }","preventionTips":["Always lead with the rule id positional, then flags.","Take rule ids verbatim from detector finding output rather than typing them.","Remember --reason consumes the next token — never place the rule id after a bare --reason."],"tags":["cli","missing-argument","hook-admin","ignore-rule"],"backgroundTag":"missing-required-argument","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"}