{"record":{"id":"9aca7376ae58859f","repo":"pbakaus/impeccable","slug":"arg-requires-a-glob","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/f88b2837a7d7c3182e46307bbbb091a1ed547571/skill/scripts/hook-admin.mjs#L647-L683","documentation":"Thrown by parseIgnoreValueArgs when --file or --files is the very last token of the `hooks ignore-value` argument list — there is no next argument to consume as a glob. The parser checks `i + 1 >= args.length` before consuming, so a trailing value-taking flag is rejected instead of reading undefined.","triggerScenarios":"`hooks ignore-value overused-font Inter --file` (command truncated or glob forgotten); scripts appending --file conditionally while always omitting the value when a variable is empty; `--files` at end of a long command that was line-wrapped and lost its argument.","commonSituations":"Truncated command lines in logs or chat relays; agents emitting the flag skeleton before filling in values; copy-paste losing the last token.","solutions":["Append the glob after the flag: `--file \"src/legacy/**\"`.","Or switch to the attached form `--file=\"src/legacy/**\"` which cannot be separated from its value.","Audit generated command lines for value-taking flags at the last position before executing them."],"exampleFix":"# before\nimpeccable hooks ignore-value overused-font Inter --file\n\n# after\nimpeccable hooks ignore-value overused-font Inter --file \"src/legacy/**\"","handlingStrategy":"validation","validationCode":"function finalizeArgs(args) {\n  const last = args[args.length - 1];\n  if (last === '--file' || last === '--files' || last === '--reason') {\n    throw new Error(`trailing value-taking flag ${last}; attach the value with = instead`);\n  }\n  return args;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer attached forms (--file=x, --reason=x) in generated command lines — they cannot be split from their values.","Validate that no value-taking flag is the final token before executing a built command."],"tags":["cli","missing-flag-value","hook-admin","ignore-value"],"backgroundTag":"missing-flag-value","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"}