Refine warning about incompatible isort settings (#8192)

This commit is contained in:
Micha Reiser 2023-10-25 16:41:17 +09:00 committed by GitHub
parent 1ee73bdedf
commit fd07a12a52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 104 additions and 36 deletions

View file

@ -1683,6 +1683,9 @@ pub struct IsortOptions {
/// `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.
///
/// When using the formatter, ensure that `format.skip-magic-trailing-comma` is set to `false` (default)
/// when enabling `force-wrap-aliases` to avoid that the formatter collapses members if they all fit on a single line.
#[option(
default = r#"false"#,
value_type = "bool",
@ -1726,6 +1729,9 @@ pub struct IsortOptions {
/// the imports will never be folded into one line.
///
/// See isort's [`split-on-trailing-comma`](https://pycqa.github.io/isort/docs/configuration/options.html#split-on-trailing-comma) option.
///
/// When using the formatter, ensure that `format.skip-magic-trailing-comma` is set to `false` (default) when enabling `split-on-trailing-comma`
/// to avoid that the formatter removes the trailing commas.
#[option(
default = r#"true"#,
value_type = "bool",
@ -1907,6 +1913,9 @@ pub struct IsortOptions {
/// The number of blank lines to place after imports.
/// Use `-1` for automatic determination.
///
/// When using the formatter, only the values `-1`, `1`, and `2` are compatible because
/// it enforces at least one empty and at most two empty lines after imports.
#[option(
default = r#"-1"#,
value_type = "int",
@ -1918,6 +1927,9 @@ pub struct IsortOptions {
pub lines_after_imports: Option<isize>,
/// The number of lines to place between "direct" and `import from` imports.
///
/// When using the formatter, only the values `0` and `1` are compatible because
/// it preserves up to one empty line after imports in nested blocks.
#[option(
default = r#"0"#,
value_type = "int",