Commit Graph

14 Commits

Author SHA1 Message Date
Zsolt Dollenstein
9f096d5536 Format subscriptions in a PEP-8 compliant way (#178)
Fixes #157
2018-04-30 22:49:30 -07:00
Łukasz Langa
b250aed47b Do not enforce empty lines after control flow statements
Fixes #90
2018-04-24 12:42:46 -07:00
Łukasz Langa
a764f1bb3b Generalize star expression handling
Fixes #132
2018-04-16 01:34:15 -07:00
Łukasz Langa
cb5aadad74 Automatic parentheses management
Fixes #4
2018-04-11 01:36:18 -07:00
Łukasz Langa
4787294622 Don't insert trailing commas after standalone comments 2018-03-31 23:32:11 -07:00
Zsolt Dollenstein
80bd2b3134 Normalize string quotes (#75)
* Normalize string quotes

Convert single-quoted strings to double-quoted. Convert triple single-quoted strings to triple double-quoted. Do not touch any strings where conversion would increase the number of backslashes.

Fixes #51.

* reformat Black itself
2018-03-31 11:21:25 -07:00
Łukasz Langa
fc869039eb Don't crash and burn on empty lines with trailing whitespace
Fixes #80
2018-03-26 18:41:25 -07:00
Łukasz Langa
cf6f577928 Properle space complex expressions in default values of typed arguments
Fixes #60
2018-03-22 23:52:21 -07:00
Łukasz Langa
6316e293ac Automatic detection of deprecated Python 2 forms of print and exec
Note: if those are handled, you can't use --safe because this check is using
Python 3.6+ builtin AST.

Fixes #49
2018-03-22 23:19:23 -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
6ba615092e Ignore empty bracket pairs while splitting
Fixes #35
2018-03-16 17:09:23 -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
da3c2f3582 Fix spurious extra spaces after opening parentheses and in default arguments
Fixes #14
Fixes #17
2018-03-15 12:53:23 -07:00
Łukasz Langa
e74117f172 Initial commit 2018-03-14 12:55:32 -07:00