black/src
Richard Si 8a59528c2d
Stop changing return type annotations to tuples (#2384)
This fixes a bug where a trailing comma would be added to a
parenthesized return annotation changing its type to a tuple.
Here's one case where this bug shows up:

```
def spam() -> (
    this_is_a_long_type_annotation_which_should_NOT_get_a_trailing_comma
):
    pass
```

The root problem was that the type annotation was treated as if it was
a parameter & import list (is_body=True to linegen::bracket_split_build_line)
where a trailing comma is usually fine. Now there's another check in the
aforementioned function to make sure the body it's operating on isn't
a return annotation before truly adding a trailing comma.
2021-08-25 18:32:27 -07:00
..
black Stop changing return type annotations to tuples (#2384) 2021-08-25 18:32:27 -07:00
black_primer Add cpython Lib/ repository config into primer config - Disabled (#2429) 2021-08-24 17:29:49 -04:00
blackd Change sys.exit to raise ImportError (#2440) 2021-08-24 16:59:24 -04:00
blib2to3 Revert "Use lowercase hex numbers fixes #1692 (#1775)" 2021-04-25 19:13:23 +02:00