pbakaus/impeccable · error · Error

Unknown ignore-file flag: ${arg}

Error message

Unknown ignore-file flag: ${arg}

What it means

Thrown by parseIgnoreFileArgs when an argument starts with '--' but is not --shared, --local, or --reason (which gets its own dedicated error in [96]). The ignore-file flag surface is just two scope flags; anything else is rejected rather than silently dropped. Notably --all-values belongs to ignore-rule, not ignore-file.

Source

Thrown at skill/scripts/hook-admin.mjs:603

  writeDetectorConfig(cwd, config);
  return `Added "${rule}" to detector.ignoreRules. Current: ${config.ignoreRules.join(', ')}`;
}

function parseIgnoreFileArgs(args) {
  const positionals = [];
  let shared = false;
  let local = false;

  for (const raw of args) {
    const arg = String(raw || '');
    if (arg === '--shared') {
      shared = true;
    } else if (arg === '--local') {
      local = true;
    } else if (arg === '--reason' || arg.startsWith('--reason=')) {
      throw new Error('--reason is not supported for ignore-file because detector.ignoreFiles stores globs only; use ignore-value when a documented rule-specific exception fits');
    } else if (arg.startsWith('--')) {
      throw new Error(`Unknown ignore-file flag: ${arg}`);
    } else {
      positionals.push(arg);
    }
  }

  if (shared && local) throw new Error('Pass only one scope flag: --shared or --local');
  if (positionals.length > 1) throw new Error('Pass exactly one glob to ignore-file');

  return {
    glob: positionals[0],
    local,
  };
}

function addIgnoreFile(cwd, args) {
  const parsed = parseIgnoreFileArgs(args);
  const glob = parsed.glob;
  if (!glob) throw new Error(`Pass a glob, e.g. ${IMPECCABLE_COMMAND} hooks ignore-file "src/legacy/**"`);

View on GitHub (pinned to d14711ae3d)

Solutions

  1. For ignore-file, use only --shared or --local (and exactly one positional glob).
  2. If you meant --all-values, you are on the wrong subcommand — use ignore-rule.
  3. If you need a value-specific exception, use ignore-value.

Example fix

# before
impeccable hooks ignore-file "src/legacy/**" --all-values

# after (ignore-file takes only scope flags)
impeccable hooks ignore-file "src/legacy/**" --shared
Defensive patterns

Strategy: validation

Validate before calling

// Validate ignore-file args before dispatch.
const FILE_FLAGS = new Set(['--shared', '--local']);
function validateIgnoreFileArgs(args) {
  for (const a of args) {
    if (a.startsWith('--') && !FILE_FLAGS.has(a)) {
      throw new Error(`Unknown ignore-file flag: ${a}`);
    }
  }
}

Prevention

When it happens

Trigger: Passing --all-values to ignore-file (it is an ignore-rule flag); passing --force, --recursive, or a typo like --shard; passing a flag meant for ignore-value.

Common situations: Copy-pasting flags from an ignore-rule command; assuming ignore-file and ignore-rule share flags; a typo.

Related errors


AI-assisted analysis of pbakaus/impeccable@d14711ae3d (2026-08-13). Data as JSON: /api/errors/4b189de2f3d86df4. Report an issue: GitHub.