-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 inserts a trailing comma even if there's just a single name in parentheses #250
Comments
I will add I will fix the missing trailing comma when there is a single import that doesn't fit in a line, too. |
Thanks! |
We're still running into this issue and looking forward to a fix. 😄 |
I switched my affected repos to a different import sorting tool (reorder_python_imports) to work around this, not to diminish the hard work of the black maintainers in working on a fix! |
@ambv thanks for taking a look at this! and thanks for black! At the moment, I'm just rerunning isort implicitly after black runs. I think (hopefully) this is the last thing to get isort/black playing together nicely. |
Please replace |
The `combine_as_imports=True` modifies isort style as a side-effect and was not the intended purpose of the suggested change in psf#250. The problem was that isort was actually replacing the parens with backslash and using `combine_as_imports=True` happened to also produce the same result. The actual setting should be `use_parentheses` as this tells isort to use parenthesis for line continuation instead of \ for lines over the allotted line length limit and matches precisely what black is outputting.
The `combine_as_imports=True` modifies isort style as a side-effect and was not the intended purpose of the suggested change in psf#250. The problem was that isort was actually replacing the parens with backslash and using `combine_as_imports=True` happened to also produce the same result. The actual setting should be `use_parentheses` as this tells isort to use parenthesis for line continuation instead of \ for lines over the allotted line length limit and matches precisely what black is outputting.
…547) The `combine_as_imports=True` modifies isort style as a side-effect and was not the intended purpose of the suggested change in #250. The problem was that isort was actually replacing the parens with backslash and using `combine_as_imports=True` happened to also produce the same result. The actual setting should be `use_parentheses` as this tells isort to use parenthesis for line continuation instead of \ for lines over the allotted line length limit and matches precisely what black is outputting.
…sf#547) The `combine_as_imports=True` modifies isort style as a side-effect and was not the intended purpose of the suggested change in psf#250. The problem was that isort was actually replacing the parens with backslash and using `combine_as_imports=True` happened to also produce the same result. The actual setting should be `use_parentheses` as this tells isort to use parenthesis for line continuation instead of \ for lines over the allotted line length limit and matches precisely what black is outputting. (cherry picked from commit 158f796)
black requires to be updated too because of psf/black#250
black requires to be updated too because of psf/black#250
black requires to be updated too because of psf/black#250
Operating system: Mac OS 10.13.4
Python version: 3.6.5 (through pyenv)
Black version: 18.4a4
Does also happen on master: yes
Given this setup:
Running
isort
changes the file toRunning
black
changes the file toThe difference being the trailing comma and the
\
line breakIf I add this option to
setup.cfg
I get a slightly closer diff, but the trailing commas are inconsistent.
The text was updated successfully, but these errors were encountered: