Skip to content

Commit 42cc67a

Browse files
[docs] improve and fix entry for analyze.include-dependencies (#15197)
## Summary Changes two things about the entry: * make the example valid TOML - inline tables must be a single line, at least till v1.1.0 is released, but also while in the future the toml version used by ruff might handle it, it would probably be good to stick to a spec that's readable by the vast majority of other tools and versions as well, especially if people are using `pyproject.toml`. The current example leads to `ruff` failure. See toml-lang/toml#904 * adds a line about the ability to add non-Python files to the map, which I think is a specific and important feature people should know about (in fact, I would assume this could potentially become the single biggest use-case for this). ## Test Plan Ran doc creation as described in the [contribution](https://docs.astral.sh/ruff/contributing/#mkdocs) guide. --------- Co-authored-by: Charlie Marsh <[email protected]>
1 parent 280ba75 commit 42cc67a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

crates/ruff_workspace/src/options.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3494,15 +3494,15 @@ pub struct AnalyzeOptions {
34943494
"#
34953495
)]
34963496
pub detect_string_imports: Option<bool>,
3497-
/// A map from file path to the list of file paths or globs that should be considered
3498-
/// dependencies of that file, regardless of whether relevant imports are detected.
3497+
/// A map from file path to the list of Python or non-Python file paths or globs that should be
3498+
/// considered dependencies of that file, regardless of whether relevant imports are detected.
34993499
#[option(
35003500
default = "{}",
3501+
scope = "include-dependencies",
35013502
value_type = "dict[str, list[str]]",
35023503
example = r#"
3503-
include-dependencies = {
3504-
"foo/bar.py": ["foo/baz/*.py"],
3505-
}
3504+
"foo/bar.py" = ["foo/baz/*.py"]
3505+
"foo/baz/reader.py" = ["configs/bar.json"]
35063506
"#
35073507
)]
35083508
pub include_dependencies: Option<BTreeMap<PathBuf, Vec<String>>>,

ruff.schema.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)