Closed ridilculous closed 5 months ago
Thanks for suggestion.
works find though and doesn't move import configargparse into the block which is disabled for formatting.
First, the E401 error does not exist, so this behavior is correct.
$ cat valid_one.py
# fmt: off
import os; os.cpu_count()
# fmt: on
import configargparse
test = False
def test():
pass
$ pycodestyle valid_one.py
valid_one.py:2:10: E702 multiple statements on one line (semicolon)
valid_one.py:8:1: E302 expected 2 blank lines, found 0
$ autopep8 --version
autopep8 1.6.0 (pycodestyle: 2.8.0)
I am looking for a way to pin one specific import to the top of the source without having to rename it and was hoping that, altough the imports are grouped at the beginning of the file, the region with the disabled formatting would be preserved and all other imports grouped below it.
At this time, we have no idea to support this behavior.
Python Code
Having
or
or
or similar, formatting moves imports which are spread over the code into the region where formatting is disabled.
works find though and doesn't move
import configargparse
into the block which is disabled for formatting.Expectation
I am looking for a way to pin one specific import to the top of the source without having to rename it and was hoping that, altough the imports are grouped at the beginning of the file, the region with the disabled formatting would be preserved and all other imports grouped below it.
In my specific case, the import will look like
Environment