]> git.madduck.net Git - etc/vim.git/blob - CHANGES.md

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Remove separate 3.11 CI now deps support 3.11 (#3446)
[etc/vim.git] / CHANGES.md
1 # Change Log
2
3 ## Unreleased
4
5 ### Highlights
6
7 <!-- Include any especially major or disruptive changes here -->
8
9 ### Stable style
10
11 <!-- Changes that affect Black's stable style -->
12
13 - Fix a crash when a colon line is marked between `# fmt: off` and `# fmt: on` (#3439)
14
15 ### Preview style
16
17 <!-- Changes that affect Black's preview style -->
18
19 - Fix a crash in preview style with assert + parenthesized string (#3415)
20 - Do not put the closing quotes in a docstring on a separate line, even if the line is
21   too long (#3430)
22 - Long values in dict literals are now wrapped in parentheses; correspondingly
23   unnecessary parentheses around short values in dict literals are now removed; long
24   string lambda values are now wrapped in parentheses (#3440)
25
26 ### Configuration
27
28 <!-- Changes to how Black can be configured -->
29
30 ### Packaging
31
32 <!-- Changes to how Black is packaged, such as dependency requirements -->
33
34 - Upgrade mypyc from `0.971` to `0.991` so mypycified _Black_ can be built on armv7
35   (#3380)
36
37 ### Parser
38
39 <!-- Changes to the parser or to version autodetection -->
40
41 ### Performance
42
43 <!-- Changes that improve Black's performance. -->
44
45 ### Output
46
47 <!-- Changes to Black's terminal output and error messages -->
48
49 - Verbose logging now shows the values of `pyproject.toml` configuration variables
50   (#3392)
51
52 ### _Blackd_
53
54 <!-- Changes to blackd -->
55
56 ### Integrations
57
58 <!-- For example, Docker, GitHub Actions, pre-commit, editors -->
59
60 - Move 3.11 CI to normal flow now all dependencies support 3.11 (#3446)
61
62 ### Documentation
63
64 <!-- Major changes to documentation and policies. Small docs changes
65      don't need a changelog entry. -->
66
67 ## 22.12.0
68
69 ### Preview style
70
71 <!-- Changes that affect Black's preview style -->
72
73 - Enforce empty lines before classes and functions with sticky leading comments (#3302)
74 - Reformat empty and whitespace-only files as either an empty file (if no newline is
75   present) or as a single newline character (if a newline is present) (#3348)
76 - Implicitly concatenated strings used as function args are now wrapped inside
77   parentheses (#3307)
78 - For assignment statements, prefer splitting the right hand side if the left hand side
79   fits on a single line (#3368)
80 - Correctly handle trailing commas that are inside a line's leading non-nested parens
81   (#3370)
82
83 ### Configuration
84
85 <!-- Changes to how Black can be configured -->
86
87 - Fix incorrectly applied `.gitignore` rules by considering the `.gitignore` location
88   and the relative path to the target file (#3338)
89 - Fix incorrectly ignoring `.gitignore` presence when more than one source directory is
90   specified (#3336)
91
92 ### Parser
93
94 <!-- Changes to the parser or to version autodetection -->
95
96 - Parsing support has been added for walruses inside generator expression that are
97   passed as function args (for example,
98   `any(match := my_re.match(text) for text in texts)`) (#3327).
99
100 ### Integrations
101
102 <!-- For example, Docker, GitHub Actions, pre-commit, editors -->
103
104 - Vim plugin: Optionally allow using the system installation of Black via
105   `let g:black_use_virtualenv = 0`(#3309)
106
107 ## 22.10.0
108
109 ### Highlights
110
111 - Runtime support for Python 3.6 has been removed. Formatting 3.6 code will still be
112   supported until further notice.
113
114 ### Stable style
115
116 - Fix a crash when `# fmt: on` is used on a different block level than `# fmt: off`
117   (#3281)
118
119 ### Preview style
120
121 - Fix a crash when formatting some dicts with parenthesis-wrapped long string keys
122   (#3262)
123
124 ### Configuration
125
126 - `.ipynb_checkpoints` directories are now excluded by default (#3293)
127 - Add `--skip-source-first-line` / `-x` option to ignore the first line of source code
128   while formatting (#3299)
129
130 ### Packaging
131
132 - Executables made with PyInstaller will no longer crash when formatting several files
133   at once on macOS. Native x86-64 executables for macOS are available once again.
134   (#3275)
135 - Hatchling is now used as the build backend. This will not have any effect for users
136   who install Black with its wheels from PyPI. (#3233)
137 - Faster compiled wheels are now available for CPython 3.11 (#3276)
138
139 ### _Blackd_
140
141 - Windows style (CRLF) newlines will be preserved (#3257).
142
143 ### Integrations
144
145 - Vim plugin: add flag (`g:black_preview`) to enable/disable the preview style (#3246)
146 - Update GitHub Action to support formatting of Jupyter Notebook files via a `jupyter`
147   option (#3282)
148 - Update GitHub Action to support use of version specifiers (e.g. `<23`) for Black
149   version (#3265)
150
151 ## 22.8.0
152
153 ### Highlights
154
155 - Python 3.11 is now supported, except for _blackd_ as aiohttp does not support 3.11 as
156   of publishing (#3234)
157 - This is the last release that supports running _Black_ on Python 3.6 (formatting 3.6
158   code will continue to be supported until further notice)
159 - Reword the stability policy to say that we may, in rare cases, make changes that
160   affect code that was not previously formatted by _Black_ (#3155)
161
162 ### Stable style
163
164 - Fix an infinite loop when using `# fmt: on/off` in the middle of an expression or code
165   block (#3158)
166 - Fix incorrect handling of `# fmt: skip` on colon (`:`) lines (#3148)
167 - Comments are no longer deleted when a line had spaces removed around power operators
168   (#2874)
169
170 ### Preview style
171
172 - Single-character closing docstring quotes are no longer moved to their own line as
173   this is invalid. This was a bug introduced in version 22.6.0. (#3166)
174 - `--skip-string-normalization` / `-S` now prevents docstring prefixes from being
175   normalized as expected (#3168)
176 - When using `--skip-magic-trailing-comma` or `-C`, trailing commas are stripped from
177   subscript expressions with more than 1 element (#3209)
178 - Implicitly concatenated strings inside a list, set, or tuple are now wrapped inside
179   parentheses (#3162)
180 - Fix a string merging/split issue when a comment is present in the middle of implicitly
181   concatenated strings on its own line (#3227)
182
183 ### _Blackd_
184
185 - `blackd` now supports enabling the preview style via the `X-Preview` header (#3217)
186
187 ### Configuration
188
189 - Black now uses the presence of debug f-strings to detect target version (#3215)
190 - Fix misdetection of project root and verbose logging of sources in cases involving
191   `--stdin-filename` (#3216)
192 - Immediate `.gitignore` files in source directories given on the command line are now
193   also respected, previously only `.gitignore` files in the project root and
194   automatically discovered directories were respected (#3237)
195
196 ### Documentation
197
198 - Recommend using BlackConnect in IntelliJ IDEs (#3150)
199
200 ### Integrations
201
202 - Vim plugin: prefix messages with `Black: ` so it's clear they come from Black (#3194)
203 - Docker: changed to a /opt/venv installation + added to PATH to be available to
204   non-root users (#3202)
205
206 ### Output
207
208 - Change from deprecated `asyncio.get_event_loop()` to create our event loop which
209   removes DeprecationWarning (#3164)
210 - Remove logging from internal `blib2to3` library since it regularly emits error logs
211   about failed caching that can and should be ignored (#3193)
212
213 ### Parser
214
215 - Type comments are now included in the AST equivalence check consistently so accidental
216   deletion raises an error. Though type comments can't be tracked when running on PyPy
217   3.7 due to standard library limitations. (#2874)
218
219 ### Performance
220
221 - Reduce Black's startup time when formatting a single file by 15-30% (#3211)
222
223 ## 22.6.0
224
225 ### Style
226
227 - Fix unstable formatting involving `#fmt: skip` and `# fmt:skip` comments (notice the
228   lack of spaces) (#2970)
229
230 ### Preview style
231
232 - Docstring quotes are no longer moved if it would violate the line length limit (#3044)
233 - Parentheses around return annotations are now managed (#2990)
234 - Remove unnecessary parentheses around awaited objects (#2991)
235 - Remove unnecessary parentheses in `with` statements (#2926)
236 - Remove trailing newlines after code block open (#3035)
237
238 ### Integrations
239
240 - Add `scripts/migrate-black.py` script to ease introduction of Black to a Git project
241   (#3038)
242
243 ### Output
244
245 - Output Python version and implementation as part of `--version` flag (#2997)
246
247 ### Packaging
248
249 - Use `tomli` instead of `tomllib` on Python 3.11 builds where `tomllib` is not
250   available (#2987)
251
252 ### Parser
253
254 - [PEP 654](https://peps.python.org/pep-0654/#except) syntax (for example,
255   `except *ExceptionGroup:`) is now supported (#3016)
256 - [PEP 646](https://peps.python.org/pep-0646) syntax (for example,
257   `Array[Batch, *Shape]` or `def fn(*args: *T) -> None`) is now supported (#3071)
258
259 ### Vim Plugin
260
261 - Fix `strtobool` function. It didn't parse true/on/false/off. (#3025)
262
263 ## 22.3.0
264
265 ### Preview style
266
267 - Code cell separators `#%%` are now standardised to `# %%` (#2919)
268 - Remove unnecessary parentheses from `except` statements (#2939)
269 - Remove unnecessary parentheses from tuple unpacking in `for` loops (#2945)
270 - Avoid magic-trailing-comma in single-element subscripts (#2942)
271
272 ### Configuration
273
274 - Do not format `__pypackages__` directories by default (#2836)
275 - Add support for specifying stable version with `--required-version` (#2832).
276 - Avoid crashing when the user has no homedir (#2814)
277 - Avoid crashing when md5 is not available (#2905)
278 - Fix handling of directory junctions on Windows (#2904)
279
280 ### Documentation
281
282 - Update pylint config documentation (#2931)
283
284 ### Integrations
285
286 - Move test to disable plugin in Vim/Neovim, which speeds up loading (#2896)
287
288 ### Output
289
290 - In verbose mode, log when _Black_ is using user-level config (#2861)
291
292 ### Packaging
293
294 - Fix Black to work with Click 8.1.0 (#2966)
295 - On Python 3.11 and newer, use the standard library's `tomllib` instead of `tomli`
296   (#2903)
297 - `black-primer`, the deprecated internal devtool, has been removed and copied to a
298   [separate repository](https://github.com/cooperlees/black-primer) (#2924)
299
300 ### Parser
301
302 - Black can now parse starred expressions in the target of `for` and `async for`
303   statements, e.g `for item in *items_1, *items_2: pass` (#2879).
304
305 ## 22.1.0
306
307 At long last, _Black_ is no longer a beta product! This is the first non-beta release
308 and the first release covered by our new
309 [stability policy](https://black.readthedocs.io/en/stable/the_black_code_style/index.html#stability-policy).
310
311 ### Highlights
312
313 - **Remove Python 2 support** (#2740)
314 - Introduce the `--preview` flag (#2752)
315
316 ### Style
317
318 - Deprecate `--experimental-string-processing` and move the functionality under
319   `--preview` (#2789)
320 - For stubs, one blank line between class attributes and methods is now kept if there's
321   at least one pre-existing blank line (#2736)
322 - Black now normalizes string prefix order (#2297)
323 - Remove spaces around power operators if both operands are simple (#2726)
324 - Work around bug that causes unstable formatting in some cases in the presence of the
325   magic trailing comma (#2807)
326 - Use parentheses for attribute access on decimal float and int literals (#2799)
327 - Don't add whitespace for attribute access on hexadecimal, binary, octal, and complex
328   literals (#2799)
329 - Treat blank lines in stubs the same inside top-level `if` statements (#2820)
330 - Fix unstable formatting with semicolons and arithmetic expressions (#2817)
331 - Fix unstable formatting around magic trailing comma (#2572)
332
333 ### Parser
334
335 - Fix mapping cases that contain as-expressions, like `case {"key": 1 | 2 as password}`
336   (#2686)
337 - Fix cases that contain multiple top-level as-expressions, like `case 1 as a, 2 as b`
338   (#2716)
339 - Fix call patterns that contain as-expressions with keyword arguments, like
340   `case Foo(bar=baz as quux)` (#2749)
341 - Tuple unpacking on `return` and `yield` constructs now implies 3.8+ (#2700)
342 - Unparenthesized tuples on annotated assignments (e.g
343   `values: Tuple[int, ...] = 1, 2, 3`) now implies 3.8+ (#2708)
344 - Fix handling of standalone `match()` or `case()` when there is a trailing newline or a
345   comment inside of the parentheses. (#2760)
346 - `from __future__ import annotations` statement now implies Python 3.7+ (#2690)
347
348 ### Performance
349
350 - Speed-up the new backtracking parser about 4X in general (enabled when
351   `--target-version` is set to 3.10 and higher). (#2728)
352 - _Black_ is now compiled with [mypyc](https://github.com/mypyc/mypyc) for an overall 2x
353   speed-up. 64-bit Windows, MacOS, and Linux (not including musl) are supported. (#1009,
354   #2431)
355
356 ### Configuration
357
358 - Do not accept bare carriage return line endings in pyproject.toml (#2408)
359 - Add configuration option (`python-cell-magics`) to format cells with custom magics in
360   Jupyter Notebooks (#2744)
361 - Allow setting custom cache directory on all platforms with environment variable
362   `BLACK_CACHE_DIR` (#2739).
363 - Enable Python 3.10+ by default, without any extra need to specify
364   `--target-version=py310`. (#2758)
365 - Make passing `SRC` or `--code` mandatory and mutually exclusive (#2804)
366
367 ### Output
368
369 - Improve error message for invalid regular expression (#2678)
370 - Improve error message when parsing fails during AST safety check by embedding the
371   underlying SyntaxError (#2693)
372 - No longer color diff headers white as it's unreadable in light themed terminals
373   (#2691)
374 - Text coloring added in the final statistics (#2712)
375 - Verbose mode also now describes how a project root was discovered and which paths will
376   be formatted. (#2526)
377
378 ### Packaging
379
380 - All upper version bounds on dependencies have been removed (#2718)
381 - `typing-extensions` is no longer a required dependency in Python 3.10+ (#2772)
382 - Set `click` lower bound to `8.0.0` (#2791)
383
384 ### Integrations
385
386 - Update GitHub action to support containerized runs (#2748)
387
388 ### Documentation
389
390 - Change protocol in pip installation instructions to `https://` (#2761)
391 - Change HTML theme to Furo primarily for its responsive design and mobile support
392   (#2793)
393 - Deprecate the `black-primer` tool (#2809)
394 - Document Python support policy (#2819)
395
396 ## 21.12b0
397
398 ### _Black_
399
400 - Fix determination of f-string expression spans (#2654)
401 - Fix bad formatting of error messages about EOF in multi-line statements (#2343)
402 - Functions and classes in blocks now have more consistent surrounding spacing (#2472)
403
404 #### Jupyter Notebook support
405
406 - Cell magics are now only processed if they are known Python cell magics. Earlier, all
407   cell magics were tokenized, leading to possible indentation errors e.g. with
408   `%%writefile`. (#2630)
409 - Fix assignment to environment variables in Jupyter Notebooks (#2642)
410
411 #### Python 3.10 support
412
413 - Point users to using `--target-version py310` if we detect 3.10-only syntax (#2668)
414 - Fix `match` statements with open sequence subjects, like `match a, b:` or
415   `match a, *b:` (#2639) (#2659)
416 - Fix `match`/`case` statements that contain `match`/`case` soft keywords multiple
417   times, like `match re.match()` (#2661)
418 - Fix `case` statements with an inline body (#2665)
419 - Fix styling of starred expressions inside `match` subject (#2667)
420 - Fix parser error location on invalid syntax in a `match` statement (#2649)
421 - Fix Python 3.10 support on platforms without ProcessPoolExecutor (#2631)
422 - Improve parsing performance on code that uses `match` under `--target-version py310`
423   up to ~50% (#2670)
424
425 ### Packaging
426
427 - Remove dependency on `regex` (#2644) (#2663)
428
429 ## 21.11b1
430
431 ### _Black_
432
433 - Bumped regex version minimum to 2021.4.4 to fix Pattern class usage (#2621)
434
435 ## 21.11b0
436
437 ### _Black_
438
439 - Warn about Python 2 deprecation in more cases by improving Python 2 only syntax
440   detection (#2592)
441 - Add experimental PyPy support (#2559)
442 - Add partial support for the match statement. As it's experimental, it's only enabled
443   when `--target-version py310` is explicitly specified (#2586)
444 - Add support for parenthesized with (#2586)
445 - Declare support for Python 3.10 for running Black (#2562)
446
447 ### Integrations
448
449 - Fixed vim plugin with Python 3.10 by removing deprecated distutils import (#2610)
450 - The vim plugin now parses `skip_magic_trailing_comma` from pyproject.toml (#2613)
451
452 ## 21.10b0
453
454 ### _Black_
455
456 - Document stability policy, that will apply for non-beta releases (#2529)
457 - Add new `--workers` parameter (#2514)
458 - Fixed feature detection for positional-only arguments in lambdas (#2532)
459 - Bumped typed-ast version minimum to 1.4.3 for 3.10 compatibility (#2519)
460 - Fixed a Python 3.10 compatibility issue where the loop argument was still being passed
461   even though it has been removed (#2580)
462 - Deprecate Python 2 formatting support (#2523)
463
464 ### _Blackd_
465
466 - Remove dependency on aiohttp-cors (#2500)
467 - Bump required aiohttp version to 3.7.4 (#2509)
468
469 ### _Black-Primer_
470
471 - Add primer support for --projects (#2555)
472 - Print primer summary after individual failures (#2570)
473
474 ### Integrations
475
476 - Allow to pass `target_version` in the vim plugin (#1319)
477 - Install build tools in docker file and use multi-stage build to keep the image size
478   down (#2582)
479
480 ## 21.9b0
481
482 ### Packaging
483
484 - Fix missing modules in self-contained binaries (#2466)
485 - Fix missing toml extra used during installation (#2475)
486
487 ## 21.8b0
488
489 ### _Black_
490
491 - Add support for formatting Jupyter Notebook files (#2357)
492 - Move from `appdirs` dependency to `platformdirs` (#2375)
493 - Present a more user-friendly error if .gitignore is invalid (#2414)
494 - The failsafe for accidentally added backslashes in f-string expressions has been
495   hardened to handle more edge cases during quote normalization (#2437)
496 - Avoid changing a function return type annotation's type to a tuple by adding a
497   trailing comma (#2384)
498 - Parsing support has been added for unparenthesized walruses in set literals, set
499   comprehensions, and indices (#2447).
500 - Pin `setuptools-scm` build-time dependency version (#2457)
501 - Exclude typing-extensions version 3.10.0.1 due to it being broken on Python 3.10
502   (#2460)
503
504 ### _Blackd_
505
506 - Replace sys.exit(-1) with raise ImportError as it plays more nicely with tools that
507   scan installed packages (#2440)
508
509 ### Integrations
510
511 - The provided pre-commit hooks no longer specify `language_version` to avoid overriding
512   `default_language_version` (#2430)
513
514 ## 21.7b0
515
516 ### _Black_
517
518 - Configuration files using TOML features higher than spec v0.5.0 are now supported
519   (#2301)
520 - Add primer support and test for code piped into black via STDIN (#2315)
521 - Fix internal error when `FORCE_OPTIONAL_PARENTHESES` feature is enabled (#2332)
522 - Accept empty stdin (#2346)
523 - Provide a more useful error when parsing fails during AST safety checks (#2304)
524
525 ### Docker
526
527 - Add new `latest_release` tag automation to follow latest black release on docker
528   images (#2374)
529
530 ### Integrations
531
532 - The vim plugin now searches upwards from the directory containing the current buffer
533   instead of the current working directory for pyproject.toml. (#1871)
534 - The vim plugin now reads the correct string normalization option in pyproject.toml
535   (#1869)
536 - The vim plugin no longer crashes Black when there's boolean values in pyproject.toml
537   (#1869)
538
539 ## 21.6b0
540
541 ### _Black_
542
543 - Fix failure caused by `fmt: skip` and indentation (#2281)
544 - Account for += assignment when deciding whether to split string (#2312)
545 - Correct max string length calculation when there are string operators (#2292)
546 - Fixed option usage when using the `--code` flag (#2259)
547 - Do not call `uvloop.install()` when _Black_ is used as a library (#2303)
548 - Added `--required-version` option to require a specific version to be running (#2300)
549 - Fix incorrect custom breakpoint indices when string group contains fake f-strings
550   (#2311)
551 - Fix regression where `R` prefixes would be lowercased for docstrings (#2285)
552 - Fix handling of named escapes (`\N{...}`) when `--experimental-string-processing` is
553   used (#2319)
554
555 ### Integrations
556
557 - The official Black action now supports choosing what version to use, and supports the
558   major 3 OSes. (#1940)
559
560 ## 21.5b2
561
562 ### _Black_
563
564 - A space is no longer inserted into empty docstrings (#2249)
565 - Fix handling of .gitignore files containing non-ASCII characters on Windows (#2229)
566 - Respect `.gitignore` files in all levels, not only `root/.gitignore` file (apply
567   `.gitignore` rules like `git` does) (#2225)
568 - Restored compatibility with Click 8.0 on Python 3.6 when LANG=C used (#2227)
569 - Add extra uvloop install + import support if in python env (#2258)
570 - Fix --experimental-string-processing crash when matching parens are not found (#2283)
571 - Make sure to split lines that start with a string operator (#2286)
572 - Fix regular expression that black uses to identify f-expressions (#2287)
573
574 ### _Blackd_
575
576 - Add a lower bound for the `aiohttp-cors` dependency. Only 0.4.0 or higher is
577   supported. (#2231)
578
579 ### Packaging
580
581 - Release self-contained x86_64 MacOS binaries as part of the GitHub release pipeline
582   (#2198)
583 - Always build binaries with the latest available Python (#2260)
584
585 ### Documentation
586
587 - Add discussion of magic comments to FAQ page (#2272)
588 - `--experimental-string-processing` will be enabled by default in the future (#2273)
589 - Fix typos discovered by codespell (#2228)
590 - Fix Vim plugin installation instructions. (#2235)
591 - Add new Frequently Asked Questions page (#2247)
592 - Fix encoding + symlink issues preventing proper build on Windows (#2262)
593
594 ## 21.5b1
595
596 ### _Black_
597
598 - Refactor `src/black/__init__.py` into many files (#2206)
599
600 ### Documentation
601
602 - Replaced all remaining references to the
603   [`master`](https://github.com/psf/black/tree/main) branch with the
604   [`main`](https://github.com/psf/black/tree/main) branch. Some additional changes in
605   the source code were also made. (#2210)
606 - Sigificantly reorganized the documentation to make much more sense. Check them out by
607   heading over to [the stable docs on RTD](https://black.readthedocs.io/en/stable/).
608   (#2174)
609
610 ## 21.5b0
611
612 ### _Black_
613
614 - Set `--pyi` mode if `--stdin-filename` ends in `.pyi` (#2169)
615 - Stop detecting target version as Python 3.9+ with pre-PEP-614 decorators that are
616   being called but with no arguments (#2182)
617
618 ### _Black-Primer_
619
620 - Add `--no-diff` to black-primer to suppress formatting changes (#2187)
621
622 ## 21.4b2
623
624 ### _Black_
625
626 - Fix crash if the user configuration directory is inaccessible. (#2158)
627
628 - Clarify
629   [circumstances](https://github.com/psf/black/blob/master/docs/the_black_code_style.md#pragmatism)
630   in which _Black_ may change the AST (#2159)
631
632 - Allow `.gitignore` rules to be overridden by specifying `exclude` in `pyproject.toml`
633   or on the command line. (#2170)
634
635 ### _Packaging_
636
637 - Install `primer.json` (used by `black-primer` by default) with black. (#2154)
638
639 ## 21.4b1
640
641 ### _Black_
642
643 - Fix crash on docstrings ending with "\\ ". (#2142)
644
645 - Fix crash when atypical whitespace is cleaned out of dostrings (#2120)
646
647 - Reflect the `--skip-magic-trailing-comma` and `--experimental-string-processing` flags
648   in the name of the cache file. Without this fix, changes in these flags would not take
649   effect if the cache had already been populated. (#2131)
650
651 - Don't remove necessary parentheses from assignment expression containing assert /
652   return statements. (#2143)
653
654 ### _Packaging_
655
656 - Bump pathspec to >= 0.8.1 to solve invalid .gitignore exclusion handling
657
658 ## 21.4b0
659
660 ### _Black_
661
662 - Fixed a rare but annoying formatting instability created by the combination of
663   optional trailing commas inserted by `Black` and optional parentheses looking at
664   pre-existing "magic" trailing commas. This fixes issue #1629 and all of its many many
665   duplicates. (#2126)
666
667 - `Black` now processes one-line docstrings by stripping leading and trailing spaces,
668   and adding a padding space when needed to break up """". (#1740)
669
670 - `Black` now cleans up leading non-breaking spaces in comments (#2092)
671
672 - `Black` now respects `--skip-string-normalization` when normalizing multiline
673   docstring quotes (#1637)
674
675 - `Black` no longer removes all empty lines between non-function code and decorators
676   when formatting typing stubs. Now `Black` enforces a single empty line. (#1646)
677
678 - `Black` no longer adds an incorrect space after a parenthesized assignment expression
679   in if/while statements (#1655)
680
681 - Added `--skip-magic-trailing-comma` / `-C` to avoid using trailing commas as a reason
682   to split lines (#1824)
683
684 - fixed a crash when PWD=/ on POSIX (#1631)
685
686 - fixed "I/O operation on closed file" when using --diff (#1664)
687
688 - Prevent coloured diff output being interleaved with multiple files (#1673)
689
690 - Added support for PEP 614 relaxed decorator syntax on python 3.9 (#1711)
691
692 - Added parsing support for unparenthesized tuples and yield expressions in annotated
693   assignments (#1835)
694
695 - added `--extend-exclude` argument (PR #2005)
696
697 - speed up caching by avoiding pathlib (#1950)
698
699 - `--diff` correctly indicates when a file doesn't end in a newline (#1662)
700
701 - Added `--stdin-filename` argument to allow stdin to respect `--force-exclude` rules
702   (#1780)
703
704 - Lines ending with `fmt: skip` will now be not formatted (#1800)
705
706 - PR #2053: Black no longer relies on typed-ast for Python 3.8 and higher
707
708 - PR #2053: Python 2 support is now optional, install with
709   `python3 -m pip install black[python2]` to maintain support.
710
711 - Exclude `venv` directory by default (#1683)
712
713 - Fixed "Black produced code that is not equivalent to the source" when formatting
714   Python 2 docstrings (#2037)
715
716 ### _Packaging_
717
718 - Self-contained native _Black_ binaries are now provided for releases via GitHub
719   Releases (#1743)
720
721 ## 20.8b1
722
723 ### _Packaging_
724
725 - explicitly depend on Click 7.1.2 or newer as `Black` no longer works with versions
726   older than 7.0
727
728 ## 20.8b0
729
730 ### _Black_
731
732 - re-implemented support for explicit trailing commas: now it works consistently within
733   any bracket pair, including nested structures (#1288 and duplicates)
734
735 - `Black` now reindents docstrings when reindenting code around it (#1053)
736
737 - `Black` now shows colored diffs (#1266)
738
739 - `Black` is now packaged using 'py3' tagged wheels (#1388)
740
741 - `Black` now supports Python 3.8 code, e.g. star expressions in return statements
742   (#1121)
743
744 - `Black` no longer normalizes capital R-string prefixes as those have a
745   community-accepted meaning (#1244)
746
747 - `Black` now uses exit code 2 when specified configuration file doesn't exit (#1361)
748
749 - `Black` now works on AWS Lambda (#1141)
750
751 - added `--force-exclude` argument (#1032)
752
753 - removed deprecated `--py36` option (#1236)
754
755 - fixed `--diff` output when EOF is encountered (#526)
756
757 - fixed `# fmt: off` handling around decorators (#560)
758
759 - fixed unstable formatting with some `# type: ignore` comments (#1113)
760
761 - fixed invalid removal on organizing brackets followed by indexing (#1575)
762
763 - introduced `black-primer`, a CI tool that allows us to run regression tests against
764   existing open source users of Black (#1402)
765
766 - introduced property-based fuzzing to our test suite based on Hypothesis and
767   Hypothersmith (#1566)
768
769 - implemented experimental and disabled by default long string rewrapping (#1132),
770   hidden under a `--experimental-string-processing` flag while it's being worked on;
771   this is an undocumented and unsupported feature, you lose Internet points for
772   depending on it (#1609)
773
774 ### Vim plugin
775
776 - prefer virtualenv packages over global packages (#1383)
777
778 ## 19.10b0
779
780 - added support for PEP 572 assignment expressions (#711)
781
782 - added support for PEP 570 positional-only arguments (#943)
783
784 - added support for async generators (#593)
785
786 - added support for pre-splitting collections by putting an explicit trailing comma
787   inside (#826)
788
789 - added `black -c` as a way to format code passed from the command line (#761)
790
791 - --safe now works with Python 2 code (#840)
792
793 - fixed grammar selection for Python 2-specific code (#765)
794
795 - fixed feature detection for trailing commas in function definitions and call sites
796   (#763)
797
798 - `# fmt: off`/`# fmt: on` comment pairs placed multiple times within the same block of
799   code now behave correctly (#1005)
800
801 - _Black_ no longer crashes on Windows machines with more than 61 cores (#838)
802
803 - _Black_ no longer crashes on standalone comments prepended with a backslash (#767)
804
805 - _Black_ no longer crashes on `from` ... `import` blocks with comments (#829)
806
807 - _Black_ no longer crashes on Python 3.7 on some platform configurations (#494)
808
809 - _Black_ no longer fails on comments in from-imports (#671)
810
811 - _Black_ no longer fails when the file starts with a backslash (#922)
812
813 - _Black_ no longer merges regular comments with type comments (#1027)
814
815 - _Black_ no longer splits long lines that contain type comments (#997)
816
817 - removed unnecessary parentheses around `yield` expressions (#834)
818
819 - added parentheses around long tuples in unpacking assignments (#832)
820
821 - added parentheses around complex powers when they are prefixed by a unary operator
822   (#646)
823
824 - fixed bug that led _Black_ format some code with a line length target of 1 (#762)
825
826 - _Black_ no longer introduces quotes in f-string subexpressions on string boundaries
827   (#863)
828
829 - if _Black_ puts parenthesis around a single expression, it moves comments to the
830   wrapped expression instead of after the brackets (#872)
831
832 - `blackd` now returns the version of _Black_ in the response headers (#1013)
833
834 - `blackd` can now output the diff of formats on source code when the `X-Diff` header is
835   provided (#969)
836
837 ## 19.3b0
838
839 - new option `--target-version` to control which Python versions _Black_-formatted code
840   should target (#618)
841
842 - deprecated `--py36` (use `--target-version=py36` instead) (#724)
843
844 - _Black_ no longer normalizes numeric literals to include `_` separators (#696)
845
846 - long `del` statements are now split into multiple lines (#698)
847
848 - type comments are no longer mangled in function signatures
849
850 - improved performance of formatting deeply nested data structures (#509)
851
852 - _Black_ now properly formats multiple files in parallel on Windows (#632)
853
854 - _Black_ now creates cache files atomically which allows it to be used in parallel
855   pipelines (like `xargs -P8`) (#673)
856
857 - _Black_ now correctly indents comments in files that were previously formatted with
858   tabs (#262)
859
860 - `blackd` now supports CORS (#622)
861
862 ## 18.9b0
863
864 - numeric literals are now formatted by _Black_ (#452, #461, #464, #469):
865
866   - numeric literals are normalized to include `_` separators on Python 3.6+ code
867
868   - added `--skip-numeric-underscore-normalization` to disable the above behavior and
869     leave numeric underscores as they were in the input
870
871   - code with `_` in numeric literals is recognized as Python 3.6+
872
873   - most letters in numeric literals are lowercased (e.g., in `1e10`, `0x01`)
874
875   - hexadecimal digits are always uppercased (e.g. `0xBADC0DE`)
876
877 - added `blackd`, see
878   [its documentation](https://github.com/psf/black/blob/18.9b0/README.md#blackd) for
879   more info (#349)
880
881 - adjacent string literals are now correctly split into multiple lines (#463)
882
883 - trailing comma is now added to single imports that don't fit on a line (#250)
884
885 - cache is now populated when `--check` is successful for a file which speeds up
886   consecutive checks of properly formatted unmodified files (#448)
887
888 - whitespace at the beginning of the file is now removed (#399)
889
890 - fixed mangling [pweave](http://mpastell.com/pweave/) and
891   [Spyder IDE](https://www.spyder-ide.org/) special comments (#532)
892
893 - fixed unstable formatting when unpacking big tuples (#267)
894
895 - fixed parsing of `__future__` imports with renames (#389)
896
897 - fixed scope of `# fmt: off` when directly preceding `yield` and other nodes (#385)
898
899 - fixed formatting of lambda expressions with default arguments (#468)
900
901 - fixed `async for` statements: _Black_ no longer breaks them into separate lines (#372)
902
903 - note: the Vim plugin stopped registering `,=` as a default chord as it turned out to
904   be a bad idea (#415)
905
906 ## 18.6b4
907
908 - hotfix: don't freeze when multiple comments directly precede `# fmt: off` (#371)
909
910 ## 18.6b3
911
912 - typing stub files (`.pyi`) now have blank lines added after constants (#340)
913
914 - `# fmt: off` and `# fmt: on` are now much more dependable:
915
916   - they now work also within bracket pairs (#329)
917
918   - they now correctly work across function/class boundaries (#335)
919
920   - they now work when an indentation block starts with empty lines or misaligned
921     comments (#334)
922
923 - made Click not fail on invalid environments; note that Click is right but the
924   likelihood we'll need to access non-ASCII file paths when dealing with Python source
925   code is low (#277)
926
927 - fixed improper formatting of f-strings with quotes inside interpolated expressions
928   (#322)
929
930 - fixed unnecessary slowdown when long list literals where found in a file
931
932 - fixed unnecessary slowdown on AST nodes with very many siblings
933
934 - fixed cannibalizing backslashes during string normalization
935
936 - fixed a crash due to symbolic links pointing outside of the project directory (#338)
937
938 ## 18.6b2
939
940 - added `--config` (#65)
941
942 - added `-h` equivalent to `--help` (#316)
943
944 - fixed improper unmodified file caching when `-S` was used
945
946 - fixed extra space in string unpacking (#305)
947
948 - fixed formatting of empty triple quoted strings (#313)
949
950 - fixed unnecessary slowdown in comment placement calculation on lines without comments
951
952 ## 18.6b1
953
954 - hotfix: don't output human-facing information on stdout (#299)
955
956 - hotfix: don't output cake emoji on non-zero return code (#300)
957
958 ## 18.6b0
959
960 - added `--include` and `--exclude` (#270)
961
962 - added `--skip-string-normalization` (#118)
963
964 - added `--verbose` (#283)
965
966 - the header output in `--diff` now actually conforms to the unified diff spec
967
968 - fixed long trivial assignments being wrapped in unnecessary parentheses (#273)
969
970 - fixed unnecessary parentheses when a line contained multiline strings (#232)
971
972 - fixed stdin handling not working correctly if an old version of Click was used (#276)
973
974 - _Black_ now preserves line endings when formatting a file in place (#258)
975
976 ## 18.5b1
977
978 - added `--pyi` (#249)
979
980 - added `--py36` (#249)
981
982 - Python grammar pickle caches are stored with the formatting caches, making _Black_
983   work in environments where site-packages is not user-writable (#192)
984
985 - _Black_ now enforces a PEP 257 empty line after a class-level docstring (and/or
986   fields) and the first method
987
988 - fixed invalid code produced when standalone comments were present in a trailer that
989   was omitted from line splitting on a large expression (#237)
990
991 - fixed optional parentheses being removed within `# fmt: off` sections (#224)
992
993 - fixed invalid code produced when stars in very long imports were incorrectly wrapped
994   in optional parentheses (#234)
995
996 - fixed unstable formatting when inline comments were moved around in a trailer that was
997   omitted from line splitting on a large expression (#238)
998
999 - fixed extra empty line between a class declaration and the first method if no class
1000   docstring or fields are present (#219)
1001
1002 - fixed extra empty line between a function signature and an inner function or inner
1003   class (#196)
1004
1005 ## 18.5b0
1006
1007 - call chains are now formatted according to the
1008   [fluent interfaces](https://en.wikipedia.org/wiki/Fluent_interface) style (#67)
1009
1010 - data structure literals (tuples, lists, dictionaries, and sets) are now also always
1011   exploded like imports when they don't fit in a single line (#152)
1012
1013 - slices are now formatted according to PEP 8 (#178)
1014
1015 - parentheses are now also managed automatically on the right-hand side of assignments
1016   and return statements (#140)
1017
1018 - math operators now use their respective priorities for delimiting multiline
1019   expressions (#148)
1020
1021 - optional parentheses are now omitted on expressions that start or end with a bracket
1022   and only contain a single operator (#177)
1023
1024 - empty parentheses in a class definition are now removed (#145, #180)
1025
1026 - string prefixes are now standardized to lowercase and `u` is removed on Python 3.6+
1027   only code and Python 2.7+ code with the `unicode_literals` future import (#188, #198,
1028   #199)
1029
1030 - typing stub files (`.pyi`) are now formatted in a style that is consistent with PEP
1031   484 (#207, #210)
1032
1033 - progress when reformatting many files is now reported incrementally
1034
1035 - fixed trailers (content with brackets) being unnecessarily exploded into their own
1036   lines after a dedented closing bracket (#119)
1037
1038 - fixed an invalid trailing comma sometimes left in imports (#185)
1039
1040 - fixed non-deterministic formatting when multiple pairs of removable parentheses were
1041   used (#183)
1042
1043 - fixed multiline strings being unnecessarily wrapped in optional parentheses in long
1044   assignments (#215)
1045
1046 - fixed not splitting long from-imports with only a single name
1047
1048 - fixed Python 3.6+ file discovery by also looking at function calls with unpacking.
1049   This fixed non-deterministic formatting if trailing commas where used both in function
1050   signatures with stars and function calls with stars but the former would be
1051   reformatted to a single line.
1052
1053 - fixed crash on dealing with optional parentheses (#193)
1054
1055 - fixed "is", "is not", "in", and "not in" not considered operators for splitting
1056   purposes
1057
1058 - fixed crash when dead symlinks where encountered
1059
1060 ## 18.4a4
1061
1062 - don't populate the cache on `--check` (#175)
1063
1064 ## 18.4a3
1065
1066 - added a "cache"; files already reformatted that haven't changed on disk won't be
1067   reformatted again (#109)
1068
1069 - `--check` and `--diff` are no longer mutually exclusive (#149)
1070
1071 - generalized star expression handling, including double stars; this fixes
1072   multiplication making expressions "unsafe" for trailing commas (#132)
1073
1074 - _Black_ no longer enforces putting empty lines behind control flow statements (#90)
1075
1076 - _Black_ now splits imports like "Mode 3 + trailing comma" of isort (#127)
1077
1078 - fixed comment indentation when a standalone comment closes a block (#16, #32)
1079
1080 - fixed standalone comments receiving extra empty lines if immediately preceding a
1081   class, def, or decorator (#56, #154)
1082
1083 - fixed `--diff` not showing entire path (#130)
1084
1085 - fixed parsing of complex expressions after star and double stars in function calls
1086   (#2)
1087
1088 - fixed invalid splitting on comma in lambda arguments (#133)
1089
1090 - fixed missing splits of ternary expressions (#141)
1091
1092 ## 18.4a2
1093
1094 - fixed parsing of unaligned standalone comments (#99, #112)
1095
1096 - fixed placement of dictionary unpacking inside dictionary literals (#111)
1097
1098 - Vim plugin now works on Windows, too
1099
1100 - fixed unstable formatting when encountering unnecessarily escaped quotes in a string
1101   (#120)
1102
1103 ## 18.4a1
1104
1105 - added `--quiet` (#78)
1106
1107 - added automatic parentheses management (#4)
1108
1109 - added [pre-commit](https://pre-commit.com) integration (#103, #104)
1110
1111 - fixed reporting on `--check` with multiple files (#101, #102)
1112
1113 - fixed removing backslash escapes from raw strings (#100, #105)
1114
1115 ## 18.4a0
1116
1117 - added `--diff` (#87)
1118
1119 - add line breaks before all delimiters, except in cases like commas, to better comply
1120   with PEP 8 (#73)
1121
1122 - standardize string literals to use double quotes (almost) everywhere (#75)
1123
1124 - fixed handling of standalone comments within nested bracketed expressions; _Black_
1125   will no longer produce super long lines or put all standalone comments at the end of
1126   the expression (#22)
1127
1128 - fixed 18.3a4 regression: don't crash and burn on empty lines with trailing whitespace
1129   (#80)
1130
1131 - fixed 18.3a4 regression: `# yapf: disable` usage as trailing comment would cause
1132   _Black_ to not emit the rest of the file (#95)
1133
1134 - when CTRL+C is pressed while formatting many files, _Black_ no longer freaks out with
1135   a flurry of asyncio-related exceptions
1136
1137 - only allow up to two empty lines on module level and only single empty lines within
1138   functions (#74)
1139
1140 ## 18.3a4
1141
1142 - `# fmt: off` and `# fmt: on` are implemented (#5)
1143
1144 - automatic detection of deprecated Python 2 forms of print statements and exec
1145   statements in the formatted file (#49)
1146
1147 - use proper spaces for complex expressions in default values of typed function
1148   arguments (#60)
1149
1150 - only return exit code 1 when --check is used (#50)
1151
1152 - don't remove single trailing commas from square bracket indexing (#59)
1153
1154 - don't omit whitespace if the previous factor leaf wasn't a math operator (#55)
1155
1156 - omit extra space in kwarg unpacking if it's the first argument (#46)
1157
1158 - omit extra space in
1159   [Sphinx auto-attribute comments](http://www.sphinx-doc.org/en/stable/ext/autodoc.html#directive-autoattribute)
1160   (#68)
1161
1162 ## 18.3a3
1163
1164 - don't remove single empty lines outside of bracketed expressions (#19)
1165
1166 - added ability to pipe formatting from stdin to stdin (#25)
1167
1168 - restored ability to format code with legacy usage of `async` as a name (#20, #42)
1169
1170 - even better handling of numpy-style array indexing (#33, again)
1171
1172 ## 18.3a2
1173
1174 - changed positioning of binary operators to occur at beginning of lines instead of at
1175   the end, following
1176   [a recent change to PEP 8](https://github.com/python/peps/commit/c59c4376ad233a62ca4b3a6060c81368bd21e85b)
1177   (#21)
1178
1179 - ignore empty bracket pairs while splitting. This avoids very weirdly looking
1180   formattings (#34, #35)
1181
1182 - remove a trailing comma if there is a single argument to a call
1183
1184 - if top level functions were separated by a comment, don't put four empty lines after
1185   the upper function
1186
1187 - fixed unstable formatting of newlines with imports
1188
1189 - fixed unintentional folding of post scriptum standalone comments into last statement
1190   if it was a simple statement (#18, #28)
1191
1192 - fixed missing space in numpy-style array indexing (#33)
1193
1194 - fixed spurious space after star-based unary expressions (#31)
1195
1196 ## 18.3a1
1197
1198 - added `--check`
1199
1200 - only put trailing commas in function signatures and calls if it's safe to do so. If
1201   the file is Python 3.6+ it's always safe, otherwise only safe if there are no `*args`
1202   or `**kwargs` used in the signature or call. (#8)
1203
1204 - fixed invalid spacing of dots in relative imports (#6, #13)
1205
1206 - fixed invalid splitting after comma on unpacked variables in for-loops (#23)
1207
1208 - fixed spurious space in parenthesized set expressions (#7)
1209
1210 - fixed spurious space after opening parentheses and in default arguments (#14, #17)
1211
1212 - fixed spurious space after unary operators when the operand was a complex expression
1213   (#15)
1214
1215 ## 18.3a0
1216
1217 - first published version, Happy 🍰 Day 2018!
1218
1219 - alpha quality
1220
1221 - date-versioned (see: <https://calver.org/>)