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
If there is a yield statement in a file, isort alters multiline strings that contain the word "from":
$ catdb.pydefa():
yieldf(
""" select %s from (values %%s) as t(%s) """
)
defb():
return (
""" select name from foo """%main_table
)
defc():
query= (
""" select {keys} from (values %s) as t(id) """
)
defd():
query=f"""select t.id from {table} t{extra}"""
$ isort --diff db.py
--- /home/dev/swh-environment/swh-indexer/db.py:before 2020-09-29 17:30:57.737760+++ /home/dev/swh-environment/swh-indexer/db.py:after 2020-09-29 17:44:02.722392@@ -9,7 +9,6 @@
return (
"""
select name
- from foo
"""
% main_table
)
@@ -18,12 +17,11 @@
query = (
"""
select {keys}
- from (values %s) as t(id)+ from values%s import ast, id
"""
)
def d():
query = f"""select t.id
- from {table} t
{extra}"""
$ isort -V
_ _
(_) ___ ___ _ __| |_
| |/ _/ / _ \/ '__ _/
| |\__ \/\_\/| | | |_
|_|\___/\___/\_/ \_/
isort your imports, so you don't have to.
VERSION 5.5.3
isort was installed using pip3 install --user isort earlier today.
The text was updated successfully, but these errors were encountered:
progval
changed the title
Changes the content of multiline strings after a yield statement
isort changes the content of multiline strings after a yield statement
Sep 29, 2020
Thank you for reporting this major issue! A 5.5.4 hot fix release was released that resolves it and I was able to confirm it is only present in the 5.5.3 release.
Hi,
If there is a yield statement in a file, isort alters multiline strings that contain the word "from":
isort was installed using
pip3 install --user isort
earlier today.The text was updated successfully, but these errors were encountered: