Skip to content

Adds trailing comma even when asked not to #831

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

Closed
jml opened this issue Feb 25, 2019 · 3 comments
Closed

Adds trailing comma even when asked not to #831

jml opened this issue Feb 25, 2019 · 3 comments

Comments

@jml
Copy link

jml commented Feb 25, 2019

long.py

from memflow.operators.itunes_connect_reports_to_file_operator import (
    ITunesConnectReportsToFileOperator,
)

.isort.cfg:

[settings]
# This must match the line length for `black` in pyproject.toml.
line_length=100
# We also want imports in __init__.py sorted.
not_skip=__init__.py
# Two blank lines between the imports and the rest of the code.
# This is a subjective preference.
lines_after_imports=2

# These are necessary for `isort` to create import statements that are
# compatible with `black`. Changing these will break our auto-formatting.
# See <https://black.readthedocs.io/en/stable/the_black_code_style.html>.
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
combine_as_imports=True
$ isort -rc
--- /Users/jml/Desktop/isort-bug/long.py:before	2019-02-25 12:27:39.166725
+++ /Users/jml/Desktop/isort-bug/long.py:after	2019-02-25 12:28:48.686402
@@ -1,3 +1,3 @@
 from memflow.operators.itunes_connect_reports_to_file_operator import (
-    ITunesConnectReportsToFileOperator,
+    ITunesConnectReportsToFileOperator
 )

I expected this to leave the file unchanged, preserving the trailing comma.

isort 4.3.4 works as expected. 4.3.5 through 4.3.8 all behave as above.

@tino
Copy link

tino commented Feb 25, 2019

Yup, having the same problem here.

@jaswilli
Copy link

It looks like the change came in here: 75b3549

And I'm not sure what Black was doing at the time of the above change but at least now it definitely seems to be inserting a trailing comma in this situation (python 3.7.2, black 18.9b0).

@timothycrosley
Copy link
Member

We've done a hot-fix using @viourr's pull request, that fixes this issue.

Thank you!

~Timothy

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

No branches or pull requests

4 participants