black/src/blib2to3
Łukasz Langa 788268bc39 Re-implement magic trailing comma handling:
- when a trailing comma is specified in any bracket pair, that signals to Black
  that this bracket pair needs to be always exploded, e.g. presented as "one
  item per line";

- this causes some changes to previously formatted code that erroneously left
  trailing commas embedded into single-line expressions;

- internally, Black needs to be able to identify trailing commas that it put
  itself compared to pre-existing trailing commas. We do this by using/abusing
  lib2to3's `was_checked` attribute.  It's True for internally generated
  trailing commas and False for pre-existing ones (in fact, for all
  pre-existing leaves and nodes).

Fixes #1288
2020-08-21 16:45:30 +02:00
..
pgen2 Re-implement magic trailing comma handling: 2020-08-21 16:45:30 +02:00
__init__.py Refactor black into packages in src/ dir (#1376) 2020-05-08 08:50:50 -07:00
Grammar.txt Refactor black into packages in src/ dir (#1376) 2020-05-08 08:50:50 -07:00
LICENSE Refactor black into packages in src/ dir (#1376) 2020-05-08 08:50:50 -07:00
PatternGrammar.txt Refactor black into packages in src/ dir (#1376) 2020-05-08 08:50:50 -07:00
pygram.py Refactor black into packages in src/ dir (#1376) 2020-05-08 08:50:50 -07:00
pytree.py Refactor black into packages in src/ dir (#1376) 2020-05-08 08:50:50 -07:00
README Refactor black into packages in src/ dir (#1376) 2020-05-08 08:50:50 -07:00

A subset of lib2to3 taken from Python 3.7.0b2.
Commit hash: 9c17e3a1987004b8bcfbe423953aad84493a7984

Reasons for forking:
- consistent handling of f-strings for users of Python < 3.6.2
- backport of BPO-33064 that fixes parsing files with trailing commas after
  *args and **kwargs
- backport of GH-6143 that restores the ability to reformat legacy usage of
  `async`
- support all types of string literals
- better ability to debug (better reprs)
- INDENT and DEDENT don't hold whitespace and comment prefixes
- ability to Cythonize

Change Log:
- Changes default logger used by Driver