## 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.
64 lines
1.8 KiB
TOML
64 lines
1.8 KiB
TOML
[package]
|
|
name = "ruff_workspace"
|
|
version = "0.0.0"
|
|
publish = false
|
|
authors = { workspace = true }
|
|
edition = { workspace = true }
|
|
rust-version = { workspace = true }
|
|
homepage = { workspace = true }
|
|
documentation = { workspace = true }
|
|
repository = { workspace = true }
|
|
license = { workspace = true }
|
|
|
|
[lib]
|
|
|
|
[dependencies]
|
|
ruff_cache = { workspace = true }
|
|
ruff_formatter = { workspace = true }
|
|
ruff_graph = { workspace = true, features = ["serde", "schemars"] }
|
|
ruff_linter = { workspace = true }
|
|
ruff_macros = { workspace = true }
|
|
ruff_python_ast = { workspace = true }
|
|
ruff_python_formatter = { workspace = true, features = ["serde"] }
|
|
ruff_python_semantic = { workspace = true, features = ["serde"] }
|
|
ruff_source_file = { workspace = true }
|
|
|
|
anyhow = { workspace = true }
|
|
colored = { workspace = true }
|
|
ignore = { workspace = true }
|
|
is-macro = { workspace = true }
|
|
itertools = { workspace = true }
|
|
log = { workspace = true }
|
|
matchit = { workspace = true }
|
|
glob = { workspace = true }
|
|
globset = { workspace = true }
|
|
path-absolutize = { workspace = true }
|
|
path-slash = { workspace = true }
|
|
pep440_rs = { workspace = true, features = ["serde"] }
|
|
regex = { workspace = true }
|
|
rustc-hash = { workspace = true }
|
|
schemars = { workspace = true, optional = true }
|
|
serde = { workspace = true }
|
|
shellexpand = { workspace = true }
|
|
strum = { workspace = true }
|
|
toml = { workspace = true }
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
etcetera = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
# Enable test rules during development
|
|
ruff_linter = { workspace = true, features = ["clap", "test-rules"] }
|
|
tempfile = { workspace = true }
|
|
|
|
[package.metadata.cargo-shear]
|
|
# Used via macro expansion.
|
|
ignored = ["colored"]
|
|
|
|
[features]
|
|
default = []
|
|
schemars = ["dep:schemars", "ruff_formatter/schemars", "ruff_python_formatter/schemars", "ruff_python_semantic/schemars"]
|
|
|
|
[lints]
|
|
workspace = true
|