Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-implement magic trailing comma handling #1612

Merged
merged 8 commits into from Aug 21, 2020
Merged

Commits on Aug 21, 2020

  1. Reset trailing comma handling

    ambv committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    3f94df0 View commit details
    Browse the repository at this point in the history
  2. 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
    ambv committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    041bc75 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e4f0884 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bbfed45 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f207e14 View commit details
    Browse the repository at this point in the history
  6. Require Sphinx 3

    ambv committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    7cf3620 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f200a7f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c5f34c4 View commit details
    Browse the repository at this point in the history