{"record":{"id":"424f86bd33c8e8b7","repo":"astral-sh/ruff","slug":"could-not-find-task-named","errorCode":null,"errorMessage":"could not find task named `{}`","messagePattern":"could not find task named `(.+?)`","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ty_completion_eval/src/main.rs","lineNumber":175,"sourceCode":"    let tmp_eval_path = SystemPath::from_std_path(tmp_eval_dir.path())\n        .ok_or_else(|| {\n            anyhow::anyhow!(\n                \"Temporary directory path is not valid UTF-8: {}\",\n                tmp_eval_dir.path().display()\n            )\n        })?\n        .to_path_buf();\n\n    let sources = TaskSource::all(&truth)?;\n    match args.command {\n        Command::ShowOne(ref cmd) => {\n            tmp_eval_dir.disable_cleanup(cmd.keep_tmp_dir);\n\n            let Some(source) = sources\n                .iter()\n                .find(|source| cmd.matches_source_task(source))\n            else {\n                anyhow::bail!(\"could not find task named `{}`\", cmd.task_name);\n            };\n            let tasks = source.to_tasks(&tmp_eval_path)?;\n            let matching: Vec<&Task> = tasks.iter().filter(|task| cmd.matches_task(task)).collect();\n            anyhow::ensure!(\n                !matching.is_empty(),\n                \"could not find any tasks matching the given criteria\",\n            );\n            anyhow::ensure!(\n                matching.len() < 2,\n                \"found more than one task matching the given criteria\",\n            );\n            let task = &matching[0];\n            let completions = task.completions()?;\n\n            let mut stdout = std::io::stdout().lock();\n            for (i, c) in completions.iter().enumerate() {\n                write!(stdout, \"{}\", c.name.as_str())?;\n                if let Some(module_name) = c.module_name {","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/astral-sh/ruff/blob/5bb508f59481c1a02d5c7ff8568b9ffd8a763eef/crates/ty_completion_eval/src/main.rs#L157-L193","documentation":"The `show-one` command of `ty_completion_eval` searches the loaded task sources under `crates/ty_completion_eval/truth/` for one whose fixture name matches `--task-name` (and optional file/index filters). If no source fixture matches, the tool bails with this message. It indicates the requested fixture does not exist by that name.","triggerScenarios":"Running `ty_completion_eval show-one <name>` where `<name>` does not match any fixture directory/file in the truth data, the name is misspelled, or the tool is run from the wrong repository root so the truth data set is incomplete.","commonSituations":"Typo in the fixture name or using a fixture that was renamed/deleted; forgetting to run from the ruff repository root; adding a new truth fixture but invoking it before it is registered; confusing fixture-name with cursor-name or file-name filters.","solutions":["List the available fixtures under `crates/ty_completion_eval/truth/` and use the exact name","Run the tool from the root of the ruff repository so the `truth` directory is found","Check for typos or recent renames of the fixture; pass `--file-name`/`--index` filters only if the fixture supports them","Run `cargo run --package ty_completion_eval -- all` to see which tasks exist"],"exampleFix":"// before\ncargo run --package ty_completion_eval -- show-one completoin.rs\n// after\ncargo run --package ty_completion_eval -- show-one completion.rs","handlingStrategy":"validation","validationCode":"ls crates/ty_completion_eval/truth/ | grep -x '<task-name>' || echo \"fixture not found\"","typeGuard":null,"tryCatchPattern":"match eval.run() {\n    Err(e) if e.to_string().contains(\"could not find task named\") => {\n        eprintln!(\"unknown fixture; check crates/ty_completion_eval/truth/ names\");\n        std::process::ExitCode::from(1)\n    }\n    other => other,\n}","preventionTips":["Run the tool from the repository root so the truth directory resolves","Tab-complete or list fixture names in crates/ty_completion_eval/truth/ before passing --task-name","Update task names in scripts after fixture renames"],"tags":["cli","fixtures","task-lookup","benchmark"],"backgroundTag":"task-not-found","analyzedSha":"5bb508f59481c1a02d5c7ff8568b9ffd8a763eef","analyzedAt":"2026-09-05T10:32:37.492Z","contentChangedAt":"2026-09-05T10:32:37.492Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}