{"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":"anyhow::Error","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/672bb4edf04c84f8b0753346359daee4057158f2/crates/ty_completion_eval/src/main.rs#L157-L193","documentation":"For `show-one`, the harness first finds the truth source whose name matches `cmd.task_name` among the subdirectories of `truth/`; no match aborts here. The expected value is a fixture directory name under `crates/ty_completion_eval/truth` — not a file name, symbol, or CSV task id.","triggerScenarios":"`ty_completion_eval show-one <name>` where `<name>` is not one of the fixture directories (typo, or a name taken from the completion-evaluation CSV instead of the fixture tree).","commonSituations":"Copy-pasting names from logs or older fixture layouts after fixtures were renamed; assuming the task name is the Python file name.","solutions":["List available fixtures: `ls crates/ty_completion_eval/truth`","Use the exact directory name, verbatim and case-sensitive","Check the fixture's `completion.toml` to confirm you are targeting the intended source"],"exampleFix":"# before\ncargo run -p ty_completion_eval -- show-one custom-type --file-name main.py --index 0\n# after (exact fixture directory name)\ncargo run -p ty_completion_eval -- show-one custom-types --file-name main.py --index 0","handlingStrategy":"validation","validationCode":"ls crates/ty_completion_eval/truth | grep -Fx \"$FIXTURE\" >/dev/null \\\n  || { echo \"unknown fixture: $FIXTURE\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use fixture directory names from `truth/`, not names from the CSV or logs","Keep a tab-completion helper (e.g. `ls crates/ty_completion_eval/truth`) handy","Names are case-sensitive; copy them verbatim"],"tags":["evaluation","cli","validation","fixtures"],"backgroundTag":null,"analyzedSha":"672bb4edf04c84f8b0753346359daee4057158f2","analyzedAt":"2026-08-16T08:54:05.464Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}