Black will cache already formatted files using their file size and
modification timestamp. The cache is per-user and will always be used
unless Black is used with --diff or with code provided via standard
input.
* 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
Now Black properly splits standalone comments within bracketed expressions.
They are treated as another type of split instead of being bolted on with
whitespace prefixes.
A related fix: now multiple comments might appear after a given leaf.
Fixes#22
Being able to format code by piping it through the formatter makes it much easier to integrate with tools like google/vim-codefmt or Chiel92/vim-autoformat.
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