ruff/crates/ruff_db/src
Charlie Marsh 4e935f7d7d
Add a subcommand to generate dependency graphs (#13402)
## Summary

This PR adds an experimental Ruff subcommand to generate dependency
graphs based on module resolution.

A few highlights:

- You can generate either dependency or dependent graphs via the
`--direction` command-line argument.
- Like Pants, we also provide an option to identify imports from string
literals (`--detect-string-imports`).
- Users can also provide additional dependency data via the
`include-dependencies` key under `[tool.ruff.import-map]`. This map uses
file paths as keys, and lists of strings as values. Those strings can be
file paths or globs.

The dependency resolution uses the red-knot module resolver which is
intended to be fully spec compliant, so it's also a chance to expose the
module resolver in a real-world setting.

The CLI is, e.g., `ruff graph build ../autobot`, which will output a
JSON map from file to files it depends on for the `autobot` project.
2024-09-19 21:06:32 -04:00
..
files Setup tracing and document tracing usage (#12730) 2024-08-08 06:28:40 +00:00
system Add a subcommand to generate dependency graphs (#13402) 2024-09-19 21:06:32 -04:00
vendored Setup tracing and document tracing usage (#12730) 2024-08-08 06:28:40 +00:00
display.rs [red-knot] use declared types in inference/checking (#13335) 2024-09-17 08:11:06 -07:00
file_revision.rs Set durabilities for low-durability fields on high-durability inputs (#12627) 2024-08-02 19:42:34 +02:00
files.rs [red-knot] support deferred evaluation of type expressions (#13131) 2024-08-28 11:41:01 -07:00
lib.rs [red-knot] use declared types in inference/checking (#13335) 2024-09-17 08:11:06 -07:00
parsed.rs [red-knot] Simplify virtual file support (#13043) 2024-08-23 07:04:15 +00:00
source.rs [red-knot] Improve various tracing logs (#13015) 2024-08-20 18:34:51 +00:00
system.rs [red-knot] Simplify virtual file support (#13043) 2024-08-23 07:04:15 +00:00
testing.rs Upgrade to Salsa with tables (#13016) 2024-08-21 06:58:53 +00:00
vendored.rs Use ZIP file size metadata to allocate string (#13032) 2024-08-21 12:48:44 +00:00