Skip to content

Commit 47b31fb

Browse files
LHMQ878claude
andcommitted
[docs] Reduce extend-aliases note to the override behavior
Per review, keep the change minimal and just acknowledge that entries override an overlapping `aliases` entry, rather than presenting the self-alias trick as a recommended way to opt out of a default. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent a1bc874 commit 47b31fb

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

crates/ruff_workspace/src/options.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,21 +1623,15 @@ pub struct Flake8ImportConventionsOptions {
16231623
pub aliases: Option<FxHashMap<ModuleName, Alias>>,
16241624

16251625
/// A mapping from module to conventional import alias. These aliases will
1626-
/// be added to the [`aliases`](#lint_flake8-import-conventions_aliases) mapping.
1627-
///
1628-
/// Entries here take precedence over [`aliases`](#lint_flake8-import-conventions_aliases),
1629-
/// so this option can also be used to change or opt out of a default alias without
1630-
/// restating the entire mapping. Mapping a module to its own name requires it to be
1631-
/// imported unaliased.
1626+
/// be added to the [`aliases`](#lint_flake8-import-conventions_aliases) mapping
1627+
/// and will override any existing `aliases` if the two settings overlap.
16321628
#[option(
16331629
default = r#"{}"#,
16341630
value_type = "dict[str, str]",
16351631
scope = "extend-aliases",
16361632
example = r#"
16371633
# Declare a custom alias for the `dask` module.
16381634
"dask.dataframe" = "dd"
1639-
# Require `numpy` to be imported unaliased, overriding the default `np` alias.
1640-
numpy = "numpy"
16411635
"#
16421636
)]
16431637
pub extend_aliases: Option<FxHashMap<ModuleName, Alias>>,

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)