Skip to content
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 generates code with syntax errors with profile=black and multi_line_output=2 #2174

Closed
matthew-hodgins opened this issue Sep 13, 2023 · 0 comments · Fixed by #2192
Closed

Comments

@matthew-hodgins
Copy link

isort version 5.12.0
Python version: 3.9.2

In the following example:

pyproject.toml

[tool.isort]
py_version=39
profile="black"
multi_line_output=2
line_length=50
force_alphabetical_sort_within_sections=true

test.py:

from datetime import datetime, time, timedelta, timezone, tzinfo

isort will generate code with a syntax error (the trailing comma after the last import):

from datetime import datetime, time, timedelta, \
   timezone, tzinfo,

If I remove profile = "black" from the pyproject.toml file, the trailing comma is not present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant