PyCQA / isort

A Python utility / library to sort imports.
https://pycqa.github.io/isort/
MIT License
6.45k stars 574 forks source link

Bug: Word wrapping works incorrectly with force_single_line=True #2267

Open ramazanFarrahov opened 3 months ago

ramazanFarrahov commented 3 months ago

Word wrapping works incorrectly with force_single_line=True for from ... import *.

Steps to Reproduce

; .isort.cfg

[settings]
py_version = 39
profile = black
force_single_line = true
# example_file.py

from very.very.very.very.very.very.very.very.very.very.very.very.very.very.very.very.very.very.long.line import *

After running isort the file is broken:

# example_file.py

from very.very.very.very.very.very.very.very.very.very.very.very.very.very.very.very.(
    line import *.long.very.very,
)

Context (Environment)

Possible fixes

I didn't find a way to disable word wrapping.

I've tried setting wrap_length and line_length to 999999 to avoid wrapping, but it starts conflicting with black (isort removes wrapping, then black puts it back).