This support isn't *exactly* right per PEP 3131 as the regex engine is a bit
too limited for that and I didn't want to spend time on Other_ID_Start and
Other_ID_Continue unless they're actually needed.
Hopefully this doesn't slow it down too much.
In raw strings, a single backslash means a literal backslash. It is also used to escape quotes if it precedes them. This means it is impossible to change the quote type for strings that contain an unescaped version of the other quote type.
Fixes#100
Black cannot currently support this form due to its generator-based nature.
This is mostly a problem for existing `# yapf: disable` usage as trailing
comment.
Fixes#95
The default behaviour is that now all lines break *before* delimiters,
instead of afterwards. The special cases for this are commas and
behaviour around args.
Resolves#73
* 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.
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.
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