Clarify combination of combine-as-imports and force-wrap-aliases (#1162)

This commit is contained in:
Charlie Marsh 2022-12-09 12:20:15 -05:00 committed by GitHub
parent a19050b8a4
commit 2965e2561d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -1981,6 +1981,10 @@ from .utils import (
) )
``` ```
Note that this setting is only effective when combined with `combine-as-imports = true`.
When `combine-as-imports` isn't enabled, every aliased `import from` will be given its
own line, in which case, wrapping is not necessary.
**Default value**: `false` **Default value**: `false`
**Type**: `bool` **Type**: `bool`
@ -1990,6 +1994,7 @@ from .utils import (
```toml ```toml
[tool.ruff.isort] [tool.ruff.isort]
force-wrap-aliases = true force-wrap-aliases = true
combine-as-imports = true
``` ```
--- ---

View file

@ -32,11 +32,16 @@ pub struct Options {
test_id as test_id test_id as test_id
) )
``` ```
Note that this setting is only effective when combined with `combine-as-imports = true`.
When `combine-as-imports` isn't enabled, every aliased `import from` will be given its
own line, in which case, wrapping is not necessary.
"#, "#,
default = r#"false"#, default = r#"false"#,
value_type = "bool", value_type = "bool",
example = r#" example = r#"
force-wrap-aliases = true force-wrap-aliases = true
combine-as-imports = true
"# "#
)] )]
pub force_wrap_aliases: Option<bool>, pub force_wrap_aliases: Option<bool>,