{"record":{"id":"33990497aba4ae02","repo":"pbakaus/impeccable","slug":"unknown-ignores-action-action-arg-run-impecca","errorCode":null,"errorMessage":"Unknown ignores action: {action_arg}. Run \"impeccable ignores --help\".\n","messagePattern":"Unknown ignores action: (.+?)\\. Run \"impeccable ignores --help\"\\.\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/detect/src/ignores.rs","lineNumber":539,"sourceCode":"        }\n    ))\n}\n\n/// JS: ignores.mjs#run (with cli.js's error handling folded in).\npub fn run(args: &[String], io: &mut Io) -> i32 {\n    let cwd = io.cwd.to_string_lossy().into_owned();\n    let action_arg = args.first().map(String::as_str).unwrap_or(\"list\");\n    let action_arg = if action_arg.is_empty() {\n        \"list\"\n    } else {\n        action_arg\n    };\n    if action_arg == \"--help\" || action_arg == \"-h\" {\n        io.out(USAGE);\n        return 0;\n    }\n    let Some(action) = action_for(action_arg) else {\n        io.err(&format!(\n            \"Unknown ignores action: {action_arg}. Run \\\"impeccable ignores --help\\\".\\n\"\n        ));\n        return 1;\n    };\n    let rest: Vec<String> = args.get(1..).unwrap_or(&[]).to_vec();\n    let out = match action {\n        \"list\" => Ok(list(&cwd)),\n        \"add-rule\" => add_rule(&cwd, &rest),\n        \"add-file\" => add_file(&cwd, &rest),\n        \"add-value\" => add_value(&cwd, &rest),\n        \"remove-rule\" => remove_rule(&cwd, &rest),\n        \"remove-file\" => remove_file(&cwd, &rest),\n        \"remove-value\" => remove_value(&cwd, &rest),\n        _ => clear(&cwd, &rest),\n    };\n    match out {\n        Ok(text) => {\n            if !text.is_empty() {","sourceCodeStart":521,"sourceCodeEnd":557,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/crates/detect/src/ignores.rs#L521-L557","documentation":"The `impeccable ignores` subcommand dispatches on its first argument via action_for(). If the argument is not --help/-h and does not map to a known action (list, add-rule, add-file, add-value, remove-rule, remove-file, remove-value, clear), run() prints \"Unknown ignores action: <arg>. Run \\\"impeccable ignores --help\\\".\" to stderr and returns exit code 1.","triggerScenarios":"Running `impeccable ignores <arg>` where <arg> is any unrecognized action name — e.g. a typo like `remove`, `add`, or a file path passed in place of the action.","commonSituations":"Typing `impeccable ignores remove rule-x` instead of `remove-rule`; forgetting the action argument entirely and passing a rule/file directly; guessing action names instead of consulting `impeccable ignores --help`; scripts written against an older CLI surface with different action names.","solutions":["Run `impeccable ignores --help` to list valid actions and re-issue with the exact action name","Use the correct compound action names: list, add-rule, add-file, add-value, remove-rule, remove-file, remove-value, clear","Check for typos — actions are hyphenated lowercase verbs, e.g. `add-rule` not `addRule` or `rule`"],"exampleFix":"// before\n$ impeccable ignores remove my-rule\nUnknown ignores action: remove. Run \"impeccable ignores --help\".\n\n// after\n$ impeccable ignores remove-rule my-rule","handlingStrategy":"validation","validationCode":"const VALID = ['list','add-rule','add-file','add-value','remove-rule','remove-file','remove-value','clear'];\nif (!VALID.includes(actionArg)) {\n  throw new Error(`unknown ignores action: ${actionArg}`);\n}","typeGuard":null,"tryCatchPattern":"// Exit code 1 + 'Unknown ignores action' on stderr means bad verb\nconst res = spawnSync('impeccable', ['ignores', ...args]);\nif (res.status !== 0 && res.stderr.toString().startsWith('Unknown ignores action')) {\n  console.error('fix the action name; run: impeccable ignores --help');\n}","preventionTips":["Always check `impeccable ignores --help` before scripting new invocations","Use the exact hyphenated action names (add-rule, remove-value, ...)","Never pass a rule/file/value in the action position"],"tags":["cli","argument-parsing"],"backgroundTag":"invalid-cli-argument","analyzedSha":"2bc2879276c1f321a53c4ca99d3371e411329b52","analyzedAt":"2026-09-08T04:51:14.109Z","contentChangedAt":"2026-09-08T04:51:14.109Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}