You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting force-sort-within-sections to true and lines-between-types to 1, Ruff adds a blank line before the first from import that appears after a straight import.
(Presumably) desired behavior
isort does not add blank lines in this situation, which I think makes sense, so I propose to stick to that behavior. I guess the force-sort-within-sections setting should simply override the lines-between-types setting.
Example
I tested isort with force_sort_within_sections and lines_between_types = 1 against the following example:
fromaimportximportbfromcimportyimportd
and it doesn't do anything. Here is the command I ran (isort version 5.12.0):
isort --fss --lbt 1 --stdout example.py
However, running cargo r -p ruff_cli -- check example.py --no-cache --diff adds a blank line after import b with the following config:
Current behavior
When setting force-sort-within-sections to
true
and lines-between-types to 1, Ruff adds a blank line before the first from import that appears after a straight import.(Presumably) desired behavior
isort does not add blank lines in this situation, which I think makes sense, so I propose to stick to that behavior. I guess the force-sort-within-sections setting should simply override the lines-between-types setting.
Example
I tested isort with
force_sort_within_sections
andlines_between_types = 1
against the following example:and it doesn't do anything. Here is the command I ran (isort version 5.12.0):
However, running
cargo r -p ruff_cli -- check example.py --no-cache --diff
adds a blank line afterimport b
with the following config:The text was updated successfully, but these errors were encountered: