Commit Graph

13 Commits

Author SHA1 Message Date
Łukasz Langa
92b377556e Don't omit whitespace when the factor is not a math operator
Fixes #55
2018-03-21 18:34:16 -07:00
Łukasz Langa
5bc40707af Fix numpy-style array indexing for real
Fixes #33
2018-03-20 18:54:33 -07:00
Łukasz Langa
2fa31ff314 More support for numpy tuple indexing 2018-03-17 02:39:53 -07:00
Łukasz Langa
68c71b621f Don't fold postscriptum standalone comment into last statement
This happened when the last statement was a simple statement.

Fixes #18
Fixes #28
2018-03-17 00:59:28 -07:00
Mika⠙
497de7fa08 Line breaks before logical operators (#36)
Fixes #21
2018-03-16 21:45:51 -07:00
Łukasz Langa
9c9f6eb6d5 Remove the trailing comma if there is only one argument to a call
This makes it consistent with removing the trailing comma when multiple
arguments to a call fit in a single line. It also makes it a tiny bit more
likely that an expression will fit a line that didn't use to.
2018-03-16 17:32:55 -07:00
Łukasz Langa
22ce1e1fc3 Fix spurious space after star-based unary expression
This happened when the operand was a complex expression.

Fixes #31
2018-03-15 23:56:30 -07:00
Łukasz Langa
fb84d8b2ee Fix numpy-style array indexing
Fixes #33
2018-03-15 23:39:45 -07:00
Łukasz Langa
5fb5cc8c2b Only use trailing commas in function signatures when it's safe
Trailing commas after * or ** in a function signature are only safe for Python 3.6
code.  So now Black checks whether the file was already Python 3.6 to begin
with.  If so, trailing commas are used in such cases.  Otherwise, they're not.

When * and ** don't appear in a function signature, the trailing comma is
always safe.

Fixes #8
2018-03-15 19:44:09 -07:00
Łukasz Langa
c26daa4fd5 Don't split on for-loop variable unpacks
Fixes #23
2018-03-15 19:23:19 -07:00
Łukasz Langa
5370714c96 Fix spurious space after unary expression
This happened when the operand was a complex expression.

Fixes #15
2018-03-15 14:54:37 -07:00
Łukasz Langa
174fc47b78 Fix spurious space in parenthesized set expressions
Fixes #7
2018-03-15 11:28:59 -07:00
Łukasz Langa
e74117f172 Initial commit 2018-03-14 12:55:32 -07:00