mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:44:51 +00:00
Clarify combination of combine-as-imports and force-wrap-aliases (#1162)
This commit is contained in:
parent
a19050b8a4
commit
2965e2561d
2 changed files with 10 additions and 0 deletions
|
@ -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
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
@ -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>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue