{"record":{"id":"6586533268a9ce4e","repo":"astral-sh/ruff","slug":"watch-is-not-supported-with-uv-workspace-integ","errorCode":null,"errorMessage":"`--watch` is not supported with uv workspace integration","messagePattern":"`--watch` is not supported with uv workspace integration","errorType":"console","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/ty/src/lib.rs","lineNumber":168,"sourceCode":"        .config_file\n        .as_ref()\n        .map(|path| SystemPath::absolute(path, &cwd));\n    let force_exclude = args.force_exclude();\n\n    let mut project_metadata = match &config_file {\n        Some(config_file) => {\n            ProjectMetadata::from_config_file(config_file.clone(), &project_path, &system)?\n        }\n        None if check_paths.iter().any(|path| system.is_file(path)) => {\n            // `uv check --script` passes a file as its check path. Disable uv workspace metadata\n            // for scripts until script integration is implemented in a follow-up.\n            ProjectMetadata::discover_without_uv(&project_path, &system)?\n        }\n        None => ProjectMetadata::discover(&project_path, &system)?,\n    };\n\n    if watch && project_metadata.has_uv_workspace() {\n        return Err(anyhow!(\n            \"`--watch` is not supported with uv workspace integration\"\n        ));\n    }\n\n    project_metadata.apply_configuration_files(&system)?;\n\n    project_metadata.apply_override_options(args.into_options());\n\n    let mut db = ProjectDatabase::fallible(project_metadata, system)?;\n    let project = db.project();\n\n    project.set_verbose(&mut db, verbosity >= VerbosityLevel::Verbose);\n    project.set_force_exclude(&mut db, force_exclude);\n\n    if !check_paths.is_empty() {\n        project.set_included_paths(&mut db, check_paths);\n    }\n","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/astral-sh/ruff/blob/672bb4edf04c84f8b0753346359daee4057158f2/crates/ty/src/lib.rs#L150-L186","documentation":"ty builds `ProjectMetadata` before checking (lib.rs:158-168); `ProjectMetadata::discover` recognizes uv-managed workspaces, and watch mode has no support for the extra resolution uv workspace integration requires. Requesting `--watch` in a project where `has_uv_workspace()` is true is therefore rejected at startup with this message.","triggerScenarios":"`ty check --watch` (or any invocation that enables watch) in a repository whose root `pyproject.toml` declares a uv workspace (`[tool.uv.workspace]` with members).","commonSituations":"Monorepos managed by uv where members share one lockfile; developers adding `--watch` to editor tasks or Justfile recipes after adopting uv workspaces.","solutions":["Drop `--watch` and run one-shot checks (`ty check`), re-running on change from your editor or an external file-watcher wrapper","If you do not actually need workspace semantics, remove the `[tool.uv.workspace]` declaration — then watch mode works again","Track ty release notes; watch + uv workspace support may arrive in a follow-up"],"exampleFix":"# before\nty check --watch src/\n# after\nty check src/   # watch mode unsupported with uv workspace integration","handlingStrategy":"validation","validationCode":"if grep -q '^\\[tool\\.uv\\.workspace\\]' pyproject.toml 2>/dev/null; then\n  ty check \"$@\"            # uv workspace: no --watch\nelse\n  ty check --watch \"$@\"\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check for `[tool.uv.workspace]` before wiring `--watch` into editor tasks","Wrap re-runs in an external watcher (entr, watchexec) when watch mode is unavailable","Watch ty release notes when adopting new uv workspace features"],"tags":["ty","cli","uv","watch-mode","unsupported-feature"],"backgroundTag":null,"analyzedSha":"672bb4edf04c84f8b0753346359daee4057158f2","analyzedAt":"2026-08-16T08:54:05.464Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}