|
2 | 2 |
|
3 | 3 | ## Unreleased |
4 | 4 |
|
5 | | -### _Black_ |
| 5 | +At long last, _Black_ is no longer a beta product! This is the first non-beta release |
| 6 | +and the first release covered by our new stability policy. |
| 7 | + |
| 8 | +### Highlights |
6 | 9 |
|
7 | 10 | - **Remove Python 2 support** (#2740) |
8 | | -- Do not accept bare carriage return line endings in pyproject.toml (#2408) |
9 | | -- Improve error message for invalid regular expression (#2678) |
10 | | -- Improve error message when parsing fails during AST safety check by embedding the |
11 | | - underlying SyntaxError (#2693) |
| 11 | +- Introduce the `--preview` flag (#2752) |
| 12 | + |
| 13 | +### Style |
| 14 | + |
| 15 | +- Deprecate `--experimental-string-processing` and move the functionality under |
| 16 | + `--preview` (#2789) |
| 17 | +- For stubs, one blank line between class attributes and methods is now kept if there's |
| 18 | + at least one pre-existing blank line (#2736) |
| 19 | +- Black now normalizes string prefix order (#2297) |
| 20 | +- Remove spaces around power operators if both operands are simple (#2726) |
| 21 | +- Work around bug that causes unstable formatting in some cases in the presence of the |
| 22 | + magic trailing comma (#2807) |
| 23 | +- Use parentheses for attribute access on decimal float and int literals (#2799) |
| 24 | +- Don't add whitespace for attribute access on hexadecimal, binary, octal, and complex |
| 25 | + literals (#2799) |
| 26 | +- Treat blank lines in stubs the same inside top-level `if` statements (#2820) |
| 27 | +- Fix unstable formatting with semicolons and arithmetic expressions (#2817) |
| 28 | + |
| 29 | +### Parser |
| 30 | + |
12 | 31 | - Fix mapping cases that contain as-expressions, like `case {"key": 1 | 2 as password}` |
13 | 32 | (#2686) |
14 | 33 | - Fix cases that contain multiple top-level as-expressions, like `case 1 as a, 2 as b` |
15 | 34 | (#2716) |
16 | 35 | - Fix call patterns that contain as-expressions with keyword arguments, like |
17 | 36 | `case Foo(bar=baz as quux)` (#2749) |
18 | | -- No longer color diff headers white as it's unreadable in light themed terminals |
19 | | - (#2691) |
20 | 37 | - Tuple unpacking on `return` and `yield` constructs now implies 3.8+ (#2700) |
21 | 38 | - Unparenthesized tuples on annotated assignments (e.g |
22 | 39 | `values: Tuple[int, ...] = 1, 2, 3`) now implies 3.8+ (#2708) |
23 | | -- Remove spaces around power operators if both operands are simple (#2726) |
24 | | -- Allow setting custom cache directory on all platforms with environment variable |
25 | | - `BLACK_CACHE_DIR` (#2739). |
26 | | -- Text coloring added in the final statistics (#2712) |
27 | | -- For stubs, one blank line between class attributes and methods is now kept if there's |
28 | | - at least one pre-existing blank line (#2736) |
29 | | -- Verbose mode also now describes how a project root was discovered and which paths will |
30 | | - be formatted. (#2526) |
31 | | -- Speed-up the new backtracking parser about 4X in general (enabled when |
32 | | - `--target-version` is set to 3.10 and higher). (#2728) |
33 | 40 | - Fix handling of standalone `match()` or `case()` when there is a trailing newline or a |
34 | 41 | comment inside of the parentheses. (#2760) |
35 | | -- Black now normalizes string prefix order (#2297) |
| 42 | + |
| 43 | +### Performance |
| 44 | + |
| 45 | +- Speed-up the new backtracking parser about 4X in general (enabled when |
| 46 | + `--target-version` is set to 3.10 and higher). (#2728) |
| 47 | +- _Black_ is now compiled with [mypyc](https://github.com/mypyc/mypyc) for an overall 2x |
| 48 | + speed-up. 64-bit Windows, MacOS, and Linux (not including musl) are supported. (#1009, |
| 49 | + #2431) |
| 50 | + |
| 51 | +### Configuration |
| 52 | + |
| 53 | +- Do not accept bare carriage return line endings in pyproject.toml (#2408) |
36 | 54 | - Add configuration option (`python-cell-magics`) to format cells with custom magics in |
37 | 55 | Jupyter Notebooks (#2744) |
38 | | -- Deprecate `--experimental-string-processing` and move the functionality under |
39 | | - `--preview` (#2789) |
| 56 | +- Allow setting custom cache directory on all platforms with environment variable |
| 57 | + `BLACK_CACHE_DIR` (#2739). |
40 | 58 | - Enable Python 3.10+ by default, without any extra need to specify |
41 | 59 | `--target-version=py310`. (#2758) |
42 | 60 | - Make passing `SRC` or `--code` mandatory and mutually exclusive (#2804) |
|
48 | 66 | - Deprecate the `black-primer` tool (#2809) |
49 | 67 | - Allow specifying `config` in config files to include configuration options (#2525) |
50 | 68 |
|
| 69 | +### Output |
| 70 | + |
| 71 | +- Improve error message for invalid regular expression (#2678) |
| 72 | +- Improve error message when parsing fails during AST safety check by embedding the |
| 73 | + underlying SyntaxError (#2693) |
| 74 | +- No longer color diff headers white as it's unreadable in light themed terminals |
| 75 | + (#2691) |
| 76 | +- Text coloring added in the final statistics (#2712) |
| 77 | +- Verbose mode also now describes how a project root was discovered and which paths will |
| 78 | + be formatted. (#2526) |
| 79 | + |
51 | 80 | ### Packaging |
52 | 81 |
|
53 | 82 | - All upper version bounds on dependencies have been removed (#2718) |
54 | 83 | - `typing-extensions` is no longer a required dependency in Python 3.10+ (#2772) |
55 | 84 | - Set `click` lower bound to `8.0.0` (#2791) |
56 | 85 |
|
57 | | -### Preview style |
58 | | - |
59 | | -- Introduce the `--preview` flag (#2752) |
60 | | -- Add `--experimental-string-processing` to the preview style (#2789) |
61 | | - |
62 | 86 | ### Integrations |
63 | 87 |
|
64 | 88 | - Update GitHub action to support containerized runs (#2748) |
|
68 | 92 | - Change protocol in pip installation instructions to `https://` (#2761) |
69 | 93 | - Change HTML theme to Furo primarily for its responsive design and mobile support |
70 | 94 | (#2793) |
| 95 | +- Deprecate the `black-primer` tool (#2809) |
| 96 | +- Document Python support policy (#2819) |
71 | 97 |
|
72 | 98 | ## 21.12b0 |
73 | 99 |
|
|
120 | 146 | when `--target-version py310` is explicitly specified (#2586) |
121 | 147 | - Add support for parenthesized with (#2586) |
122 | 148 | - Declare support for Python 3.10 for running Black (#2562) |
| 149 | +- Fix unstable black runs around magic trailing comma (#2572) |
123 | 150 |
|
124 | 151 | ### Integrations |
125 | 152 |
|
|
0 commit comments