-
-
Notifications
You must be signed in to change notification settings - Fork 580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isort 5.5.2 mangles lines that happens to start with from
#1488
Comments
@wadetregaskis-linkedin that's a nasty bug! I'll make sure the isort project has a release soon that resolves it and adds additional test cases to ensure it never happens again. @anirudnits I'm a bit confused about your example? One of the biggest headline features of isort 5 is its ability to sort imports anywhere they are within a file, largely safely: https://pycqa.github.io/isort/docs/major_releases/introducing_isort_5/#sort-imports-anywhere if isort is simply sorting the second import statement that's good! If you encountered any sort of incorrect syntax produced, that of course would be a major bug like the one @wadetregaskis-linkedin raised Thanks! ~Timothy |
For anyone that runs into this before it is resolved, one option would be to utilize action comments to skip the offending section, since these should be very rare: https://pycqa.github.io/isort/docs/configuration/action_comments/ |
@timothycrosley sorry my bad :( |
@anirudnits No worries! Just wanted to make sure there wasn't an additional error case of this proportion |
A 5.5.3 hot fix release has just been completed to PyPI that fixes this issue. Confirmed that Python's grammar only allows from to be used for imports, within raise statements, and within yield statements ( Thanks! ~Timothy |
e.g.:
It transforms it into the gibberish:
isort 4.x didn't do this.
The text was updated successfully, but these errors were encountered: