ruff/crates/red_knot_python_semantic/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
..
module_resolver Add a subcommand to generate dependency graphs (#13402) 2024-09-19 21:06:32 -04:00
semantic_index Fix/#13070 defer annotations when future is active (#13395) 2024-09-19 10:13:37 +02:00
types [red-knot] visit with-item vars even if not a Name (#13409) 2024-09-19 10:37:49 -07:00
ast_node_ref.rs Add definitions for match statement (#13147) 2024-09-02 14:40:09 +05:30
db.rs Add API to emit type-checking diagnostics (#12988) 2024-08-20 07:22:30 +00:00
lib.rs Add a subcommand to generate dependency graphs (#13402) 2024-09-19 21:06:32 -04:00
module_name.rs [red-knot] Add support for relative imports (#12910) 2024-08-16 12:35:27 +01:00
node_key.rs Implement AstNode for Identifier (#13207) 2024-09-02 16:27:12 +05:30
program.rs Eagerly validate typeshed versions (#12786) 2024-08-21 15:49:53 +00:00
python_version.rs Remove red_knot_python_semantic::python_version::TargetVersion (#12790) 2024-08-10 14:28:31 +01:00
semantic_index.rs Fix/#13070 defer annotations when future is active (#13395) 2024-09-19 10:13:37 +02:00
semantic_model.rs [red-knot] use declared types in inference/checking (#13335) 2024-09-17 08:11:06 -07:00
site_packages.rs Eagerly validate typeshed versions (#12786) 2024-08-21 15:49:53 +00:00
stdlib.rs [red-knot] support reveal_type as pseudo-builtin (#13403) 2024-09-19 07:58:08 -07:00
types.rs [red-knot] support reveal_type as pseudo-builtin (#13403) 2024-09-19 07:58:08 -07:00