mirror of https://github.com/astral-sh/ruff
## Summary The `Options` struct is intended to capture the user's configuration options but `EnvironmentOptions::venv_path` supports both a `SitePackages::Known` and `SitePackages::Derived`. Users should only be able to provide `SitePackages::Derived`—they specify a path to a venv, and Red Knot derives the path to the site-packages directory. We'll only use the `Known` variant once we automatically discover the Python installation. That's why this PR changes `EnvironmentOptions::venv_path` from `Option<SitePackages>` to `Option<SystemPathBuf>`. This requires making some changes to the file watcher test, and I decided to use `extra_paths` over venv path because our venv validation is annoyingly correct -- making mocking a venv rather involved. ## Test Plan `cargo test` |
||
|---|---|---|
| .. | ||
| module_resolver | ||
| semantic_index | ||
| types | ||
| util | ||
| ast_node_ref.rs | ||
| db.rs | ||
| lib.rs | ||
| lint.rs | ||
| module_name.rs | ||
| node_key.rs | ||
| program.rs | ||
| python_platform.rs | ||
| python_version.rs | ||
| semantic_index.rs | ||
| semantic_model.rs | ||
| site_packages.rs | ||
| stdlib.rs | ||
| suppression.rs | ||
| symbol.rs | ||
| types.rs | ||
| unpack.rs | ||
| visibility_constraints.rs | ||