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

Add trailing comma when a single import doesn't fit on a line. #504

Merged
merged 2 commits into from Sep 26, 2018

Conversation

zsol
Copy link
Collaborator

@zsol zsol commented Sep 8, 2018

Fixes #250.

@coveralls
Copy link

coveralls commented Sep 8, 2018

Pull Request Test Coverage Report for Build 710

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.003%) to 96.113%

Files with Coverage Reduction New Missed Lines %
tests/test_black.py 1 97.77%
Totals Coverage Status
Change from base Build 708: 0.003%
Covered Lines: 2720
Relevant Lines: 2830

💛 - Coveralls

@zsol
Copy link
Collaborator Author

zsol commented Sep 8, 2018

@ambv I'd appreciate your eyes on this. Not sure if there's a better place for the logic here

@@ -2179,7 +2179,7 @@ def left_hand_split(line: Line, py36: bool = False) -> Iterator[Line]:
yield result


def right_hand_split(
def right_hand_split( # noqa C901
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do this. There is one function in black that is essentially a giant if statement and that's whitespace. Everything else should conform to C901. I'll merge this as is and fix forward.

@ambv ambv merged commit 25d24a1 into master Sep 26, 2018
@JelleZijlstra JelleZijlstra deleted the import-trailing-comma branch September 26, 2018 14:40
jleclanche pushed a commit to jleclanche/tan that referenced this pull request Nov 14, 2018
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 this pull request may close these issues.

None yet

3 participants