{"record":{"id":"9aca7376ae58859f","repo":"pbakaus/impeccable","slug":"arg-requires-a-glob-9aca73","errorCode":null,"errorMessage":"${arg} requires a glob","messagePattern":"(.+?) requires a glob","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skill/scripts/hook-admin.mjs","lineNumber":665,"sourceCode":"  let local = false;\n  let reason = '';\n\n  for (let i = 0; i < args.length; i++) {\n    const arg = String(args[i] || '');\n    if (arg === '--shared') {\n      shared = true;\n    } else if (arg === '--local') {\n      local = true;\n    } else if (arg === '--reason') {\n      const chunks = [];\n      while (i + 1 < args.length && !String(args[i + 1]).startsWith('--')) {\n        chunks.push(args[++i]);\n      }\n      reason = chunks.join(' ').trim();\n    } else if (arg.startsWith('--reason=')) {\n      reason = arg.slice('--reason='.length).trim();\n    } else if (arg === '--file' || arg === '--files') {\n      if (i + 1 >= args.length) throw new Error(`${arg} requires a glob`);\n      files.push(requireGlob(args[++i], arg));\n    } else if (arg.startsWith('--file=')) {\n      files.push(requireGlob(arg.slice('--file='.length), '--file'));\n    } else if (arg.startsWith('--files=')) {\n      files.push(requireGlob(arg.slice('--files='.length), '--files'));\n    } else if (arg.startsWith('--')) {\n      // Otherwise a typo folds into the value: `ignore-value overused-font Inter\n      // --shard` stored the value \"inter --shard\", which matches no finding, and\n      // reported success. Matches `impeccable ignores add-value`.\n      throw new Error(`Unknown ignore-value flag: ${arg}`);\n    } else {\n      positionals.push(arg);\n    }\n  }\n\n  const [rule, ...valueParts] = positionals;\n  return {\n    rule: String(rule || '').trim().toLowerCase(),","sourceCodeStart":647,"sourceCodeEnd":683,"githubUrl":"https://github.com/pbakaus/impeccable/blob/d14711ae3d1a1dd62dee61a358d27f107c51ccd0/skill/scripts/hook-admin.mjs#L647-L683","documentation":"Thrown by parseIgnoreValueArgs() when `--file` or `--files` is the very last argument (no token follows it at all). Distinct from the empty-glob case: here there is no next value to inspect, so Impeccable refuses rather than reading past the end.","triggerScenarios":"A command that ends in `--file` or `--files` with nothing after it, e.g. `impeccable hooks ignore-value overused-font Inter --file`.","commonSituations":"Truncated command (terminal line-wrap, copy-paste cut off), or a script that conditionally appends `--file` but forgets to append the value.","solutions":["Append a glob after the flag: `... --file \"src/widget.css\"`.","Switch to the equals form `--file=\"src/widget.css\"` so a missing value is caught earlier and unambiguously.","Audit the script/alias that builds the command to confirm the glob token is always emitted after --file."],"exampleFix":"// before\nimpeccable hooks ignore-value overused-font Inter --file\n// after\nimpeccable hooks ignore-value overused-font Inter --file \"src/widget.css\"","handlingStrategy":"validation","validationCode":"// Ensure --file is never the last token.\nconst i = args.indexOf('--file');\nif (i !== -1 && (i + 1 >= args.length || String(args[i + 1]).startsWith('--'))) {\n  throw new Error('--file must be followed by a glob');\n}","typeGuard":"function hasValueAfter(args, flag) {\n  const i = args.indexOf(flag);\n  return i !== -1 && i + 1 < args.length && !String(args[i + 1]).startsWith('--');\n}","tryCatchPattern":null,"preventionTips":["Construct commands so --file is always paired with its value in one step.","Use the equals form --file=<glob> to avoid the dangling-flag case."],"tags":["cli","validation","ignore-config","impeccable-hooks"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}