ruff/crates
Charlie Marsh 1ed227a1e0
Port Pyright's import resolver to Rust (#5381)
## Summary

This PR contains the first step towards enabling robust first-party,
third-party, and standard library import resolution in Ruff (including
support for `typeshed`, stub files, native modules, etc.) by porting
Pyright's import resolver to Rust.

The strategy taken here was to start with a more-or-less direct port of
the Pyright's TypeScript resolver. The code is intentionally similar,
and the test suite is effectively a superset of Pyright's test suite for
its own resolver. Due to the nature of the port, the code is very, very
non-idiomatic for Rust. The code is also entirely unused outside of the
test suite, and no effort has been made to integrate it with the rest of
the codebase.

Future work will include:

- Refactoring the code (now that it works) to match Rust and Ruff
idioms.
- Further testing, in practice, to ensure that the resolver can resolve
imports in a complex project, when provided with a virtual environment
path.
- Caching, to minimize filesystem lookups and redundant resolutions.
- Integration into Ruff itself (use Ruff's existing settings, find rules
that can make use of robust resolution, etc.)
2023-06-27 16:15:07 +00:00
..
flake8_to_ruff Bump version to 0.0.275 (#5276) 2023-06-21 21:53:37 -04:00
ruff Ignore unpacking in iteration-over-set (#5392) 2023-06-27 15:33:42 +00:00
ruff_benchmark Create PyFormatOptions 2023-06-26 14:02:17 +02:00
ruff_cache Only use a single cache file per Python package (#5117) 2023-06-19 17:46:13 +02:00
ruff_cli Experimental release for Jupyter notebook integration (#5363) 2023-06-26 21:22:42 +05:30
ruff_dev Fix ruff_dev repeat by removing short argument (#5388) 2023-06-27 13:29:20 +00:00
ruff_diagnostics Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_formatter Add tests for skip magic trailing comma 2023-06-26 14:15:55 +02:00
ruff_index Run rustfmt on nightly to clean up erroneous comments (#5106) 2023-06-15 00:19:05 +00:00
ruff_macros Avoid including nursery rules in linter-level selectors (#5268) 2023-06-21 20:11:40 +00:00
ruff_python_ast Remove prelude from ruff_python_ast (#5369) 2023-06-26 11:43:49 -04:00
ruff_python_formatter Format call expressions (without call chaining) (#5341) 2023-06-27 09:29:40 +00:00
ruff_python_resolver Port Pyright's import resolver to Rust (#5381) 2023-06-27 16:15:07 +00:00
ruff_python_semantic Respect abc decorators when classifying function types (#5315) 2023-06-22 19:52:36 +00:00
ruff_python_stdlib Experimental release for Jupyter notebook integration (#5363) 2023-06-26 21:22:42 +05:30
ruff_python_whitespace Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_rustpython Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_textwrap Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_wasm Fix autofix capabilities in playground (#5375) 2023-06-26 16:40:28 +00:00