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
Import lines that also contain a semicolon separator will be incorrectly formatted.
Steps to reproduce
Execute autoimport on this file:
classPerson:
def__init__(self, name, age, gender):
self.name=nameself.age=ageself.gender=genderdefsay_hi(self):
importpdb;pdb.set_trace()
returnf"Hello, my name is {self.name}"
Will result in this output:
importpdb;pdb.set_trace()
returnf"Hello, my name is {self.name}"classPerson:
def__init__(self, name, age, gender):
self.name=nameself.age=ageself.gender=genderdefsay_hi(self):
This is because it thinks this is a multiline import statement (due to the () character
Desired behavior
The expected output should be:
importpdbclassPerson:
def__init__(self, name, age, gender):
self.name=nameself.age=ageself.gender=genderdefsay_hi(self):
pdb.set_trace()
returnf"Hello, my name is {self.name}"
superDross
changed the title
Import lines with a semicolon separator are improberly formatted
Import lines with a semicolon separator are improperly formatted
Jan 23, 2022
Description
Import lines that also contain a semicolon separator will be incorrectly formatted.
Steps to reproduce
Execute
autoimport
on this file:Will result in this output:
This is because it thinks this is a multiline import statement (due to the
(
) characterDesired behavior
The expected output should be:
Environment
david ~ 1 $ autoimport --version autoimport version: 1.0.0 python version: 3.8.7 (default, Jan 3 2021, 20:50:30) [GCC 10.2.0] platform: Linux-5.10.89-1-MANJARO-x86_64-with-glibc2.2.5
The text was updated successfully, but these errors were encountered: